From 074d465185f44d0ac6eaeb64b2aa9aa10b9e04d8 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Sat, 20 Jul 2024 02:11:30 +0000 Subject: [PATCH 01/34] Updating to latest FlutterFlow output. --- ios/Runner.xcodeproj/project.pbxproj | 8 +- ..._arrow_linked_locals_component_widget.dart | 348 ++++++++++-------- .../menu_staggered_view_component_widget.dart | 119 +++++- .../view_visit_detail_model.dart | 0 .../view_visit_detail_widget.dart | 0 ...etails_modal_template_component_model.dart | 2 +- ...tails_modal_template_component_widget.dart | 2 +- lib/flutter_flow/internationalization.dart | 28 +- lib/flutter_flow/nav/nav.dart | 17 +- lib/index.dart | 3 + lib/main.dart | 72 ++++ .../preferences_page_model.dart | 27 ++ .../preferences_page_widget.dart | 167 +++++++++ .../settings_page/settings_page_model.dart | 17 + .../settings_page/settings_page_widget.dart | 71 ++++ 15 files changed, 720 insertions(+), 161 deletions(-) rename lib/components/{ => templates_components}/view_visit_detail/view_visit_detail_model.dart (100%) rename lib/components/{ => templates_components}/view_visit_detail/view_visit_detail_widget.dart (100%) create mode 100644 lib/pages/preferences_page/preferences_page_model.dart create mode 100644 lib/pages/preferences_page/preferences_page_widget.dart create mode 100644 lib/pages/settings_page/settings_page_model.dart create mode 100644 lib/pages/settings_page/settings_page_widget.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1f9d87a2..bc29890e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409227A31CD600820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409227A31CDA00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409127A31CD300820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409227A31CD600820AF7 /* pt */, - 6436409227A31CDA00820AF7 /* en */, + 6436409127A31CD300820AF7 /* pt */, + 6436409227A31CD300820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; 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 505e51d8..13b68aea 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 @@ -1,4 +1,5 @@ import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; @@ -77,163 +78,206 @@ class _BottomArrowLinkedLocalsComponentWidgetState topRight: Radius.circular(0.0), ), ), - child: FutureBuilder( - future: PhpGroup.getLocalsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).accent1, + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, ), - ); - } - final gridViewGetLocalsResponse = snapshot.data!; - - return Builder( - builder: (context) { - final eachLocals = PhpGroup.getLocalsCall - .locais( - gridViewGetLocalsResponse.jsonBody, - ) - ?.map((e) => e) - .toList() - .toList() ?? - []; - - return GridView.builder( - padding: EdgeInsets.zero, - gridDelegate: - const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1, - crossAxisSpacing: 10.0, - mainAxisSpacing: 0.0, - childAspectRatio: 1.0, - ), - scrollDirection: Axis.horizontal, - itemCount: eachLocals.length, - itemBuilder: (context, eachLocalsIndex) { - final eachLocalsItem = - eachLocals[eachLocalsIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - FFAppState().cliUUID = getJsonField( - eachLocalsItem, - r'''$.CLI_ID''', - ).toString(); - setState(() {}); - FFAppState().local = getJsonField( - eachLocalsItem, - r'''$.CLI_NOME''', - ).toString(); - setState(() {}); - FFAppState().ownerUUID = getJsonField( - eachLocalsItem, - r'''$.CLU_OWNER_ID''', - ).toString(); - setState(() {}); - Navigator.pop(context); - }, - child: Container( + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + Expanded( + child: FutureBuilder( + future: PhpGroup.getLocalsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( width: 50.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - border: Border.all( - color: - FlutterFlowTheme.of(context) - .secondaryText, - width: 3.0, - ), - ), - child: ClipRRect( - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: - Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( - eachLocalsItem, - r'''$.CLI_ID''', - ).toString()}.png', - width: double.infinity, - height: double.infinity, - fit: BoxFit.fill, - alignment: const Alignment(0.0, 0.0), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Text( - getJsonField( - eachLocalsItem, - r'''$.CLI_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ], + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context).primary, + size: 50.0, ), ), ); - }, - ); - }, - ); - }, + } + final gridViewGetLocalsResponse = snapshot.data!; + + return Builder( + builder: (context) { + final eachLocals = PhpGroup.getLocalsCall + .locais( + gridViewGetLocalsResponse.jsonBody, + ) + ?.map((e) => e) + .toList() + .toList() ?? + []; + + return GridView.builder( + padding: EdgeInsets.zero, + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, + crossAxisSpacing: 10.0, + mainAxisSpacing: 0.0, + childAspectRatio: 1.0, + ), + scrollDirection: Axis.horizontal, + itemCount: eachLocals.length, + itemBuilder: (context, eachLocalsIndex) { + final eachLocalsItem = + eachLocals[eachLocalsIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + FFAppState().cliUUID = getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString(); + setState(() {}); + FFAppState().local = getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(); + setState(() {}); + FFAppState().ownerUUID = getJsonField( + eachLocalsItem, + r'''$.CLU_OWNER_ID''', + ).toString(); + setState(() {}); + Navigator.pop(context); + }, + child: Container( + width: 50.0, + height: double.infinity, + decoration: const BoxDecoration(), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryText, + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + border: Border.all( + color: FlutterFlowTheme.of( + context) + .secondaryText, + width: 3.0, + ), + ), + child: ClipRRect( + borderRadius: + const BorderRadius.only( + bottomLeft: + Radius.circular(25.0), + bottomRight: + Radius.circular(25.0), + topLeft: + Radius.circular(25.0), + topRight: + Radius.circular(25.0), + ), + child: Image.network( + 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( + eachLocalsItem, + r'''$.CLI_ID''', + ).toString()}.png', + width: double.infinity, + height: double.infinity, + fit: BoxFit.fill, + alignment: + const Alignment(0.0, 0.0), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Text( + getJsonField( + eachLocalsItem, + r'''$.CLI_NOME''', + ).toString(), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ], + ), + ), + ); + }, + ); + }, + ); + }, + ), + ), + ].addToStart(const SizedBox(width: 20.0)), ), ), ], diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 5ff542ae..f4db990c 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -80,7 +80,7 @@ class _MenuStaggeredViewComponentWidgetState ), crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, - itemCount: 8, + itemCount: 9, padding: const EdgeInsets.fromLTRB( 0, 10.0, @@ -1002,6 +1002,123 @@ de Liberação */ ), ), ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.liberationHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + Icons.settings_rounded, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'dzk31zpc' /* Preferencias +do Sistema */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), ][index](); }, ), diff --git a/lib/components/view_visit_detail/view_visit_detail_model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart similarity index 100% rename from lib/components/view_visit_detail/view_visit_detail_model.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart similarity index 100% rename from lib/components/view_visit_detail/view_visit_detail_widget.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index f305c4de..a4052e41 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,5 +1,5 @@ import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; +import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'visit_details_modal_template_component_widget.dart' show VisitDetailsModalTemplateComponentWidget; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 889c76c2..7e668742 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,5 +1,5 @@ import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; +import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; import 'visit_details_modal_template_component_model.dart'; diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index b56429ba..dc120945 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -152,7 +152,7 @@ final kTranslationsMap = >>[ 'en': 'FREE ACCESS', }, 'mp6igsok': { - 'pt': 'Home', + 'pt': '', 'en': '', }, }, @@ -490,6 +490,28 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // preferencesPage + { + '1vyj6y7n': { + 'pt': 'Preferencias', + 'en': '', + }, + 'uv1iug83': { + 'pt': '', + 'en': '', + }, + }, + // settingsPage + { + 'bc698859': { + 'pt': 'Preferencias', + 'en': '', + }, + '8fgc7z33': { + 'pt': '', + 'en': '', + }, + }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -836,6 +858,10 @@ final kTranslationsMap = >>[ 'pt': 'Histórico\nde Liberação', 'en': 'Liberation\nHistory', }, + 'dzk31zpc': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, }, // messageWellComponent { diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index fb4887f7..d6c54bca 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -6,6 +6,7 @@ import 'package:provider/provider.dart'; import '/backend/schema/structs/index.dart'; import '/index.dart'; +import '/main.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -62,7 +63,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => const HomePageWidget(), + builder: (context, params) => params.isEmpty + ? const NavBarPage(initialPage: 'homePage') + : const HomePageWidget(), ), FFRoute( name: 'registerVisitorPage', @@ -147,6 +150,18 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget(), + ), + FFRoute( + name: 'preferencesPage', + path: '/preferencesPage', + builder: (context, params) => const PreferencesPageWidget(), + ), + FFRoute( + name: 'settingsPage', + path: '/settingsPage', + builder: (context, params) => params.isEmpty + ? const NavBarPage(initialPage: 'settingsPage') + : const SettingsPageWidget(), ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index e7526939..996c7347 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -16,3 +16,6 @@ export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget; export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; +export '/pages/preferences_page/preferences_page_widget.dart' + show PreferencesPageWidget; +export '/pages/settings_page/settings_page_widget.dart' show SettingsPageWidget; diff --git a/lib/main.dart b/lib/main.dart index 05c412f7..c8c93049 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'package:flutter_web_plugins/url_strategy.dart'; import 'flutter_flow/flutter_flow_theme.dart'; import 'flutter_flow/flutter_flow_util.dart'; import 'flutter_flow/internationalization.dart'; +import 'index.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -119,3 +120,74 @@ class _MyAppState extends State { ); } } + +class NavBarPage extends StatefulWidget { + const NavBarPage({super.key, this.initialPage, this.page}); + + final String? initialPage; + final Widget? page; + + @override + _NavBarPageState createState() => _NavBarPageState(); +} + +/// This is the private State class that goes with NavBarPage. +class _NavBarPageState extends State { + String _currentPageName = 'homePage'; + late Widget? _currentPage; + + @override + void initState() { + super.initState(); + _currentPageName = widget.initialPage ?? _currentPageName; + _currentPage = widget.page; + } + + @override + Widget build(BuildContext context) { + final tabs = { + 'homePage': const HomePageWidget(), + 'settingsPage': const SettingsPageWidget(), + }; + final currentIndex = tabs.keys.toList().indexOf(_currentPageName); + + return Scaffold( + body: _currentPage ?? tabs[_currentPageName], + bottomNavigationBar: BottomNavigationBar( + currentIndex: currentIndex, + onTap: (i) => setState(() { + _currentPage = null; + _currentPageName = tabs.keys.toList()[i]; + }), + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + selectedItemColor: FlutterFlowTheme.of(context).primary, + unselectedItemColor: FlutterFlowTheme.of(context).primaryText, + showSelectedLabels: false, + showUnselectedLabels: false, + type: BottomNavigationBarType.fixed, + items: [ + BottomNavigationBarItem( + icon: const Icon( + Icons.home, + size: 24.0, + ), + label: FFLocalizations.of(context).getText( + 'mp6igsok' /* */, + ), + tooltip: '', + ), + BottomNavigationBarItem( + icon: const Icon( + Icons.settings_rounded, + size: 24.0, + ), + label: FFLocalizations.of(context).getText( + '8fgc7z33' /* */, + ), + tooltip: '', + ) + ], + ), + ); + } +} diff --git a/lib/pages/preferences_page/preferences_page_model.dart b/lib/pages/preferences_page/preferences_page_model.dart new file mode 100644 index 00000000..dfe2b66b --- /dev/null +++ b/lib/pages/preferences_page/preferences_page_model.dart @@ -0,0 +1,27 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'preferences_page_widget.dart' show PreferencesPageWidget; +import 'package:flutter/material.dart'; + +class PreferencesPageModel extends FlutterFlowModel { + /// Local state fields for this page. + + bool fingerprint = false; + + bool? person; + + bool? changPass; + + bool? notify; + + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + unfocusNode.dispose(); + } +} diff --git a/lib/pages/preferences_page/preferences_page_widget.dart b/lib/pages/preferences_page/preferences_page_widget.dart new file mode 100644 index 00000000..917b4a2a --- /dev/null +++ b/lib/pages/preferences_page/preferences_page_widget.dart @@ -0,0 +1,167 @@ +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'preferences_page_model.dart'; +export 'preferences_page_model.dart'; + +class PreferencesPageWidget extends StatefulWidget { + const PreferencesPageWidget({super.key}); + + @override + State createState() => _PreferencesPageWidgetState(); +} + +class _PreferencesPageWidgetState extends State { + late PreferencesPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => PreferencesPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + title: Text( + FFLocalizations.of(context).getText( + '1vyj6y7n' /* Preferencias */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0), + child: GridView( + padding: const EdgeInsets.fromLTRB( + 0, + 20.0, + 0, + 20.0, + ), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + childAspectRatio: 1.0, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: [ + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: double.infinity, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.fingerprint, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.fingerprint + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.person, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.person! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.notifications_active, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.notify! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.password_sharp, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.changPass! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/settings_page/settings_page_model.dart b/lib/pages/settings_page/settings_page_model.dart new file mode 100644 index 00000000..1fa111cc --- /dev/null +++ b/lib/pages/settings_page/settings_page_model.dart @@ -0,0 +1,17 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'settings_page_widget.dart' show SettingsPageWidget; +import 'package:flutter/material.dart'; + +class SettingsPageModel extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + unfocusNode.dispose(); + } +} diff --git a/lib/pages/settings_page/settings_page_widget.dart b/lib/pages/settings_page/settings_page_widget.dart new file mode 100644 index 00000000..11227b96 --- /dev/null +++ b/lib/pages/settings_page/settings_page_widget.dart @@ -0,0 +1,71 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'settings_page_model.dart'; +export 'settings_page_model.dart'; + +class SettingsPageWidget extends StatefulWidget { + const SettingsPageWidget({super.key}); + + @override + State createState() => _SettingsPageWidgetState(); +} + +class _SettingsPageWidgetState extends State { + late SettingsPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => SettingsPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primary, + automaticallyImplyLeading: false, + title: Text( + FFLocalizations.of(context).getText( + 'bc698859' /* Preferencias */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: const SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [], + ), + ), + ), + ); + } +} From 8e9f9ed589d5f682913aa8cc74ddddc5cabe36fd Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:04:38 +0000 Subject: [PATCH 02/34] fix: Form de Login do APP --- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Podfile | 2 +- ios/Runner.xcodeproj/project.pbxproj | 14 +- .../sign_in_template_component_model.dart | 4 +- .../sign_in_template_component_widget.dart | 62 +++++-- lib/flutter_flow/flutter_flow_util.dart | 11 +- lib/flutter_flow/internationalization.dart | 26 +-- lib/main.dart | 2 +- .../schedule_complete_visit_page_widget.dart | 156 ------------------ 9 files changed, 76 insertions(+), 203 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index ff0dcf11..748aee74 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 14.0 + 14.0.0 diff --git a/ios/Podfile b/ios/Podfile index a43aebd4..8f4bfd94 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '14.0' +platform :ios, '14.0.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bc29890e..528c549d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409127A31CD300820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409227A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409627A31CD000820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409B27A31CD100820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409127A31CD300820AF7 /* pt */, - 6436409227A31CD300820AF7 /* en */, + 6436409627A31CD000820AF7 /* pt */, + 6436409B27A31CD100820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -291,7 +291,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -373,7 +373,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -422,7 +422,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; 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 5c89397f..fd542965 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 @@ -21,7 +21,9 @@ class SignInTemplateComponentModel } if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; + return FFLocalizations.of(context).getText( + 's3j1hjqx' /* E-mail Inv */, + ); } return null; } 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 59612d43..ae8cc9df 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 @@ -4,6 +4,7 @@ import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; @@ -219,7 +220,16 @@ class _SignInTemplateComponentWidgetState .emailAddressTextController, focusNode: _model .emailAddressFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], textCapitalization: TextCapitalization.none, textInputAction: @@ -351,7 +361,16 @@ class _SignInTemplateComponentWidgetState .passwordTextController, focusNode: _model.passwordFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.password + ], textInputAction: TextInputAction.send, obscureText: !_model @@ -499,19 +518,26 @@ class _SignInTemplateComponentWidgetState .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, + onPressed: ((_model.emailAddressTextController + .text == + '') && + (_model.passwordTextController + .text == + '')) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, text: FFLocalizations.of( context) .getText( @@ -568,6 +594,12 @@ class _SignInTemplateComponentWidgetState borderRadius: BorderRadius.circular( 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), showLoadingIndicator: false, ), diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 8bdcf64e..60ae0d61 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -396,8 +396,15 @@ extension FFTextEditingControllerExt on TextEditingController? { } extension IterableExt on Iterable { - List sortedList([S Function(T)? keyOf]) => toList() - ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + List sortedList( + {S Function(T)? keyOf, bool desc = false}) { + final sortedAscending = toList() + ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + if (desc) { + return sortedAscending.reversed.toList(); + } + return sortedAscending; + } List mapIndexed(S Function(int, T) func) => toList() .asMap() diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index dc120945..b0b78958 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -241,10 +241,6 @@ final kTranslationsMap = >>[ 'pt': 'Qual o período de validade da visita?', 'en': 'Visit Validity Period', }, - 'qygj6ra5': { - 'pt': 'Inicio da Visita', - 'en': 'Start of Visit', - }, 'bv2edxku': { 'pt': '', 'en': 'End of Visit', @@ -253,10 +249,6 @@ final kTranslationsMap = >>[ 'pt': 'Quando você inicia a visita?', 'en': 'When do you start the visit?', }, - 'p4ws3t66': { - 'pt': 'Fim da Visita', - 'en': 'End of Visit', - }, 'yw6d2jj8': { 'pt': '', 'en': 'End of Visit', @@ -269,10 +261,6 @@ final kTranslationsMap = >>[ 'pt': 'Quais são os motivos da visita?', 'en': 'What are the reasons for the visit?', }, - '2f68zi9t': { - 'pt': 'Motivo da Visita', - 'en': 'End of Visit', - }, '6p3e0bzr': { 'pt': 'Escolha um motivo aqui', 'en': 'Choose a reason here', @@ -281,10 +269,6 @@ final kTranslationsMap = >>[ 'pt': 'Search for an item...', 'en': '', }, - 'il4di4ln': { - 'pt': 'Nível de Acesso', - 'en': 'End of Visit', - }, '2wun8p6c': { 'pt': 'Escolha um nível de acesso aqui', 'en': 'Choose an access level here', @@ -496,7 +480,7 @@ final kTranslationsMap = >>[ 'pt': 'Preferencias', 'en': '', }, - 'uv1iug83': { + 'sejj3t8w': { 'pt': '', 'en': '', }, @@ -507,7 +491,7 @@ final kTranslationsMap = >>[ 'pt': 'Preferencias', 'en': '', }, - '8fgc7z33': { + 'sejj3t8w': { 'pt': '', 'en': '', }, @@ -892,6 +876,10 @@ final kTranslationsMap = >>[ 'pt': 'Campo é necessário', 'en': 'Field is required', }, + 's3j1hjqx': { + 'pt': 'E-mail Inv', + 'en': '', + }, '2ib9bf67': { 'pt': 'Please choose an option from the dropdown', 'en': '', @@ -926,7 +914,7 @@ final kTranslationsMap = >>[ }, 'p5c6d54y': { 'pt': ' Recupere aqui', - 'en': 'recover here', + 'en': ' recover here', }, 'olf967cj': { 'pt': 'Termo de Uso', diff --git a/lib/main.dart b/lib/main.dart index c8c93049..85cc7135 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -182,7 +182,7 @@ class _NavBarPageState extends State { size: 24.0, ), label: FFLocalizations.of(context).getText( - '8fgc7z33' /* */, + 'sejj3t8w' /* */, ), tooltip: '', ) 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 5c8824c1..8643f7c6 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 @@ -650,45 +650,6 @@ class _ScheduleCompleteVisitPageWidgetState Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'qygj6ra5' /* Inicio da Visita */, - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -1044,45 +1005,6 @@ class _ScheduleCompleteVisitPageWidgetState Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'p4ws3t66' /* Fim da Visita */, - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -1477,45 +1399,6 @@ class _ScheduleCompleteVisitPageWidgetState Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - '2f68zi9t' /* Motivo da Visita */, - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional @@ -1651,45 +1534,6 @@ class _ScheduleCompleteVisitPageWidgetState Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'il4di4ln' /* Nível de Acesso */, - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional From dcc29abc21b98795164031dc374a4ca1e7e6fadd Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 26 Jul 2024 09:50:35 -0300 Subject: [PATCH 03/34] fix --- assets/images/dark/login.svg | 29 + assets/images/dark/login.svg:Zone.Identifier | 3 + assets/images/dark/welcome.svg | 30 + .../images/dark/welcome.svg:Zone.Identifier | 3 + assets/images/light/login.svg | 22 + assets/images/light/login.svg:Zone.Identifier | 3 + assets/images/light/welcome.svg | 30 + .../images/light/welcome.svg:Zone.Identifier | 3 + lib/actions/actions.dart | 213 +++- lib/app_state.dart | 6 +- lib/backend/api_requests/api_calls.dart | 3 +- lib/backend/api_requests/api_manager.dart | 5 +- .../api_requests/get_streamed_response.dart | 2 +- .../pushNotificationService.dart | 191 +-- lib/backend/schema/enums/enums.dart | 13 +- lib/backend/schema/structs/device_struct.dart | 7 +- lib/backend/schema/util/schema_util.dart | 8 +- .../menu_button_item_widget.dart | 145 +++ .../atom_image_svg_theme.dart | 199 ++++ .../text_field_component_model.dart | 3 +- .../text_field_component_widget.dart | 5 +- .../menu_item/menu_item.dart | 12 + .../message_opt_modal/opt_modal_model.dart | 3 +- .../message_opt_modal/opt_modal_widget.dart | 16 +- .../opt_modal/opt_modal_model.dart | 4 +- .../opt_modal/opt_modal_widget.dart | 14 +- .../option_selection_modal_model.dart | 8 +- .../option_selection_modal_widget.dart | 14 +- .../throw_exception_model.dart | 4 +- .../throw_exception_widget.dart | 4 +- .../visitor_not_found_component_model.dart | 9 +- .../visitor_not_found_component_widget.dart | 19 +- .../arrow_linked_locals_component_model.dart | 9 +- .../arrow_linked_locals_component_widget.dart | 8 +- ...m_arrow_linked_locals_component_model.dart | 9 +- ..._arrow_linked_locals_component_widget.dart | 21 +- .../local_profile_component_model.dart | 4 +- .../local_profile_component_widget.dart | 6 +- .../menu_component/menu_component_model.dart | 35 +- .../menu_component/menu_component_widget.dart | 159 ++- .../menu_list_view_component_model.dart | 4 +- .../menu_list_view_component_widget.dart | 1056 ++--------------- .../menu_staggered_view_component_model.dart | 8 +- .../menu_staggered_view_component_widget.dart | 15 +- .../message_well_component_model.dart | 12 +- .../message_well_component_widget.dart | 13 +- .../schedule_visit_detail_model.dart | 10 +- .../schedule_visit_detail_widget.dart | 36 +- ...p_arrow_linked_locals_component_model.dart | 9 +- ..._arrow_linked_locals_component_widget.dart | 16 +- ...cation_modal_template_component_model.dart | 1 + ...ation_modal_template_component_widget.dart | 5 +- .../card_item_template_component_model.dart | 3 +- .../card_item_template_component_widget.dart | 75 +- .../change_pass_model.dart | 14 +- .../change_pass_widget.dart | 222 ++-- ...got_password_template_component_model.dart | 4 +- ...ot_password_template_component_widget.dart | 7 +- ...item_details_template_component_model.dart | 13 +- ...tem_details_template_component_widget.dart | 12 +- .../message_notification_model.dart | 12 +- .../message_notification_widget.dart | 13 +- ...ode_pass_key_template_component_model.dart | 9 +- ...de_pass_key_template_component_widget.dart | 28 +- ...siter_vistor_template_component_model.dart | 14 +- ...iter_vistor_template_component_widget.dart | 34 +- ...etails_modal_template_component_model.dart | 14 +- ...tails_modal_template_component_widget.dart | 14 +- ...isit_request_template_component_model.dart | 9 +- ...sit_request_template_component_widget.dart | 12 +- ...search_modal_template_component_model.dart | 11 +- ...earch_modal_template_component_widget.dart | 24 +- .../view_visit_detail_widget.dart | 3 + .../actions/convert_image_file_to_base64.dart | 19 +- .../actions/convert_to_upload_file.dart | 3 +- lib/custom_code/actions/get_dev_u_u_i_d.dart | 5 +- lib/custom_code/widgets/image_cropper.dart | 338 +++--- lib/custom_code/widgets/menu.dart | 61 + lib/flutter_flow/custom_functions.dart | 3 +- lib/flutter_flow/custom_icons.dart | 2 +- lib/flutter_flow/flutter_flow_animations.dart | 3 +- .../flutter_flow_button_tabbar.dart | 4 +- .../flutter_flow_checkbox_group.dart | 5 +- lib/flutter_flow/flutter_flow_drop_down.dart | 4 +- .../flutter_flow_icon_button.dart | 4 +- lib/flutter_flow/flutter_flow_model.dart | 3 +- lib/flutter_flow/flutter_flow_theme.dart | 6 +- lib/flutter_flow/flutter_flow_util.dart | 5 +- lib/flutter_flow/flutter_flow_widgets.dart | 3 +- lib/flutter_flow/form_field_controller.dart | 3 +- lib/flutter_flow/internationalization.dart | 4 +- lib/flutter_flow/keep_alive_wrapper.dart | 2 +- lib/flutter_flow/lat_lng.dart | 2 +- lib/flutter_flow/nav/nav.dart | 11 +- lib/flutter_flow/nav/serialization_util.dart | 3 +- lib/flutter_flow/permissions_util.dart | 2 +- lib/flutter_flow/place.dart | 2 +- lib/flutter_flow/random_data_util.dart | 2 +- lib/flutter_flow/request_manager.dart | 2 +- lib/flutter_flow/upload_data.dart | 2 +- lib/flutter_flow/uploaded_file.dart | 2 +- lib/main.dart | 14 +- .../acess_history_page_model.dart | 15 +- .../acess_history_page_widget.dart | 64 +- .../fast_pass_page/fast_pass_page_widget.dart | 5 +- lib/pages/home_page/home_page_model.dart | 15 +- lib/pages/home_page/home_page_widget.dart | 627 +--------- .../liberation_history_model.dart | 11 +- .../liberation_history_widget.dart | 33 +- .../message_history_page_model.dart | 17 +- .../message_history_page_widget.dart | 332 +++--- .../people_on_the_property_page_model.dart | 8 +- .../people_on_the_property_page_widget.dart | 252 ++-- .../preferences_settings_model.dart | 17 +- .../preferences_settings_widget.dart | 103 +- .../qr_code_page/qr_code_page_model.dart | 6 +- .../qr_code_page/qr_code_page_widget.dart | 120 +- .../register_visitor_page_model.dart | 2 +- .../register_visitor_page_widget.dart | 5 +- .../schedule_complete_visit_page_model.dart | 13 +- .../schedule_complete_visit_page_widget.dart | 205 +--- ...schedule_provisional_visit_page_model.dart | 11 +- ...chedule_provisional_visit_page_widget.dart | 26 +- .../sign_in_page/sign_in_page_model.dart | 2 +- .../sign_in_page/sign_in_page_widget.dart | 2 +- .../sign_up_page/sign_up_page_model.dart | 2 +- .../sign_up_page/sign_up_page_widget.dart | 2 +- lib/pages/test_page/test_page.dart | 112 +- .../visit_history_page_model.dart | 15 +- .../visit_history_page_widget.dart | 52 +- .../welcome_page/welcome_page_model.dart | 2 +- .../welcome_page/welcome_page_widget.dart | 2 +- pubspec.yaml | 6 +- test/widget_test.dart | 28 +- 134 files changed, 2596 insertions(+), 3048 deletions(-) create mode 100644 assets/images/dark/login.svg create mode 100644 assets/images/dark/login.svg:Zone.Identifier create mode 100644 assets/images/dark/welcome.svg create mode 100644 assets/images/dark/welcome.svg:Zone.Identifier create mode 100644 assets/images/light/login.svg create mode 100644 assets/images/light/login.svg:Zone.Identifier create mode 100644 assets/images/light/welcome.svg create mode 100644 assets/images/light/welcome.svg:Zone.Identifier create mode 100644 lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart create mode 100644 lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart create mode 100644 lib/components/molecular_components/menu_item/menu_item.dart create mode 100644 lib/custom_code/widgets/menu.dart diff --git a/assets/images/dark/login.svg b/assets/images/dark/login.svg new file mode 100644 index 00000000..6da3ef72 --- /dev/null +++ b/assets/images/dark/login.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dark/login.svg:Zone.Identifier b/assets/images/dark/login.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/dark/login.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/dark/welcome.svg b/assets/images/dark/welcome.svg new file mode 100644 index 00000000..c9043f96 --- /dev/null +++ b/assets/images/dark/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dark/welcome.svg:Zone.Identifier b/assets/images/dark/welcome.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/dark/welcome.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/light/login.svg b/assets/images/light/login.svg new file mode 100644 index 00000000..f6890b23 --- /dev/null +++ b/assets/images/light/login.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/login.svg:Zone.Identifier b/assets/images/light/login.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/light/login.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/light/welcome.svg b/assets/images/light/welcome.svg new file mode 100644 index 00000000..8983fac0 --- /dev/null +++ b/assets/images/light/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/welcome.svg:Zone.Identifier b/assets/images/light/welcome.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/light/welcome.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index d25a5939..5d80d184 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,20 +1,33 @@ -import 'dart:convert'; - -import 'package:f_r_e_hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import 'package:f_r_e_hub/custom_code/actions/get_dev_u_u_i_d.dart'; -import 'package:f_r_e_hub/pages/home_page/home_page_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:qr_flutter/qr_flutter.dart'; -import 'package:sqflite/utils/utils.dart'; import 'dart:developer'; -import '/actions/actions.dart' as action_blocks; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/custom_code/actions/index.dart' as actions; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/random_data_util.dart' as random_data; +// 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'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/custom_code/actions/get_dev_u_u_i_d.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/random_data_util.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + + + + +import 'package:url_launcher/url_launcher.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} Future repeatVisitScheduleAction( BuildContext context, { @@ -107,14 +120,14 @@ Future singInLoginAction( }), ]); if ((FFAppState().email != '') && (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); + devUUID = await getDevUUID(); FFAppState().devUUID = devUUID!; loginCall = await PhpGroup.loginCall.call( email: FFAppState().email, password: FFAppState().passwd, uuid: FFAppState().devUUID, type: FFAppState().device, - description: random_data.randomString( + description: randomString( 10, 10, true, @@ -148,7 +161,7 @@ Future singInLoginAction( )!; FFAppState().serialNumber = await getSerialNumber() ?? ''; FFAppState().isLogged = true; - await action_blocks.toggleHomePage(context); + await toggleHomePage(context); return; } else { await showModalBottomSheet( @@ -199,14 +212,14 @@ Future signUpRegisterAction( name: name, password: passwd, email: email, - token: random_data.randomString( + token: randomString( 36, 36, false, false, true, ), - uuid: random_data.randomString( + uuid: randomString( 36, 36, false, @@ -214,7 +227,7 @@ Future signUpRegisterAction( true, ), tipo: device, - descricao: random_data.randomString( + descricao: randomString( 36, 36, true, @@ -234,8 +247,8 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR2'), - content: const Text('ERROR2'), + title: const Text('Error'), + content: Text('${registerCall?.jsonBody}'), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), @@ -251,12 +264,21 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR1'), - content: const Text('ERROR1'), + title: Text(FFLocalizations.of(context).getVariableText( + enText: 'Error', + ptText: 'Erro', + )), + content: Text(FFLocalizations.of(context).getVariableText( + enText: 'Please fill in all fields', + ptText: 'Por favor, preencha todos os campos', + )), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR1 '), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: 'Fechar', + enText: 'Close', + )), ), ], ); @@ -311,6 +333,7 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( 'signUpPage', extra: { @@ -651,4 +674,140 @@ Widget buildQrCode( // String escapeMECARD(String content) { // // Implementação para escapar caracteres. // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } \ No newline at end of file + // } + + /// menu + + Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], + ), + ); + }, + ); + } + + Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); + } + + Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], + ), + ); + }, + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } \ No newline at end of file diff --git a/lib/app_state.dart b/lib/app_state.dart index 0faaaeca..917fb812 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,11 +1,9 @@ -import 'dart:ffi'; +// import 'dart:ffi'; -import 'package:f_r_e_hub/flutter_flow/permissions_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:csv/csv.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:synchronized/synchronized.dart'; class FFAppState extends ChangeNotifier { @@ -488,4 +486,4 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage { Future setStringList(String key, List value) async => await writeSync( key: key, value: const ListToCsvConverter().convert([value])); -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 15850cd4..2a8838ec 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -11,6 +11,7 @@ export 'api_manager.dart' show ApiCallResponse; const _kPrivateApiFunctionName = 'ffPrivateApiCall'; + /// Start PHP Group Code class PhpGroup { @@ -2432,4 +2433,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { } return isList ? '[]' : '{}'; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 1bb57424..53340d4f 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -15,6 +15,9 @@ import '/flutter_flow/uploaded_file.dart'; import 'get_streamed_response.dart'; + + + enum ApiCallType { GET, POST, @@ -512,4 +515,4 @@ class ApiManager { return result; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/get_streamed_response.dart b/lib/backend/api_requests/get_streamed_response.dart index 1a53aab0..303a19e5 100644 --- a/lib/backend/api_requests/get_streamed_response.dart +++ b/lib/backend/api_requests/get_streamed_response.dart @@ -1,4 +1,4 @@ import 'package:http/http.dart'; Future getStreamedResponse(Request request) => - Client().send(request); + Client().send(request); \ No newline at end of file diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 8ec899a1..883a9338 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -4,20 +4,24 @@ import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/app_state.dart'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + + import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:rxdart/rxdart.dart'; +// + + class PushNotificationService { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = @@ -108,17 +112,17 @@ class PushNotificationService { await Future.delayed(Duration(milliseconds: 100)); } - const initializationSettingsAndroid = AndroidInitializationSettings('mipmap/ic_fre_black'); - const initializationSettingsIOS = DarwinInitializationSettings( + var initializationSettingsAndroid = + AndroidInitializationSettings('mipmap/ic_fre_black'); + var initializationSettingsIOS = DarwinInitializationSettings( requestAlertPermission: true, requestBadgePermission: true, requestSoundPermission: true, ); - const initializationSettings = InitializationSettings( + var initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsIOS, ); - _flutterLocalNotificationsPlugin.initialize( initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse response) async { @@ -130,7 +134,7 @@ class PushNotificationService { log('Notification payload: $message'); var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage log('Extra: ${data.value}'); - _handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'}); + _handleNotificationClick(message, extra: data.value); } catch (e) { log('Error decoding notification payload: $e'); } @@ -187,17 +191,7 @@ class PushNotificationService { _onMessage.add(message); log('Extra: ${message.notification?.body}'); - Map extra = {}; - log('Message: ${message.data}'); - - if (message.data['click_action'] == 'mensagem') { - extra['body'] = message.notification?.body; - } - - log('New Extra: $extra'); - - NotificationHandler().handleMessage(message.data, context, extra: extra); - }); + NotificationHandler().handleMessage(message.data, context); }); } void configureTokenRefresh() { @@ -273,11 +267,8 @@ class PushNotificationService { } void _showNotification(RemoteMessage message) async { - Map messageParsed = message.toMap(); - Map data = messageParsed['data']; - Map notification = messageParsed['notification']; - - String channelId = _getChannelIdBasedOnClickAction(data['click_action']); + String channelId = + _getChannelIdBasedOnClickAction(message.data['click_action']); var androidDetails = AndroidNotificationDetails( channelId, @@ -286,33 +277,19 @@ class PushNotificationService { importance: Importance.max, priority: Priority.high, ); - var iOSDetails = const DarwinNotificationDetails( - categoryIdentifier: 'plainCategory', - sound: 'slow_spring_board.aiff', - presentList: true, - interruptionLevel: InterruptionLevel.critical, - ); - - var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails); + var iOSDetails = DarwinNotificationDetails(); + var generalNotificationDetails = + NotificationDetails(android: androidDetails, iOS: iOSDetails); log('Showing notification: ${message.messageId.hashCode}'); - log('Message Title: ${notification['title'].toString()}'); - log('Message Body: ${notification['body'].toString()}'); - log('Message Payload: ${data.toString()}'); - await _flutterLocalNotificationsPlugin.show( - DateTime.now().microsecond, - notification['title'].toString(), - notification['body'].toString(), + // DateTime.now().millisecondsSinceEpoch % (1 << 31), + math.Random().nextInt(1 << 30), + message.notification?.title, + message.notification?.body, generalNotificationDetails, - payload: data.toString(), - ).catchError((err, stack) { - log('Error: $err'); - log('Stack: $stack'); - }); - - - + payload: message.data.toString(), + ); } _handleNotificationClick(Map payload, {Map extra = const {}}) { @@ -347,15 +324,15 @@ class NotificationHandler { switch (message['click_action']) { case 'visit_request': _showVisitRequestDialog(message, context); + break; - case 'cancel_request': - _showVisitRequestResolvedDialog(message, context); + case '': break; case 'access': _showAcessNotificationModal(message, context); break; case 'mensagem': - _showMessageNotificationDialog(message, context, extra); + _showMessageNotificationDialog(message, context, extra); break; case 'enroll_cond': log('enroll_cond'); @@ -382,35 +359,28 @@ class NotificationHandler { void _showAcessNotificationModal( Map message, BuildContext context) { log('Showing access notification dialog'); - log('Message: ${message}'); log('USR_TIPO: ${message['USR_TIPO']}'); log('USR_ID: ${message['USR_ID']}'); log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}'); showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); - - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: AccessNotificationModalTemplateComponentWidget( - datetime: message['ACE_DATAHORA'].toString(), - drive: message['SET_DESCRICAO'].toString(), - id: message['USR_TIPO'].toString() == 'O' - ? message['USR_ID'].toString() == '' - ? '0' - : message['USR_ID'].toString() - : message['USR_DOCUMENTO'].toString() == '' - ? '0' - : message['USR_DOCUMENTO'].toString(), - name: message['PES_NOME'].toString(), - type: message['USR_TIPO'], - )), - ); + _getIdBasedOnUserType(message); + return Dialog( + backgroundColor: Colors.transparent, + child: AccessNotificationModalTemplateComponentWidget( + datetime: message['ACE_DATAHORA'].toString(), + drive: message['ACI_DESCRICAO'].toString(), + id: message['USR_TIPO'].toString() == 'O' + ? message['USR_ID'].toString() == '' + ? '0' + : message['USR_ID'].toString() + : message['USR_DOCUMENTO'].toString() == '' + ? '0' + : message['USR_DOCUMENTO'].toString(), + name: message['PES_NOME'].toString(), + type: message['USR_TIPO'], + )); }, ); } @@ -419,31 +389,17 @@ class NotificationHandler { Map message, BuildContext context, Map extra) { log('Showing message notification dialog'); log('Notification "message": $message'); - log('Extra: $extra'); - Map local = {}; - - try { - local = jsonDecode(message['local']); - } catch (err) { - local = message['local']; - } - showDialog( useSafeArea: true, context: context, builder: (BuildContext context) { - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: MessageNotificationModalTemplateComponentWidget( - id: local['CLI_ID'].toString(), - from: message['remetente'].toString(), - to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', - message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), - ), + return Dialog( + backgroundColor: Colors.transparent, + child: MessageNotificationModalTemplateComponentWidget( + id: message['local']['CLI_ID'].toString(), + from: message['remetente'].toString(), + to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', + message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(), ), ); }, @@ -457,7 +413,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: VisitRequestTemplateComponentWidget( @@ -465,8 +421,8 @@ class NotificationHandler { vteReason: message['motivo'] ?? 'Unknown', vteMsg: message['mensagem'] ?? 'Unknown', vteDocument: message['documento'] ?? '', - vteUUID: message['idVisitante'].toString() ?? '0', - vawRef: message['referencia'].toString() ?? '0', + vteUUID: message['idVisitante'].toString(), + vawRef: message['referencia'].toString(), vawStatus: 'S', changeStatusAction: changeStatusAction, ), @@ -474,35 +430,6 @@ class NotificationHandler { }, ); } - - void _showVisitRequestResolvedDialog( - Map message, BuildContext context) { - log('Showing visit request notification dialog'); - - showDialog( - context: context, - builder: (BuildContext context) { - - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Dialog( - backgroundColor: Colors.transparent, - child: VisitRequestTemplateComponentWidget( - vteName: message['nomevisita'].toString(), - vteReason: message['motivo'].toString(), - vteMsg: message['resposta'].toString(), - vteDocument: message['documento'].toString(), - vteUUID: message['codvisita'].toString(), - vawRef: message['referencia'].toString(), - vawStatus: message['status'].toString(), - ), - ), - ); - }, - ); - } } class PushNotificationManager { @@ -523,4 +450,4 @@ class PushNotificationManager { } -} +} \ No newline at end of file diff --git a/lib/backend/schema/enums/enums.dart b/lib/backend/schema/enums/enums.dart index cfef83fe..64351084 100644 --- a/lib/backend/schema/enums/enums.dart +++ b/lib/backend/schema/enums/enums.dart @@ -5,6 +5,17 @@ enum AppHeaderComponent { home, } +enum MenuView { + list_grid, + list, + grid, +} + +enum MenuItem { + button, + card +} + extension FFEnumExtensions on T { String serialize() => name; } @@ -21,4 +32,4 @@ T? deserializeEnum(String? value) { default: return null; } -} +} \ No newline at end of file diff --git a/lib/backend/schema/structs/device_struct.dart b/lib/backend/schema/structs/device_struct.dart index bf1d6bf9..174afa98 100644 --- a/lib/backend/schema/structs/device_struct.dart +++ b/lib/backend/schema/structs/device_struct.dart @@ -1,9 +1,10 @@ // ignore_for_file: unnecessary_getters_setters -import '/backend/schema/util/schema_util.dart'; + +import 'package:hub/flutter_flow/nav/nav.dart'; import 'index.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + class DeviceStruct extends BaseStruct { DeviceStruct({ @@ -110,4 +111,4 @@ DeviceStruct createDeviceStruct({ devUUID: devUUID, version: version, description: description, - ); + ); \ No newline at end of file diff --git a/lib/backend/schema/util/schema_util.dart b/lib/backend/schema/util/schema_util.dart index f1ad8a3f..80a9f7a4 100644 --- a/lib/backend/schema/util/schema_util.dart +++ b/lib/backend/schema/util/schema_util.dart @@ -2,9 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:from_css_color/from_css_color.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + -import '/backend/schema/enums/enums.dart'; -import '/flutter_flow/flutter_flow_util.dart'; export 'package:collection/collection.dart' show ListEquality; export 'package:flutter/material.dart' show Color, Colors; @@ -77,4 +79,4 @@ List? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls; List? getDataList(dynamic value) => - value is! List ? null : value.map((e) => castToType(e)!).toList(); + value is! List ? null : value.map((e) => castToType(e)!).toList(); \ No newline at end of file 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 new file mode 100644 index 00000000..b0ee89d4 --- /dev/null +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + + + +class MenuButtonWidget extends MenuEntry { + const MenuButtonWidget({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); +} + +class _MenuButtonWidgetState extends State { + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + widget.icon, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Text( + widget.title ?? '', + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart new file mode 100644 index 00000000..f2173bfd --- /dev/null +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -0,0 +1,199 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; +import 'package:provider/provider.dart'; + + +class PreferencesPageWidget extends StatelessWidget { + const PreferencesPageWidget({super.key}); + + @override + Widget build(BuildContext context) { + return ChangeNotifierProvider( + create: (_) => PreferencesPageModel(), + child: Consumer( + builder: (context, model, child) => GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Preferences', + ptText: 'Preferências', + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Container(), + Expanded( + flex: 2, + child: ListView.builder( + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 3, + // crossAxisSpacing: 12.0, + // mainAxisSpacing: 12.0, + // childAspectRatio: 1.0, + // mainAxisExtent: 100.0, + // ), + itemCount: 6, // Assuming 4 items for simplicity + padding: const EdgeInsets.symmetric(horizontal: 20.0), + physics: const AlwaysScrollableScrollPhysics(), + itemBuilder: (BuildContext context, int index) { + return _buildIconButton(context, index, model); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + IconData icon; + Function() onPressed =() => {}; + bool isEnabled; + String content; + + switch (index) { + case 0: + icon = Icons.fingerprint; + onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + isEnabled = FFAppState().fingerprint; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative a autenticação por impressão digital para login seguro.', + enText: 'Enable fingerprint authentication for secure login.', + ); + break; + case 1: + icon = Icons.person; + onPressed = () => model.enablePerson(context); + isEnabled = FFAppState().person; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Exibir código de identificação remota', + enText: 'Display remote identification code', + ); + break; + case 2: + icon = Icons.notifications; + onPressed = model.toggleNotify; + isEnabled = FFAppState().notify; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para receber sua notificação de acesso', + enText: 'Enable to receive your access notification', + ); + break; + case 3: + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().pass; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de acesso para o QRCode', + enText: 'Enable to enter an access credential for the QRCode', + ); + break; + case 4: + icon = Icons.landscape; + onPressed = model.localLogout; + isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 5: + icon = Icons.delete; + onPressed = () => model.deleteAccount(context); + isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Delete sua conta e todos os dados associados permanentemente.', + enText: 'Delete your account and all associated data permanently.', + ); + break; + default: + throw Exception('Invalid index: $index'); + } + + return Container( + height: 100, + child: GestureDetector( + onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + child: Row( + children: [ + CircleAvatar( + backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + child: Icon( + icon, + color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), + // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + // disabledColor: FlutterFlowTheme.of(context).alternate, + // disabledIconColor: FlutterFlowTheme.of(context).primary, + ), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + content, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + overflow: TextOverflow.clip, + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart index 30f54431..a74572ce 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_model.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_model.dart @@ -2,6 +2,7 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'text_field_component_widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; + class TextFieldComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,4 +20,4 @@ class TextFieldComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart index e9ab116f..90a63614 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart @@ -5,6 +5,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'text_field_component_model.dart'; export 'text_field_component_model.dart'; +//// + + class TextFieldComponentWidget extends StatefulWidget { const TextFieldComponentWidget({ super.key, @@ -114,4 +117,4 @@ class _TextFieldComponentWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart new file mode 100644 index 00000000..1d2926b5 --- /dev/null +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -0,0 +1,12 @@ + + +import 'package:flutter/material.dart'; + +abstract class MenuEntry extends StatefulWidget { + const MenuEntry({ + Key? key, + }) : super(key: key); + + + +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart index 51674c2a..0963fec9 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart @@ -3,6 +3,7 @@ import '/flutter_flow/form_field_controller.dart'; import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +29,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ 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 551004ef..6b2df897 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 @@ -1,8 +1,12 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -61,9 +65,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -327,4 +331,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart index 51674c2a..66133fb1 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_model.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_model.dart @@ -3,6 +3,8 @@ import '/flutter_flow/form_field_controller.dart'; import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +30,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart index 551004ef..b2394f52 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,8 +1,10 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -61,9 +63,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -327,4 +329,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart index d9448232..38613124 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart @@ -1,5 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_widget.dart' show OptionSelectionModalWidget; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class OptionSelectionModalModel @@ -9,4 +11,4 @@ class OptionSelectionModalModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index ef4993fe..83093a34 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -1,14 +1,14 @@ -// import 'package:f_r_e_hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +// import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; +import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_model.dart'; -export 'option_selection_modal_model.dart'; class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ @@ -217,4 +217,4 @@ class _OptionSelectionModalWidgetState extends State ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart b/lib/components/molecular_components/throw_exception/throw_exception_model.dart index 31b6cee7..69ec5ec4 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_model.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_model.dart @@ -2,10 +2,12 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'throw_exception_widget.dart' show ThrowExceptionWidget; import 'package:flutter/material.dart'; + + class ThrowExceptionModel extends FlutterFlowModel { @override void initState(BuildContext context) {} @override void dispose() {} -} +} \ No newline at end of file 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 a4c60fa7..95333ddd 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -7,6 +7,8 @@ import 'package:google_fonts/google_fonts.dart'; import 'throw_exception_model.dart'; export 'throw_exception_model.dart'; +/// + class ThrowExceptionWidget extends StatefulWidget { const ThrowExceptionWidget({ super.key, @@ -160,4 +162,4 @@ class _ThrowExceptionWidgetState extends State ], ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart index f89f479d..6827c26d 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_not_found_component_widget.dart' - show VisitorNotFoundComponentWidget; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorNotFoundComponentModel @@ -10,4 +11,4 @@ class VisitorNotFoundComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 115a6304..421d595f 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,12 +1,15 @@ -import '/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'visitor_not_found_component_model.dart'; -export 'visitor_not_found_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; + class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({super.key}); @@ -174,4 +177,4 @@ class _VisitorNotFoundComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart index a63f3b06..ebbcaea4 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'arrow_linked_locals_component_widget.dart' - show ArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart'; + +import '../../../flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class ArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class ArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart index 0738f46c..d0a00a4f 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'arrow_linked_locals_component_model.dart'; -export 'arrow_linked_locals_component_model.dart'; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + class ArrowLinkedLocalsComponentWidget extends StatefulWidget { const ArrowLinkedLocalsComponentWidget({super.key}); @@ -38,4 +38,4 @@ class _ArrowLinkedLocalsComponentWidgetState Widget build(BuildContext context) { return Container(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart index f0b590e3..3ff8aba1 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'bottom_arrow_linked_locals_component_widget.dart' - show BottomArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class BottomArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class BottomArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file 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 40c14a58..267634c5 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 @@ -1,14 +1,19 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'bottom_arrow_linked_locals_component_model.dart'; -export 'bottom_arrow_linked_locals_component_model.dart'; + class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); @@ -194,10 +199,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState topRight: Radius.circular(25.0), ), child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( + "https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( localItem, r'''$.CLI_ID''', - ).toString()}.png', + ).toString()}.png", width: double.infinity, height: double.infinity, fit: BoxFit.fill, @@ -253,4 +258,4 @@ class _BottomArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart index 25442482..12c50d2f 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart @@ -2,6 +2,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; import 'package:flutter/material.dart'; +/// + class LocalProfileComponentModel extends FlutterFlowModel { @override @@ -9,4 +11,4 @@ class LocalProfileComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index d8b1aff4..ab338b78 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,16 +1,16 @@ -import 'package:f_r_e_hub/actions/actions.dart'; import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/random_data_util.dart' as random_data; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'local_profile_component_model.dart'; export 'local_profile_component_model.dart'; +//// + class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({ required bool localStatus, @@ -148,4 +148,4 @@ class _LocalProfileComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart index b6aa80df..b2842e56 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -1,12 +1,14 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'menu_component_widget.dart' show MenuComponentWidget; + + class MenuComponentModel extends FlutterFlowModel { /// Local state fields for this component. @@ -128,13 +130,13 @@ class MenuComponentModel extends FlutterFlowModel { 'liberationHistory', 'acessHistoryPage', 'scheduleCompleteVisitPage', - // 'messageHistoryPage', + 'messageHistoryPage' ], iconsListIcon: [ Icons.history_rounded, Icons.history_rounded, Icons.history_rounded, - // Icons.history_rounded, + Icons.history_rounded, ], nameListStr: [ FFLocalizations.of(context).getVariableText( @@ -149,10 +151,10 @@ class MenuComponentModel extends FlutterFlowModel { ptText: 'Histórico\nde Visita', enText: 'Visit\nHistory', ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Mensagens', + enText: 'Message\nHistory', + ), ], ), ); @@ -172,4 +174,19 @@ class MenuComponentModel extends FlutterFlowModel { }, ); } -} + + Future messageHistoryAction(BuildContext context) async { + context.pushNamed( + 'messageHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index 20fca7e9..6803c748 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -1,3 +1,9 @@ +import 'dart:developer'; + +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -5,8 +11,19 @@ import 'package:flutter/material.dart'; import 'menu_component_model.dart'; export 'menu_component_model.dart'; + class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({super.key}); + const MenuComponentWidget({ + Key? key, + required this.style, + required this.item, + required this.expandable, + required this.options, + }); + final MenuView style; + final MenuItem item; + final bool expandable; + final List options; @override State createState() => _MenuComponentWidgetState(); @@ -36,16 +53,111 @@ class _MenuComponentWidgetState extends State { @override Widget build(BuildContext context) { + log('MenuComponentWidget: ${widget.options.toList().toString()}'); return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Builder( builder: (context) { - if (_model.isGrid == true) { + if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: widget.options, + expandable: widget.expandable, + item: widget.item, + + + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + changeMenuStyleAction: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + ), + ); + } + } + if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ return wrapWithModel( model: _model.menuListViewComponentModel, updateCallback: () => setState(() {}), updateOnChange: true, child: MenuListViewComponentWidget( + expandable: widget.expandable, + item: widget.item, + options: widget.options, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + changeMenuStyle: () async { await _model.changeMenuStyle(context); setState(() {}); @@ -74,46 +186,13 @@ class _MenuComponentWidgetState extends State { await _model.accessQRCodeOptAction(context); setState(() {}); }, - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, + + ), ); } - }, + return const SizedBox(); + }, ), ); } @@ -132,4 +211,4 @@ class _MenuComponentWidgetState extends State { } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart index 7ce9985b..027278ab 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart @@ -2,6 +2,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; import 'package:flutter/material.dart'; + + class MenuListViewComponentModel extends FlutterFlowModel { @override @@ -9,4 +11,4 @@ class MenuListViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index 06154b38..d9418237 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -9,6 +10,9 @@ import 'menu_list_view_component_model.dart'; export 'menu_list_view_component_model.dart'; +/// + + class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, @@ -19,8 +23,16 @@ class MenuListViewComponentWidget extends StatefulWidget { required this.preferencesSettings, required this.liberationHistoryOptAction, required this.accessQRCodeOptAction, + required this.expandable, + required this.item, + required this.options, + required this.messageHistoryAction, }); + final bool expandable; + final MenuItem item; + + final List options; final Future Function()? changeMenuStyle; final Future Function()? registerVisitorOptAction; final Future Function()? scheduleVisitOptAction; @@ -28,6 +40,7 @@ class MenuListViewComponentWidget extends StatefulWidget { final Future Function()? preferencesSettings; final Future Function()? liberationHistoryOptAction; final Future Function()? accessQRCodeOptAction; + final Future Function()? messageHistoryAction; @override State createState() => @@ -69,959 +82,94 @@ class _MenuListViewComponentWidgetState verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), - child: Container( - width: double.infinity, - height: 125.0, - decoration: const BoxDecoration(), - child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), - scrollDirection: Axis.horizontal, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'utgue9a5' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '82b5f8yz' /* Cadastrar -Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.khome, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 't4ie13ut' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'n3n76pha' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'l6b9o7yn' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rxnrtdau' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - ptText: 'Consultar\nConsultar', - enText: 'Consult\nHistories', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.settings, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Preferences\nSystem', - ptText: 'Preferências\ndo Sistema', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - - ].divide(const SizedBox(width: 15.0)), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - FFLocalizations.of(context).getVariableText( - enText: 'Expand', - ptText: 'Expandir', - ), - style: FlutterFlowTheme.of(context).title1.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 12.0, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.normal, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 0.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_down_outlined, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyle?.call(); - }, - ), - ), - ], - ), + buildMenuItem(context), + if (widget.expandable) + buildExpandableButton(context), ], ); } + + Widget buildMenuItem(BuildContext context) { + switch(widget.item) { + case MenuItem.button: + return SizedBox( + height: 100, + width: double.infinity, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.horizontal, + + itemCount: widget.options.length, + itemBuilder: (context, index) { + return SizedBox( + height: 115, + width: 115, + child: widget.options[index]); + }, + ), + ); + case MenuItem.card: + return ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + itemCount: widget.options.length, + itemBuilder: (context, index) { + return MenuButtonWidget( + action: widget.registerVisitorOptAction, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, + ); + }, + ); + } } + + Row buildExpandableButton(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + FFLocalizations.of(context).getVariableText( + enText: 'Expand', + ptText: 'Expandir', + ), + style: FlutterFlowTheme.of(context).title1.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 12.0, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 0.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_down_outlined, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ); + } +} + diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart index 8aebfc69..4ee29584 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart @@ -1,8 +1,10 @@ +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; + import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_widget.dart' - show MenuStaggeredViewComponentWidget; + import 'package:flutter/material.dart'; + class MenuStaggeredViewComponentModel extends FlutterFlowModel { @override @@ -10,4 +12,4 @@ class MenuStaggeredViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 8e5441a3..35a411d6 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -3,13 +3,14 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/custom_icons.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_model.dart'; - -export 'menu_staggered_view_component_model.dart'; class MenuStaggeredViewComponentWidget extends StatefulWidget { const MenuStaggeredViewComponentWidget({ @@ -1079,4 +1080,4 @@ Propriedade */ ], ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart index 89ce0d76..e6b577de 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_model.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_model.dart @@ -1,10 +1,16 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; + +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'message_well_component_widget.dart' show MessageWellComponentWidget; import 'package:flutter/material.dart'; +/// + +import 'package:flutter/material.dart'; + + class MessageWellComponentModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -43,4 +49,4 @@ class MessageWellComponentModel clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart index 1a82d88f..29432952 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,16 +2,19 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -import 'package:f_r_e_hub/app_state.dart'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; +// + + final dropdown = BehaviorSubject>.seeded( LinkedHashMap.from({ 'All': 'A', @@ -340,4 +343,4 @@ class MessageWellNotifier extends StateNotifier { final messageWellProvider = StateNotifierProvider((ref) { return MessageWellNotifier(); -}); +}); \ No newline at end of file diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index d30b8442..39705ca6 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,7 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_visit_detail_widget.dart' show ScheduleVisitDetailWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; + + import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -57,4 +59,4 @@ class ScheduleVisitDetailModel textFieldFocusNode6?.dispose(); textController6?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 9641ca52..935379ad 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -1,16 +1,20 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'schedule_visit_detail_model.dart'; -export 'schedule_visit_detail_model.dart'; + class ScheduleVisitDetailWidget extends StatefulWidget { const ScheduleVisitDetailWidget({ @@ -68,11 +72,11 @@ class _ScheduleVisitDetailWidgetState extends State { _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitResonStr!)); + text: extractDescToStr(widget.visitResonStr!)); _model.textFieldFocusNode4 ??= FocusNode(); _model.textController5 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitLevelStr!)); + text: extractDescToStr(widget.visitLevelStr!)); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -225,10 +229,10 @@ class _ScheduleVisitDetailWidgetState extends State { const Duration(milliseconds: 500), imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitorsDataItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), width: 100.0, @@ -931,8 +935,8 @@ class _ScheduleVisitDetailWidgetState extends State { dtFim: widget.visitEndDate, unica: widget.visitTempStr, idMotivo: - functions.extractIdToStr(widget.visitResonStr!), - idNAC: functions.extractIdToStr(widget.visitLevelStr!), + extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), obs: widget.visitObsStr, cliID: FFAppState().cliUUID, ); @@ -977,4 +981,4 @@ class _ScheduleVisitDetailWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart index e4db1d96..54f840ca 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'up_arrow_linked_locals_component_widget.dart' - show UpArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class UpArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class UpArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index fea22bdb..968b22f9 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -1,12 +1,16 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'up_arrow_linked_locals_component_model.dart'; -export 'up_arrow_linked_locals_component_model.dart'; + class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); @@ -240,4 +244,4 @@ class _UpArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart index b0f33c80..f9ee4e21 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart @@ -4,6 +4,7 @@ import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; + class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart index 789b1b44..a8d77589 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -7,6 +7,9 @@ import 'package:provider/provider.dart'; import 'access_notification_modal_template_component_model.dart'; export 'access_notification_modal_template_component_model.dart'; + + + class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { const AccessNotificationModalTemplateComponentWidget({ super.key, @@ -380,4 +383,4 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart index 3f35acf9..032a1f68 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart @@ -3,6 +3,7 @@ import 'card_item_template_component_widget.dart' show CardItemTemplateComponentWidget; import 'package:flutter/material.dart'; + class CardItemTemplateComponentModel extends FlutterFlowModel { @override @@ -10,4 +11,4 @@ class CardItemTemplateComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 41c28eee..a1e4cfc6 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -10,6 +10,10 @@ import 'package:provider/provider.dart'; import 'card_item_template_component_model.dart'; export 'card_item_template_component_model.dart'; +/// + + + class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ super.key, @@ -20,8 +24,8 @@ class CardItemTemplateComponentWidget extends StatefulWidget { }); final Map? labelsHashMap; - final Map? statusHashMap; - final Map imageHashMap; //document/vteID and type + final List?> statusHashMap; + final Map imageHashMap; final Future Function()? onTapCardItemAction; @override @@ -35,8 +39,8 @@ class _CardItemTemplateComponentWidgetState LinkedHashMap get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap ?? {}); - LinkedHashMap get statusLinkedHashMap => - LinkedHashMap.from(widget.statusHashMap ?? {}); + List> get statusLinkedHashMap => + widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); @override void setState(VoidCallback callback) { @@ -70,7 +74,8 @@ class _CardItemTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - log('imageHashMap: ${widget.imageHashMap}'); + + return InkWell( splashColor: Colors.transparent, @@ -178,36 +183,40 @@ class _CardItemTemplateComponentWidgetState }, ), ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.symmetric(vertical: 3.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: statusLinkedHashMap.values.first, - borderRadius: BorderRadius.circular(5.0), - ), - child: Align( - alignment: Alignment.center, - child: Text( - statusLinkedHashMap.keys - .first, // Acessa diretamente a chave como texto do status - style: TextStyle( - // Substitua por seu tema ou estilo de texto - color: FlutterFlowTheme.of(context) - .info, // Cor do texto, ajuste conforme necessário + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries.map((MapEntry item) { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), + child: Container( + width: 100.0, + height: 27.0, + decoration: BoxDecoration( + color: item.value, // Usa a cor do item atual + borderRadius: BorderRadius.circular(5.0), + ), + child: Align( + alignment: Alignment.center, + child: Text( + item.key, // Usa a chave do item atual como texto + style: TextStyle( + color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário + ), + ), + ), ), ), - ), + ], ), - ), - ], - ), + ); + }).toList(); + }).toList(), ), ]), ), @@ -236,4 +245,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart index c2febab7..25cc4529 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart @@ -3,6 +3,7 @@ import 'change_pass_widget.dart' show PassKeyTemplateWidget; import 'package:flutter/material.dart'; + class PassKeyTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,11 +20,16 @@ class PassKeyTemplateComponentModel String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2; String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + if (val == null || val.isEmpty ) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } + if ( val.length < 4 ) return FFLocalizations.of(context).getVariableText( + enText: 'This field must have at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } @@ -42,4 +48,4 @@ class PassKeyTemplateComponentModel keyTextFieldTextController1?.dispose(); keyTextFieldTextController2?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart index 5c19dfb3..02ae2c83 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; @@ -8,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'change_pass_model.dart'; export 'change_pass_model.dart'; + class PassKeyTemplateWidget extends StatefulWidget { const PassKeyTemplateWidget({ super.key, @@ -126,7 +129,7 @@ class _PassKeyTemplateWidgetState child: Text( FFLocalizations.of(context).getVariableText( enText: 'INSERT PASSWORD', - ptText: 'ADICIONAR SENHA', + ptText: FFAppState().accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', @@ -158,7 +161,7 @@ class _PassKeyTemplateWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ Padding( @@ -166,101 +169,28 @@ class _PassKeyTemplateWidgetState child: SizedBox( width: double.infinity, child: TextFormField( - controller: _model.keyTextFieldTextController1, - focusNode: _model.keyTextFieldFocusNode1, - onChanged: (_) => EasyDebounce.debounce( - '_model.keyTextFieldTextController', - const Duration(milliseconds: 2000), - () { - if (mounted) setState(() {}); - }, - ), - autofillHints: const [AutofillHints.password], - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.done, - obscureText: !_model.keyTextFieldVisibility1, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Senha', - enText: 'Password', + controller: _model.keyTextFieldTextController1, + focusNode: _model.keyTextFieldFocusNode1, + onChanged: (_) => EasyDebounce.debounce( + '_model.keyTextFieldTextController', + const Duration(milliseconds: 2000), + () { + if (mounted) setState(() {}); + }, ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Digite a sua senha.....', - enText: 'Enter your password.....', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 20.0, 24.0), - suffixIcon: InkWell( - onTap: () => setState( - () => _model.keyTextFieldVisibility1 = - !_model.keyTextFieldVisibility1, - ), - focusNode: FocusNode(skipTraversal: true), - child: Icon( - _model.keyTextFieldVisibility1 - ? Icons.visibility_outlined - : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + autofillHints: const [AutofillHints.password], + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.done, + obscureText: !_model.keyTextFieldVisibility1, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Senha', + enText: 'Password', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -268,20 +198,94 @@ class _PassKeyTemplateWidgetState fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), + ), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Digite a sua senha.....', + enText: 'Enter your password.....', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + contentPadding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: InkWell( + onTap: () => setState( + () => _model.keyTextFieldVisibility1 = + !_model.keyTextFieldVisibility1, + ), + focusNode: FocusNode(skipTraversal: true), + child: Icon( + _model.keyTextFieldVisibility1 + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), + ), ), - maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.enforced, - buildCounter: (context, - {required currentLength, - required isFocused, - maxLength}) => - null, - keyboardType: TextInputType.number, - cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.keyTextFieldTextControllerValidator1 - .asValidator(context), - inputFormatters: [ + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLength: 4, + maxLengthEnforcement: MaxLengthEnforcement.enforced, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, + keyboardType: TextInputType.number, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.keyTextFieldTextControllerValidator1 + .asValidator(context), + inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), ], ), ), @@ -340,4 +344,4 @@ class _PassKeyTemplateWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index 4178de7c..4b79c7c0 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -4,6 +4,8 @@ import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget; import 'package:flutter/material.dart'; + + class ForgotPasswordTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -23,4 +25,4 @@ class ForgotPasswordTemplateComponentModel emailAddressFocusNode?.dispose(); emailAddressTextController?.dispose(); } -} +} \ No newline at end of file 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 39cce295..156672de 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -8,6 +10,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; export 'forgot_password_template_component_model.dart'; +// + + class ForgotPasswordTemplateComponentWidget extends StatefulWidget { const ForgotPasswordTemplateComponentWidget({super.key}); @@ -310,4 +315,4 @@ class _ForgotPasswordTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart index 009f0a84..6612b45a 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart @@ -1,7 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'liberation_history_item_details_template_component_widget.dart' - show LiberationHistoryItemDetailsTemplateComponentWidget; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class LiberationHistoryItemDetailsTemplateComponentModel @@ -75,4 +78,4 @@ class LiberationHistoryItemDetailsTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart index bf7b6a1b..025df6e5 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart @@ -1,11 +1,13 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_item_details_template_component_model.dart'; -export 'liberation_history_item_details_template_component_model.dart'; class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { @@ -363,4 +365,4 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart index 2e5bc0c6..0bcc4038 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart @@ -1,8 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'message_notification_widget.dart' - show MessageNotificationModalTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class MessageNotificationModalTemplateComponentModel extends FlutterFlowModel { @@ -74,4 +76,4 @@ class MessageNotificationModalTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 3a67f3dd..964a9cd7 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -1,10 +1,15 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'message_notification_model.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ @@ -285,4 +290,4 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart index 4e3f3260..da0ca0a5 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart @@ -16,10 +16,15 @@ class QrCodePassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } + if (val.length < 4) return FFLocalizations.of(context).getVariableText( + enText: 'This field must be at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index c2d27cca..9fcaa067 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; @@ -8,6 +10,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'qr_code_pass_key_template_component_model.dart'; export 'qr_code_pass_key_template_component_model.dart'; + + + class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ super.key, @@ -38,7 +43,7 @@ class _QrCodePassKeyTemplateComponentWidgetState _model.keyTextFieldTextController ??= TextEditingController(); _model.keyTextFieldFocusNode ??= FocusNode(); - _model.keyTextFieldFocusNode!.addListener(() => setState(() {})); + _model.keyTextFieldFocusNode!.addListener(() => safeSetState(() {})); } @override @@ -156,19 +161,18 @@ class _QrCodePassKeyTemplateComponentWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( width: double.infinity, child: TextFormField( controller: _model.keyTextFieldTextController, - focusNode: _model.keyTextFieldFocusNode, onChanged: (_) => EasyDebounce.debounce( '_model.keyTextFieldTextController', const Duration(milliseconds: 2000), - () => setState(() {}), + () => safeSetState(() {}), ), autofillHints: const [AutofillHints.password], textCapitalization: TextCapitalization.none, @@ -182,7 +186,7 @@ class _QrCodePassKeyTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -204,14 +208,14 @@ class _QrCodePassKeyTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -235,7 +239,7 @@ class _QrCodePassKeyTemplateComponentWidgetState contentPadding: const EdgeInsetsDirectional.fromSTEB( 24.0, 24.0, 20.0, 24.0), suffixIcon: InkWell( - onTap: () => setState( + onTap: () => safeSetState( () => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility, ), @@ -259,7 +263,7 @@ class _QrCodePassKeyTemplateComponentWidgetState .containsKey('Plus Jakarta Sans'), ), maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.none, + maxLengthEnforcement: MaxLengthEnforcement.enforced, buildCounter: (context, {required currentLength, required isFocused, @@ -270,7 +274,9 @@ class _QrCodePassKeyTemplateComponentWidgetState validator: _model.keyTextFieldTextControllerValidator .asValidator(context), inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')) + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), + ], ), ), @@ -325,4 +331,4 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index a779051b..e0f842b7 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,9 +1,12 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'regisiter_vistor_template_component_widget.dart' - show RegisiterVistorTemplateComponentWidget; + +import 'dart:typed_data'; + import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/uploaded_file.dart'; class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { @@ -55,3 +58,4 @@ class RegisiterVistorTemplateComponentModel textController4?.dispose(); } } + diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 4a00c919..2ea62d9b 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,17 +1,25 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; + +import 'dart:typed_data'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/upload_data.dart'; +import 'package:hub/flutter_flow/uploaded_file.dart'; import 'package:provider/provider.dart'; -import 'regisiter_vistor_template_component_model.dart'; -export 'regisiter_vistor_template_component_model.dart'; + + class RegisiterVistorTemplateComponentWidget extends StatefulWidget { const RegisiterVistorTemplateComponentWidget({super.key}); @@ -705,7 +713,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.dropDownValue != '') && (_model.textController2.text != '')) { _model.imgBase64 = - await actions.convertImageFileToBase64( + await convertImageFileToBase64( _model.uploadedLocalFile, ); _model.registerVisitor = @@ -818,4 +826,4 @@ class _RegisiterVistorTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index f305c4de..8da449ab 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,8 +1,10 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_details_modal_template_component_widget.dart' - show VisitDetailsModalTemplateComponentWidget; + + +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/view_visit_detail/view_visit_detail_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class VisitDetailsModalTemplateComponentModel @@ -30,4 +32,4 @@ class VisitDetailsModalTemplateComponentModel viewVisitDetailModel.dispose(); scheduleVisitDetailModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index e5aba602..3ae6ce62 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,9 +1,11 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + + + import 'package:flutter/material.dart'; -import 'visit_details_modal_template_component_model.dart'; -export 'visit_details_modal_template_component_model.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart'; +import 'package:hub/components/view_visit_detail/view_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { const VisitDetailsModalTemplateComponentWidget({ @@ -118,4 +120,4 @@ class _VisitDetailsModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart index 965cbd4b..a5a7eb07 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart @@ -1,8 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_widget.dart' - show VisitRequestTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitRequestTemplateComponentModel extends FlutterFlowModel { @@ -56,4 +55,4 @@ class VisitRequestTemplateComponentModel textFieldFocusNodeStatus?.dispose(); textControllerStatus?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index 59ac857a..faae71ee 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -1,14 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_model.dart'; -export 'visit_request_template_component_model.dart'; class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ @@ -836,4 +836,4 @@ class _VisitRequestTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file 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 63da16d2..1b473920 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart @@ -1,7 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_search_modal_template_component_widget.dart' - show VisitorSearchModalTemplateComponentWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorSearchModalTemplateComponentModel @@ -42,4 +43,4 @@ class VisitorSearchModalTemplateComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index f393b4ec..460ef502 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,16 +1,20 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'visitor_search_modal_template_component_model.dart'; -export 'visitor_search_modal_template_component_model.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { const VisitorSearchModalTemplateComponentWidget({ @@ -531,4 +535,4 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/view_visit_detail/view_visit_detail_widget.dart index e5c4195f..bea401b7 100644 --- a/lib/components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/view_visit_detail/view_visit_detail_widget.dart @@ -1,6 +1,9 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart b/lib/custom_code/actions/convert_image_file_to_base64.dart index 595a0468..33f4fd83 100644 --- a/lib/custom_code/actions/convert_image_file_to_base64.dart +++ b/lib/custom_code/actions/convert_image_file_to_base64.dart @@ -1,17 +1,12 @@ -// Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom action code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! + +// Automatic FlutterFlow imports + +import 'index.dart'; // Imports other custom actions +import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:typed_data'; +import '../../flutter_flow/uploaded_file.dart'; Future convertImageFileToBase64(FFUploadedFile imageFile) async { List? imageBytes = imageFile.bytes; @@ -19,4 +14,4 @@ Future convertImageFileToBase64(FFUploadedFile imageFile) async { String base64Image = base64Encode(imageBytes); return base64Image; } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_to_upload_file.dart b/lib/custom_code/actions/convert_to_upload_file.dart index da9e3dae..e72f0efe 100644 --- a/lib/custom_code/actions/convert_to_upload_file.dart +++ b/lib/custom_code/actions/convert_to_upload_file.dart @@ -14,6 +14,7 @@ import 'dart:convert'; // Import for base64 decoding import 'dart:io'; // Import for file operations import 'package:path_provider/path_provider.dart'; // Import for temporary directory + Future convertToUploadFile(String img) async { // Decode the base64 string into bytes Uint8List bytes = base64.decode(img); @@ -29,4 +30,4 @@ Future convertToUploadFile(String img) async { bytes: bytes, name: 'image.jpg', ); -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart index 7fb469f1..e5df025d 100644 --- a/lib/custom_code/actions/get_dev_u_u_i_d.dart +++ b/lib/custom_code/actions/get_dev_u_u_i_d.dart @@ -12,6 +12,9 @@ import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; + + + Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { @@ -58,4 +61,4 @@ Future getSerialNumber() async { log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.serialNumber; // unique ID on Android } -} +} \ No newline at end of file diff --git a/lib/custom_code/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart index da1dbe23..90704f46 100644 --- a/lib/custom_code/widgets/image_cropper.dart +++ b/lib/custom_code/widgets/image_cropper.dart @@ -1,179 +1,181 @@ -// Automatic FlutterFlow imports -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; -import '/actions/actions.dart' as action_blocks; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'index.dart'; // Imports other custom widgets -import '/custom_code/actions/index.dart'; // Imports custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom widget code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! +// // Automatic FlutterFlow imports +// import '/backend/schema/structs/index.dart'; +// import '/backend/schema/enums/enums.dart'; +// import '/actions/actions.dart' as action_blocks; +// import '/flutter_flow/flutter_flow_theme.dart'; +// import '/flutter_flow/flutter_flow_util.dart'; +// import 'index.dart'; // Imports other custom widgets +// import '/custom_code/actions/index.dart'; // Imports custom actions +// import '/flutter_flow/custom_functions.dart'; // Imports custom functions +// import 'package:flutter/material.dart'; +// // Begin custom widget code +// // DO NOT REMOVE OR MODIFY THE CODE ABOVE! -import 'package:crop_your_image/crop_your_image.dart'; -import 'package:google_fonts/google_fonts.dart'; -import '/backend/firebase_storage/storage.dart'; +// import 'package:crop_your_image/crop_your_image.dart'; +// import 'package:google_fonts/google_fonts.dart'; +// import '/backend/firebase_storage/storage.dart'; -class ImageCropper extends StatefulWidget { - const ImageCropper({ - super.key, - this.width, - this.height, - this.imageFile, - this.callBackAction, - this.currentUserId, - }); +// ///////////////// - final double? width; - final double? height; - final FFUploadedFile? imageFile; - final Future Function(String? url)? callBackAction; - final String? currentUserId; +// class ImageCropper extends StatefulWidget { +// const ImageCropper({ +// super.key, +// this.width, +// this.height, +// this.imageFile, +// this.callBackAction, +// this.currentUserId, +// }); - @override - State createState() => _ImageCropperState(); -} +// final double? width; +// final double? height; +// final FFUploadedFile? imageFile; +// final Future Function(String? url)? callBackAction; +// final String? currentUserId; -class _ImageCropperState extends State { - bool loading = false; - final _crop_controller = CropController(); - @override - Widget build(BuildContext context) { - return Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: widget.width ?? double.infinity, - height: (widget.height ?? 555) - 80, - child: Center( - child: Crop( - image: Uint8List.fromList(widget.imageFile!.bytes!), - controller: _crop_controller, - onCropped: (image) async { - final path = _getStoragePath(_firebasePathPrefix(), - widget.imageFile!.name!, false, 0); - uploadData(path, image).then((value) { - log('image cropped'); - widget.callBackAction!.call(value!); - loading = false; - }); - // add error handling here - }, +// @override +// State createState() => _ImageCropperState(); +// } - aspectRatio: 1 / 1, - initialSize: 0.5, - // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ - //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), - withCircleUi: true, - baseColor: Color.fromARGB(255, 0, 3, 22), - maskColor: Colors.white.withAlpha(100), - radius: 20, +// class _ImageCropperState extends State { +// bool loading = false; +// final _crop_controller = CropController(); +// @override +// Widget build(BuildContext context) { +// return Stack( +// children: [ +// Column( +// mainAxisSize: MainAxisSize.min, +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Container( +// width: widget.width ?? double.infinity, +// height: (widget.height ?? 555) - 80, +// child: Center( +// child: Crop( +// image: Uint8List.fromList(widget.imageFile!.bytes!), +// controller: _crop_controller, +// onCropped: (image) async { +// final path = _getStoragePath(_firebasePathPrefix(), +// widget.imageFile!.name!, false, 0); +// uploadData(path, image).then((value) { +// log('image cropped'); +// widget.callBackAction!.call(value!); +// loading = false; +// }); +// // add error handling here +// }, - onMoved: (newRect) { - // do something with current cropping area. - }, - onStatusChanged: (status) { - // do something with current CropStatus - }, - cornerDotBuilder: (size, edgeAlignment) => - const DotControl(color: Colors.white), - interactive: true, - // fixArea: true, - ))), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), - child: ElevatedButton( - onPressed: () async { - if (!loading) { - setState(() { - loading = true; - }); - log('Button pressed ...'); - _crop_controller.crop(); +// aspectRatio: 1 / 1, +// initialSize: 0.5, +// // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ +// //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), +// withCircleUi: true, +// baseColor: Color.fromARGB(255, 0, 3, 22), +// maskColor: Colors.white.withAlpha(100), +// radius: 20, - //widget.loading = true; - } - }, - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - FlutterFlowTheme.of(context).primaryColor, - ), - padding: MaterialStateProperty.all( - EdgeInsets.zero, - ), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(100), - side: BorderSide.none, - ), - ), - ), - child: Container( - width: 250, - height: 50, - alignment: Alignment.center, - child: loading - ? CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation(Colors.white), - ) - : Text( - 'Crop', - style: FlutterFlowTheme.of(context) - .subtitle2 - .override( - fontFamily: 'Lexend', - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .subtitle2Family), - ), - ), - ), - )), - ]), - Positioned( - top: 4, - right: 4, - child: IconButton( - icon: Icon(Icons.close), - onPressed: () => Navigator.pop(context), - )) - ], - ); - } +// onMoved: (newRect) { +// // do something with current cropping area. +// }, +// onStatusChanged: (status) { +// // do something with current CropStatus +// }, +// cornerDotBuilder: (size, edgeAlignment) => +// const DotControl(color: Colors.white), +// interactive: true, +// // fixArea: true, +// ))), +// Padding( +// padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), +// child: ElevatedButton( +// onPressed: () async { +// if (!loading) { +// setState(() { +// loading = true; +// }); +// log('Button pressed ...'); +// _crop_controller.crop(); - String _getStoragePath( - String? pathPrefix, - String filePath, - bool isVideo, [ - int? index, - ]) { - pathPrefix ??= _firebasePathPrefix(); - pathPrefix = _removeTrailingSlash(pathPrefix); - final timestamp = DateTime.now().microsecondsSinceEpoch; - final prefix = 'cropped-'; - // Workaround fixed by https://github.com/flutter/plugins/pull/3685 - // (not yet in stable). - final ext = isVideo ? 'mp4' : filePath.split('.').last; - final indexStr = index != null ? '_$index' : ''; - return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; - } +// //widget.loading = true; +// } +// }, +// style: ButtonStyle( +// backgroundColor: MaterialStateProperty.all( +// FlutterFlowTheme.of(context).primaryColor, +// ), +// padding: MaterialStateProperty.all( +// EdgeInsets.zero, +// ), +// shape: MaterialStateProperty.all( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(100), +// side: BorderSide.none, +// ), +// ), +// ), +// child: Container( +// width: 250, +// height: 50, +// alignment: Alignment.center, +// child: loading +// ? CircularProgressIndicator( +// valueColor: +// AlwaysStoppedAnimation(Colors.white), +// ) +// : Text( +// 'Crop', +// style: FlutterFlowTheme.of(context) +// .subtitle2 +// .override( +// fontFamily: 'Lexend', +// color: Colors.white, +// fontSize: 16, +// fontWeight: FontWeight.normal, +// useGoogleFonts: GoogleFonts.asMap() +// .containsKey( +// FlutterFlowTheme.of(context) +// .subtitle2Family), +// ), +// ), +// ), +// )), +// ]), +// Positioned( +// top: 4, +// right: 4, +// child: IconButton( +// icon: Icon(Icons.close), +// onPressed: () => Navigator.pop(context), +// )) +// ], +// ); +// } - String? _removeTrailingSlash(String? path) => - path != null && path.endsWith('/') - ? path.substring(0, path.length - 1) - : path; +// String _getStoragePath( +// String? pathPrefix, +// String filePath, +// bool isVideo, [ +// int? index, +// ]) { +// pathPrefix ??= _firebasePathPrefix(); +// pathPrefix = _removeTrailingSlash(pathPrefix); +// final timestamp = DateTime.now().microsecondsSinceEpoch; +// final prefix = 'cropped-'; +// // Workaround fixed by https://github.com/flutter/plugins/pull/3685 +// // (not yet in stable). +// final ext = isVideo ? 'mp4' : filePath.split('.').last; +// final indexStr = index != null ? '_$index' : ''; +// return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; +// } - String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; -} -// Set your widget name, define your parameter, and then add the -// boilerplate code using the green button on the right! +// String? _removeTrailingSlash(String? path) => +// path != null && path.endsWith('/') +// ? path.substring(0, path.length - 1) +// : path; + +// String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; +// } +// // Set your widget name, define your parameter, and then add the +// // boilerplate code using the green button on the right! diff --git a/lib/custom_code/widgets/menu.dart b/lib/custom_code/widgets/menu.dart new file mode 100644 index 00000000..b3fa00c7 --- /dev/null +++ b/lib/custom_code/widgets/menu.dart @@ -0,0 +1,61 @@ + +import 'dart:collection'; + +import 'package:flutter/material.dart'; + +LinkedHashMap menu = LinkedHashMap.from({ + "Schedule": + [{ + "title": "Schedule\nVisit", + "icon": Icons.settings, + "route": "/Schedule", + }, + { + "title": "Complete\Schedule", + "icon": Icons.calendar_today, + "route": "/Complete", + }, + { + "title": "Provisional\Schedule", + "icon": Icons.calendar_today, + "route": "/Provisional", + }, + { + "title": "Fast\Schedule", + "icon": Icons.calendar_today, + "route": "/Fast", + }], + "Consult": + [{ + "title": "Consult", + "icon": Icons.search, + "route": "/consult", + }, + { + "title": "Liberation\nConsult", + "icon": Icons.search, + "route": "/Liberation", + }, + { + "title": "Access\nConsult", + "icon": Icons.search, + "route": "/Access", + }, + { + "title": "Poeple\nConsult", + "icon": Icons.search, + "route": "/Poeple", + }, + { + "title": "QR Code\nConsult", + "icon": Icons.search, + "route": "/qrcode", + }], + "Preferences": + [{ + "title": "Preferences", + "icon": Icons.settings, + "route": "/preferences", + }], + +}); \ No newline at end of file diff --git a/lib/flutter_flow/custom_functions.dart b/lib/flutter_flow/custom_functions.dart index 066402f2..f33176c1 100644 --- a/lib/flutter_flow/custom_functions.dart +++ b/lib/flutter_flow/custom_functions.dart @@ -8,8 +8,7 @@ import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; + String? isOneAcliID(String jsonString) { // Converte o JSON em um Map diff --git a/lib/flutter_flow/custom_icons.dart b/lib/flutter_flow/custom_icons.dart index 52991086..07cebe2e 100644 --- a/lib/flutter_flow/custom_icons.dart +++ b/lib/flutter_flow/custom_icons.dart @@ -18,4 +18,4 @@ class FFIcons { IconData(0xe900, fontFamily: _menuFamily); static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily); static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_animations.dart b/lib/flutter_flow/flutter_flow_animations.dart index 486179ca..c101a376 100644 --- a/lib/flutter_flow/flutter_flow_animations.dart +++ b/lib/flutter_flow/flutter_flow_animations.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; + enum AnimationTrigger { onPageLoad, onActionTrigger, @@ -108,4 +109,4 @@ class TiltEffect extends Effect { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart b/lib/flutter_flow/flutter_flow_button_tabbar.dart index fcf320b3..4ea6374d 100644 --- a/lib/flutter_flow/flutter_flow_button_tabbar.dart +++ b/lib/flutter_flow/flutter_flow_button_tabbar.dart @@ -6,6 +6,8 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; + + const double _kTabHeight = 46.0; typedef _LayoutCallback = void Function( @@ -851,4 +853,4 @@ class _FlutterFlowButtonTabBarState extends State return tabBar; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart b/lib/flutter_flow/flutter_flow_checkbox_group.dart index 61e5f3df..fc089d10 100644 --- a/lib/flutter_flow/flutter_flow_checkbox_group.dart +++ b/lib/flutter_flow/flutter_flow_checkbox_group.dart @@ -4,6 +4,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +//// + + class FlutterFlowCheckboxGroup extends StatefulWidget { const FlutterFlowCheckboxGroup({ super.key, @@ -131,4 +134,4 @@ class _FlutterFlowCheckboxGroupState extends State { ); }, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart index 0e7bc61c..26476a81 100644 --- a/lib/flutter_flow/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -1,5 +1,7 @@ import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; + import 'form_field_controller.dart'; import 'package:flutter/material.dart'; @@ -370,4 +372,4 @@ class _FlutterFlowDropDownState extends State> { : null, ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart b/lib/flutter_flow/flutter_flow_icon_button.dart index 6e77c8a0..d41b72bb 100644 --- a/lib/flutter_flow/flutter_flow_icon_button.dart +++ b/lib/flutter_flow/flutter_flow_icon_button.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + + class FlutterFlowIconButton extends StatefulWidget { const FlutterFlowIconButton({ super.key, @@ -167,4 +169,4 @@ class _FlutterFlowIconButtonState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_model.dart b/lib/flutter_flow/flutter_flow_model.dart index 5a1225da..93752ff6 100644 --- a/lib/flutter_flow/flutter_flow_model.dart +++ b/lib/flutter_flow/flutter_flow_model.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; + Widget wrapWithModel({ required T model, required Widget child, @@ -164,4 +165,4 @@ T? _getDefaultValue() { extension TextValidationExtensions on String? Function(BuildContext, String?)? { String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart index 12792945..a924cb38 100644 --- a/lib/flutter_flow/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; + const kThemeModeKey = '__theme_mode__'; SharedPreferences? _prefs; @@ -50,6 +51,7 @@ abstract class FlutterFlowTheme { late Color secondary; late Color tertiary; late Color alternate; + late Color alternate2; late Color primaryText; late Color secondaryText; late Color primaryBackground; @@ -160,6 +162,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFFB59E9E); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFFF2F2F2); + late Color alternate2 = const Color(0xFF232323); late Color primaryText = const Color(0xFF000000); late Color secondaryText = const Color(0xFFFFFFFF); late Color primaryBackground = const Color(0xFFFFFFFF); @@ -559,6 +562,7 @@ class DarkModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFF18AA99); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFF232323); + late Color alternate2 = const Color(0xFF171717); late Color primaryText = const Color(0xFFFFFFFF); late Color secondaryText = const Color(0xFF000000); late Color primaryBackground = const Color(0xFF171717); @@ -616,4 +620,4 @@ extension TextStyleHelper on TextStyle { height: lineHeight, shadows: shadows, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 8bdcf64e..ba7e763b 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -18,7 +18,7 @@ export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; export 'place.dart'; export 'uploaded_file.dart'; -export '../app_state.dart'; +export '/app_state.dart'; export 'flutter_flow_model.dart'; export 'dart:math' show min, max; export 'dart:typed_data' show Uint8List; @@ -27,7 +27,6 @@ export 'package:intl/intl.dart'; export 'package:page_transition/page_transition.dart'; export 'custom_icons.dart' show FFIcons; export 'internationalization.dart' show FFLocalizations; -export 'nav/nav.dart'; T valueOrDefault(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value; @@ -568,4 +567,4 @@ double computeGradientAlignmentY(double evaluatedAngle) { y = sin(2 * rads); } return double.parse(roundTo(y, 2)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart index 5f36df96..f9db2be0 100644 --- a/lib/flutter_flow/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -2,6 +2,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:flutter/material.dart'; import 'package:auto_size_text/auto_size_text.dart'; + class FFButtonOptions { const FFButtonOptions({ this.textAlign, @@ -285,4 +286,4 @@ double? _getTextWidth(String? text, TextStyle? style, int maxLines) => )..layout()) .size .width - : null; + : null; \ No newline at end of file diff --git a/lib/flutter_flow/form_field_controller.dart b/lib/flutter_flow/form_field_controller.dart index b8020e3b..1d152bb9 100644 --- a/lib/flutter_flow/form_field_controller.dart +++ b/lib/flutter_flow/form_field_controller.dart @@ -1,5 +1,6 @@ import 'package:flutter/foundation.dart'; + class FormFieldController extends ValueNotifier { FormFieldController(this.initialValue) : super(initialValue); @@ -20,4 +21,4 @@ class FormListFieldController extends FormFieldController> { @override void reset() => value = List.from(_initialListValue ?? []); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index e535962b..ca4cb34f 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -967,7 +967,7 @@ final kTranslationsMap = >>[ }, 'a9smhn5b': { 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', + 'en': 'You already have an account? ', }, '09xv5ctc': { 'pt': 'Clique aqui', @@ -1272,4 +1272,4 @@ final kTranslationsMap = >>[ 'en': 'Block completed', }, }, -].reduce((a, b) => a..addAll(b)); +].reduce((a, b) => a..addAll(b)); \ No newline at end of file diff --git a/lib/flutter_flow/keep_alive_wrapper.dart b/lib/flutter_flow/keep_alive_wrapper.dart index 286bde09..fd9c5150 100644 --- a/lib/flutter_flow/keep_alive_wrapper.dart +++ b/lib/flutter_flow/keep_alive_wrapper.dart @@ -22,4 +22,4 @@ class _KeepAliveWidgetWrapperState extends State super.build(context); return widget.builder(context); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/lat_lng.dart b/lib/flutter_flow/lat_lng.dart index 9e7b8ea8..68758f91 100644 --- a/lib/flutter_flow/lat_lng.dart +++ b/lib/flutter_flow/lat_lng.dart @@ -16,4 +16,4 @@ class LatLng { other is LatLng && latitude == other.latitude && longitude == other.longitude; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 6eed8f03..29785cdc 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -1,9 +1,10 @@ import 'dart:async'; -import 'package:f_r_e_hub/pages/fast_pass_page/fast_pass_page_widget.dart'; -import 'package:f_r_e_hub/pages/message_history_page/message_history_page_widget.dart'; -import 'package:f_r_e_hub/pages/preferences_settings_page/preferences_settings_widget.dart'; 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'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; import 'package:provider/provider.dart'; import '/backend/schema/structs/index.dart'; @@ -17,6 +18,8 @@ export 'serialization_util.dart'; const kTransitionInfoKey = '__transition_info__'; +/// + class AppStateNotifier extends ChangeNotifier { AppStateNotifier._(); @@ -379,4 +382,4 @@ extension GoRouterLocationExtension on GoRouter { : routerDelegate.currentConfiguration; return matchList.uri.toString(); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart index f9665c41..887c8eec 100644 --- a/lib/flutter_flow/nav/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -10,6 +10,7 @@ import '../../flutter_flow/lat_lng.dart'; import '../../flutter_flow/place.dart'; import '../../flutter_flow/uploaded_file.dart'; + /// SERIALIZATION HELPERS String dateTimeRangeToString(DateTimeRange dateTimeRange) { @@ -228,4 +229,4 @@ dynamic deserializeParam( log('Error deserializing parameter: $e'); return null; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/permissions_util.dart b/lib/flutter_flow/permissions_util.dart index c7b8c2ff..304c8a17 100644 --- a/lib/flutter_flow/permissions_util.dart +++ b/lib/flutter_flow/permissions_util.dart @@ -15,4 +15,4 @@ Future getPermissionStatus(Permission setting) async { } Future requestPermission(Permission setting) async => - await setting.request(); + await setting.request(); \ No newline at end of file diff --git a/lib/flutter_flow/place.dart b/lib/flutter_flow/place.dart index e3589b3b..972fb8be 100644 --- a/lib/flutter_flow/place.dart +++ b/lib/flutter_flow/place.dart @@ -43,4 +43,4 @@ class FFPlace { state == other.state && country == other.country && zipCode == other.zipCode; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/random_data_util.dart b/lib/flutter_flow/random_data_util.dart index 6599e5a6..fd966a2c 100644 --- a/lib/flutter_flow/random_data_util.dart +++ b/lib/flutter_flow/random_data_util.dart @@ -48,4 +48,4 @@ String randomImageUrl(int width, int height) { Color randomColor() { return Color.fromARGB( 255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/request_manager.dart b/lib/flutter_flow/request_manager.dart index f26ed03b..c9b4dcc8 100644 --- a/lib/flutter_flow/request_manager.dart +++ b/lib/flutter_flow/request_manager.dart @@ -90,4 +90,4 @@ class StreamRequestManager { } String _requestKey(String? key) => - key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; \ No newline at end of file diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 11219e59..6b6baf2b 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -374,4 +374,4 @@ void showUploadMessage( String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/') ? path.substring(0, path.length - 1) - : path; + : path; \ No newline at end of file diff --git a/lib/flutter_flow/uploaded_file.dart b/lib/flutter_flow/uploaded_file.dart index 2dfd2ff1..cbe68cad 100644 --- a/lib/flutter_flow/uploaded_file.dart +++ b/lib/flutter_flow/uploaded_file.dart @@ -65,4 +65,4 @@ class FFUploadedFile { height == other.height && width == other.width && blurHash == other.blurHash; -} +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 9bc5efc1..3348f78f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,19 +1,25 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:responsive_framework/responsive_framework.dart'; import 'firebase_options.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; -import 'flutter_flow/flutter_flow_theme.dart'; -import 'flutter_flow/flutter_flow_util.dart'; -import 'flutter_flow/internationalization.dart'; +import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); void main() async { WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); await initializeApp(); runApp(ChangeNotifierProvider( create: (context) => FFAppState(), @@ -129,4 +135,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index a03ec14e..4d633ac2 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,10 +1,13 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; -import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; class AcessHistoryPageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -54,4 +57,4 @@ class AcessHistoryPageModel extends FlutterFlowModel { }, ); } -} +} \ No newline at end of file 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 ecbbdb94..58976eb6 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -3,18 +3,24 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '../../components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'acess_history_page_model.dart'; -export 'acess_history_page_model.dart'; + @immutable class AcessHistoryPageWidget extends StatefulWidget { @@ -319,26 +325,48 @@ class _AcessHistoryPageWidgetState extends State { 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', 'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '', }), - statusHashMap: accessHistoryItem['PES_TIPO'] == 'O' + statusHashMap: [ + accessHistoryItem['PES_TIPO'] == 'O' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Visitado', - enText: 'Visited', - ): FlutterFlowTheme.of(context).success, + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, }) : accessHistoryItem['PES_TIPO'] == 'E' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitante', enText: 'Visitor', - ): FlutterFlowTheme.of(context).warning, + ): FlutterFlowTheme.of(context).alternate2, }) : Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', - ): FlutterFlowTheme.of(context).error, + ): FlutterFlowTheme.of(context).alternate2, }), + accessHistoryItem['ACE_TIPO'] == '0' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Entrada', + enText: 'Entrance', + ): FlutterFlowTheme.of(context).success, + }) + : accessHistoryItem['ACE_TIPO'] == '1' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Saída', + enText: 'Exit', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).warning, + }) + ], onTapCardItemAction: () async {}); } } @@ -382,8 +410,8 @@ Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, decoration: BoxDecoration( color: (() { // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = functions - .jsonToStr(getJsonField( + final pesTipo = + jsonToStr(getJsonField( accessHistoryItem, r'''$.PES_TIPO''', )) @@ -525,4 +553,4 @@ String imageUrlAtomWidget(String document, String type) { "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} +} \ No newline at end of file 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 556fc661..96dfaf9a 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -1,13 +1,12 @@ import 'dart:developer'; -import 'package:f_r_e_hub/app_state.dart'; +import 'package:hub/app_state.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'dart:io' show Platform; -import '/flutter_flow/flutter_flow_util.dart'; class FastPassPageWidget extends StatefulWidget { final String freToken = FFAppState().userUUID; @@ -95,4 +94,4 @@ class _FastPassPageWidgetState extends State { ); } -} +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index d938eebc..7c227e9c 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,11 +1,10 @@ -import 'package:f_r_e_hub/components/organism_components/message_well_component/message_well_component_model.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'home_page_widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_model.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/home_page/home_page_widget.dart'; class HomePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -45,4 +44,6 @@ class HomePageModel extends FlutterFlowModel { menuComponentModel.dispose(); messageWellComponentModel.dispose(); } -} + + +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 00cdc98e..c81132ab 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,29 +1,38 @@ -// import 'package:f_r_e_hub/backend/push_notification/pushNotification.dart'; +// import 'package:hub/backend/push_notification/pushNotification.dart'; import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; + + import 'package:provider/provider.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'home_page_model.dart'; -export 'home_page_model.dart'; class HomePageWidget extends StatefulWidget { const HomePageWidget({super.key}); + + + @override State createState() => _HomePageWidgetState(); } @@ -96,6 +105,7 @@ class _HomePageWidgetState extends State { @override Widget build(BuildContext context) { + context.watch(); return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus @@ -155,7 +165,14 @@ class _HomePageWidgetState extends State { wrapWithModel( model: _model.menuComponentModel, updateCallback: () => setState(() {}), - child: const MenuComponentWidget(), + child: MenuComponentWidget( + options: [ + + ], + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), ), Align( alignment: const AlignmentDirectional(0.0, 0.0), @@ -401,7 +418,7 @@ class _HomePageWidgetState extends State { width: 150.0, child: Text( valueOrDefault( - functions.convertToUppercase( + convertToUppercase( FFAppState().local), 'NOME DO LOCAL', ), @@ -573,569 +590,41 @@ class _HomePageWidgetState extends State { child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( 10.0, 20.0, 10.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kfast, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'dlaeicxd' /* Auto-Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .primary, - size: 24.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '53jd930v' /* Condominio */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'ptsx0rln' /* Cadastrar Pet */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 22.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rgxgw626' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'j2tn9lpw' /* QR Code de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector3, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '9weuwgs1' /* Histórico de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'vuk5bjau' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - ], + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + options: [ + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, ), + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitors', + ptText: 'Registrar Visitantes', + ), + icon: Icons.person_add_alt_1_outlined, + ), + ], + expandable: false, + style: MenuView.list, + item: MenuItem.card, ), ), + ), ), ), FFButtonWidget( onPressed: () async { FFAppState().isLogged = false; setState(() {}); - context.goNamed( 'welcomePage', extra: { diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart index b828bcf3..a26534bb 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -1,9 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import 'liberation_history_widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/liberation_history/liberation_history_widget.dart'; class LiberationHistoryModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -44,4 +45,4 @@ class LiberationHistoryModel extends FlutterFlowModel { clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 29443a9d..3627c1b4 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -2,23 +2,25 @@ import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; + +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_model.dart'; -export 'liberation_history_model.dart'; + class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -253,8 +255,7 @@ Widget liberationDynamicListView( []; final filteredLiberationHistory = _model.textController.text.isNotEmpty ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( + .where((item) => jsonToStr(getJsonField( item, r'''$.VTE_NOME''', )) @@ -308,7 +309,7 @@ Widget liberationHistoryItemCard( 'Data:': liberationHistoryItem['NOT_DTENVIO'], 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' + statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Ativo', @@ -327,7 +328,7 @@ Widget liberationHistoryItemCard( ptText: 'Pendente', enText: 'Pending', ): FlutterFlowTheme.of(context).warning, - }), + })], onTapCardItemAction: () async { showModalBottomSheet( isScrollControlled: true, @@ -379,4 +380,4 @@ Widget liberationHistoryItemCard( }); }, ); -} +} \ No newline at end of file diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/message_history_page/message_history_page_model.dart index 1bfa4793..9a40e0c4 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,9 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import 'message_history_page_widget.dart' show MessageHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; class MessageHistoryPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -17,6 +18,10 @@ class MessageHistoryPageModel extends FlutterFlowModel TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + /// Query cache managers for this widget. final _getLiberationsManager = StreamRequestManager(); @@ -42,9 +47,11 @@ class MessageHistoryPageModel extends FlutterFlowModel unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); + tabBarController?.dispose(); + /// Dispose query cache managers for this widget. clearGetLiberationsCache(); } -} +} \ No newline at end of file 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 00a96f6f..18cffa18 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,22 +2,21 @@ import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/message_history_page/message_history_page_model.dart'; + -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'message_history_page_model.dart'; class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @@ -27,7 +26,7 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State { +class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -37,6 +36,12 @@ class _MessageHistoryPageWidgetState extends State { super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); + _model.tabBarController = TabController( + vsync: this, + length: 3, + initialIndex: 1, + )..addListener(() => setState(() {})); + _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); } @@ -56,21 +61,16 @@ class _MessageHistoryPageWidgetState extends State { @override Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarLiberationHistoryPage(context), - body: bodyLiberationHistoryPage(context, _model), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarMessage(context), + body: bodyMessage(context, _model), ); } } -PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { +PreferredSizeWidget appBarMessage(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, @@ -89,8 +89,9 @@ PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { }, ), title: Text( - FFLocalizations.of(context).getText( - '784f83pc' /* Histórico de Liberação */, + FFLocalizations.of(context).getVariableText( + enText: 'Message History', + ptText: 'Histórico de Mensagens', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', @@ -105,7 +106,7 @@ PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { ); } -Widget bodyLiberationHistoryPage( +Widget bodyMessage( BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, @@ -113,7 +114,55 @@ Widget bodyLiberationHistoryPage( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: liberationDynamicListView(context, _model)), + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Pessoal', + enText: 'Personal', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + enText: 'All', + ptText: 'Todos', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Global', + enText: 'Global', + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded(child: TabBarView( + controller: _model.tabBarController, + children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ] + )), ].addToStart(const SizedBox(height: 0)), ), ); @@ -125,22 +174,31 @@ Widget bodyLiberationHistoryPage( Widget liberationDynamicListView( BuildContext context, MessageHistoryPageModel _model, + String DestIndex ) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), - child: StreamBuilder( - stream: _model.getLiberations( - requestFn: () => PhpGroup.getLiberationsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getSolicitacoes', - ), - ), + child: FutureBuilder( + future: PhpGroup.getMessagesCall.call( + devUUID: FFAppState().devUUID.toString(), + userUUID: FFAppState().userUUID.toString(), + cliID: FFAppState().cliUUID.toString(), + atividade: 'getMensagens', + pageSize: '100', + pageNumber: '1', + tipoDestino: DestIndex, + ).catchError((error) { + log('Error: ${error.toString()}'); + return Future.delayed(Duration(seconds: 1), () { + return Center( + child: Text('Erro ao carregar mensagens'), + ); + }); + }), builder: (context, snapshot) { - if (!snapshot.hasData) { + if (snapshot.connectionState == ConnectionState.waiting) { return Center( child: SizedBox( width: 50.0, @@ -152,50 +210,22 @@ Widget liberationDynamicListView( ), ); } - final columnGetLiberationsResponse = snapshot.data!; - final liberationHistory = PhpGroup.getLiberationsCall - .rqList( - columnGetLiberationsResponse.jsonBody, - ) - ?.toList() ?? - []; - final filteredLiberationHistory = _model.textController.text.isNotEmpty - ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( - item, - r'''$.VTE_NOME''', - )) - .toLowerCase() - .contains( - _model.textController.text.toLowerCase(), - )) - .toList() - : liberationHistory; - + if (snapshot.hasError == true || snapshot.data == null) { + log('Error: ${snapshot.error.toString()}'); + // log('Error: ${snapshot.data!.jsonBody['mensagens']}'); + return const Center( + child: Text('Erro ao carregar mensagens'), + ); + } return ListView.builder( - itemCount: filteredLiberationHistory.length, + itemCount: snapshot.data!.jsonBody['total_rows'], addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, itemBuilder: (BuildContext context, int index) { - final liberationHistoryItem = filteredLiberationHistory[index]; - return Padding( - padding: EdgeInsets.only( - top: index == 0 - ? MediaQuery.of(context).size.height * 0.075 - : 8.0, - left: 8.0, - right: 8.0, - bottom: 8.0, - ), - child: Align( - alignment: AlignmentDirectional(0.0, 0.0), - child: liberationHistoryItemCard( - context, - liberationHistoryItem, - ), - ), + return messageHistoryItem( + context, + snapshot.data!.jsonBody['mensagens'][index], ); }, ); @@ -204,87 +234,71 @@ Widget liberationDynamicListView( ); } -Widget liberationHistoryItemCard( - BuildContext context, dynamic liberationHistoryItem) { - return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), - labelsHashMap: Map.from({ - 'Nome:': liberationHistoryItem['VTE_NOME'], - 'Data:': liberationHistoryItem['NOT_DTENVIO'], - 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], - }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : liberationHistoryItem['NOT_STATUS'] == 'B' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - }), - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return VisitRequestTemplateComponentWidget( - vteName: liberationHistoryItem['VTE_NOME'], - vteReason: liberationHistoryItem['NOT_MOTIVO'], - vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - ? liberationHistoryItem['NOT_DTENVIO'] - : liberationHistoryItem['NOT_DTRESPOSTA'], - vawStatus: liberationHistoryItem['NOT_STATUS'], - vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - vteUUID: liberationHistoryItem['VTE_ID'], - cliUUID: FFAppState().cliUUID, - msgUUID: liberationHistoryItem['NOT_ID'], - vawDestino: liberationHistoryItem['NOT_DESTINO'], - vawUUID: liberationHistoryItem['NOT_ID'], - vawName: liberationHistoryItem['NOT_NOME'], - vawRef: liberationHistoryItem['NOT_ID'], - changeStatusAction: changeStatusAction, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], - ); - }, - ).then((_) { - PushNotificationManager _pushNotificationService = - PushNotificationManager(); - - _pushNotificationService.onMessageReceived.listen((received) { - if (received.data['click_action'] == 'cancel_request') { - log('Aprovado'); - _pushNotificationService.dispose(); - snackbar(context, opt: true); - context.pushReplacementNamed( - 'liberationHistory', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - }); - }); - }, +Widget messageHistoryItem( + BuildContext context, dynamic jsonBody) { + log(jsonBody.toString()); + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + overflow: TextOverflow.ellipsis, + ), + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ) + ], + ), + SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ), + ], + ), + SizedBox(height: 8), + Text(jsonBody['MSG_TEXTO'].toString(),), + ], + ), + ), + ), + ), ); -} + + +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 31fed050..cc62f4f5 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'people_on_the_property_page_widget.dart' - show PeopleOnThePropertyPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { @@ -16,4 +16,4 @@ class PeopleOnThePropertyPageModel void dispose() { unfocusNode.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index aed5b8f0..0dbfce20 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -1,14 +1,18 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart'; + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'people_on_the_property_page_model.dart'; -export 'people_on_the_property_page_model.dart'; + class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); @@ -41,138 +45,120 @@ class _PeopleOnThePropertyPageWidgetState Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'nsu13r5d' /* Pessoas na Propriedade */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: FutureBuilder( - future: PhpGroup.getPessoasLocalCall.call( - cliID: FFAppState().cliUUID, - ownID: FFAppState().ownerUUID, - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final columnGetPessoasLocalResponse = snapshot.data!; - return Builder( - builder: (context) { - final getPoepleProperty = PhpGroup.getPessoasLocalCall - .pessoas( - columnGetPessoasLocalResponse.jsonBody, - ) - ?.toList() ?? - []; - - return Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: List.generate(getPoepleProperty.length, - (getPoeplePropertyIndex) { - final getPoeplePropertyItem = - getPoepleProperty[getPoeplePropertyIndex]; - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - ), - Text( - getJsonField( - getPoeplePropertyItem, - r'''$.USU_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 40.0)), - ); - }).divide(const SizedBox(height: 3.0)), - ); - }, - ); - }, + title: Text( + FFLocalizations.of(context).getText( + 'nsu13r5d' /* Pessoas na Propriedade */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: FutureBuilder( + future: PhpGroup.getPessoasLocalCall.call( + cliID: FFAppState().cliUUID, + ownID: FFAppState().ownerUUID, + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final columnGetPessoasLocalResponse = snapshot.data!; + final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? + []; + return ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: getPoepleProperty.length, + itemBuilder: (context, index) { + final getPoeplePropertyItem = getPoepleProperty[index]; + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + fit: BoxFit.cover, + ), + ), + ), + Text( + getJsonField( + getPoeplePropertyItem, + r'''$.USU_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 40.0)), + ); + }, + ); + }, ), ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index bc06c770..4668af2e 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -1,11 +1,16 @@ import 'dart:developer'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + + +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class PreferencesPageModel with ChangeNotifier { final unfocusNode = FocusNode(); @@ -135,8 +140,8 @@ class PreferencesPageModel with ChangeNotifier { ) .then((value) { FFAppState().pass = true; - var error = jsonDecode(value.jsonBody['error'].toString()); - log('${jsonDecode(value.jsonBody['error'].toString())}'); + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); if(jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; } else { diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 9e803f27..f2173bfd 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -1,10 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'preferences_settings_model.dart'; + class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -62,14 +66,14 @@ class PreferencesPageWidget extends StatelessWidget { Container(), Expanded( flex: 2, - child: GridView.builder( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 12.0, - mainAxisSpacing: 12.0, - childAspectRatio: 1.0, - mainAxisExtent: 100.0, - ), + child: ListView.builder( + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 3, + // crossAxisSpacing: 12.0, + // mainAxisSpacing: 12.0, + // childAspectRatio: 1.0, + // mainAxisExtent: 100.0, + // ), itemCount: 6, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), @@ -90,51 +94,106 @@ class PreferencesPageWidget extends StatelessWidget { IconData icon; Function() onPressed =() => {}; bool isEnabled; + String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Desabilita se fingerprint for false + onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative a autenticação por impressão digital para login seguro.', + enText: 'Enable fingerprint authentication for secure login.', + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Exibir código de identificação remota', + enText: 'Display remote identification code', + ); break; case 2: icon = Icons.notifications; onPressed = model.toggleNotify; isEnabled = FFAppState().notify; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para receber sua notificação de acesso', + enText: 'Enable to receive your access notification', + ); break; case 3: icon = Icons.lock_clock_sharp; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de acesso para o QRCode', + enText: 'Enable to enter an access credential for the QRCode', + ); break; case 4: icon = Icons.landscape; onPressed = model.localLogout; isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); break; case 5: icon = Icons.delete; onPressed = () => model.deleteAccount(context); isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Delete sua conta e todos os dados associados permanentemente.', + enText: 'Delete your account and all associated data permanently.', + ); break; default: throw Exception('Invalid index: $index'); } - return FlutterFlowIconButton( - icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), - onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, + return Container( + height: 100, + child: GestureDetector( + onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + child: Row( + children: [ + CircleAvatar( + backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + child: Icon( + icon, + color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), + // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + // disabledColor: FlutterFlowTheme.of(context).alternate, + // disabledIconColor: FlutterFlowTheme.of(context).primary, + ), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + content, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + overflow: TextOverflow.clip, + ), + ), + ], + ), + ), ); } } \ No newline at end of file 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 7770c77e..40e016ab 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; import 'dart:async'; -import 'qr_code_page_widget.dart' show QrCodePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart'; class QrCodePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -29,4 +29,4 @@ class QrCodePageModel extends FlutterFlowModel { BuildContext context, { required String? key, }) async {} -} +} \ No newline at end of file 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 b165965a..a6994b95 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,24 +1,30 @@ +import 'dart:developer'; + import 'package:barcode_widget/barcode_widget.dart'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/flutter_flow/custom_functions.dart'; +import 'package:hub/actions/actions.dart'; + +import 'package:hub/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + import 'dart:async'; -import '/flutter_flow/custom_functions.dart' as functions; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; // import 'package:percent_indicator/percent_indicator.dart'; -import 'qr_code_page_model.dart'; -export 'qr_code_page_model.dart'; + import 'package:qr_flutter/qr_flutter.dart'; @@ -99,16 +105,11 @@ void dispose() { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: buildAppBar(context), - body: buildBody(context), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: buildAppBar(context), + body: buildBody(context), ); } @@ -117,16 +118,15 @@ void dispose() { double screenHeight = MediaQuery.of(context).size.height; double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; - double totalTimeInSeconds = 100.0; return SafeArea( - top: true, + // top: true, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (_model.isAccess == true && _model.key != null) - Text( + Text( FFLocalizations.of(context).getVariableText( ptText: 'Use esse QR Code para acesso', enText: 'Use this QR Code for access', @@ -148,9 +148,12 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( onTap: () { - safeSetState(() { - - }); + + safeSetState(() async { + _resetAnimationAndToggleAccess(); + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + }); + }, child: buildQrCode( dimension: dimension, @@ -181,7 +184,7 @@ void dispose() { ), ), if (_model.isAccess == false && _model.key == null) - Align( + Align( alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( splashColor: Colors.transparent, @@ -203,10 +206,7 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: FFButtonWidget( onPressed: () async { - await _showQrCodeBottomSheet(context).then((value) => _toggleQrCodeAccess()).onError((error, stackTrace) => safeSetState((){ - _resetAnimationAndToggleAccess(); - })); - + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); }, text: FFLocalizations.of(context).getVariableText( ptText: 'Gerar QR Code', @@ -311,7 +311,7 @@ void dispose() { padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 20.0, 0.0), child: StreamBuilder( - stream: functions.getProgressValue(), + stream: getProgressValue(), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return CircularProgressIndicator(); @@ -359,20 +359,28 @@ void dispose() { ); } - void _toggleQrCodeAccess() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + + + Future _showBiometricsAuth(BuildContext context) async { + FFAppState().checkBiometrics() + .then((value) => FFAppState().authenticateBiometric() + .then( (value) { + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; + _model.key = FFAppState().fingerprintPass; + }); + } )) + .onError((error, StackTrace) { + _showQrCodeBottomSheet(context); + }); + } - _model.isAccess = !_model.isAccess; - setState(() {}); -} Future _showQrCodeBottomSheet(BuildContext context) async { - if(FFAppState().fingerprint) { - FFAppState().checkBiometrics().then((value) => FFAppState().authenticateBiometric().then( (value) => safeSetState(() {_model.key = FFAppState().accessPass;}) )).catchError((error) => safeSetState((){_resetAnimationAndToggleAccess();})); - - } else { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -391,18 +399,26 @@ void dispose() { child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { + log('Key: $key'); + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; _model.key = key; - setState(() {}); + }); }, ), ), ); }, - ).then((value) => safeSetState(() {})); - }; - - - + ) + + .catchError((error) => safeSetState((){ + log('Error: $error'); + _resetAnimationAndToggleAccess(); + })); unawaited( () async { await _model.qrCodeEncoder( @@ -415,7 +431,7 @@ void dispose() { } void _resetAnimationAndToggleAccess() { - setState(() { + safeSetState(() { // Reinicia a animação animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); @@ -461,4 +477,4 @@ void dispose() { elevation: 0.0, ); } -} +} \ No newline at end of file diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 08de852d..96b3252e 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -55,4 +55,4 @@ class RegisterVisitorPageModel textFieldFocusNode4?.dispose(); textController4?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index fb885d1b..c495da52 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; @@ -66,7 +68,6 @@ class _RegisterVisitorPageWidgetState extends State { appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - forceMaterialTransparency: true, leading: FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, @@ -889,4 +890,4 @@ class _RegisterVisitorPageWidgetState extends State { ), ); } -} +} \ No newline at end of file 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 155fc82c..f5192ee5 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 @@ -1,11 +1,12 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'schedule_complete_visit_page_widget.dart' - show ScheduleCompleteVisitPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { 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 a01ffeb6..8b684610 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 @@ -1,26 +1,29 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/custom_functions.dart' as functions; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'schedule_complete_visit_page_model.dart'; -export 'schedule_complete_visit_page_model.dart'; + class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ @@ -492,7 +495,7 @@ Widget scheduleVisit( }, getDocs: (docsParam) async { _model.visitorStrList = - functions.strListToStr( + strListToStr( docsParam!.toList()); setState(() {}); }, @@ -613,39 +616,7 @@ Widget scheduleVisit( ), ), Row( - mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'qygj6ra5' /* Inicio da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -657,7 +628,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -782,7 +753,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -851,7 +822,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked1Time; if (datePicked1Date != null) { datePicked1Time = @@ -919,7 +890,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { @@ -970,37 +941,6 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ws3t66' /* Fim da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -1012,7 +952,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -1137,7 +1077,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -1206,7 +1146,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked2Time; if (datePicked2Date != null) { datePicked2Time = @@ -1274,7 +1214,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { @@ -1355,41 +1295,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '2f68zi9t' /* Motivo da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, @@ -1488,41 +1397,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'il4di4ln' /* Nível de Acesso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, @@ -2306,7 +2184,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2315,26 +2193,25 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2343,8 +2220,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2372,7 +2249,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2384,26 +2261,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 6166e387..8baf87a9 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -1,8 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_provisional_visit_page_widget.dart' - show ScheduleProvisionalVisitPageWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart'; class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { @@ -61,4 +62,4 @@ class ScheduleProvisionalVisitPageModel textFieldFocusNode3?.dispose(); textController3?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 1b5639a8..6200de1c 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,16 +1,22 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + + + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'schedule_provisional_visit_page_model.dart'; -export 'schedule_provisional_visit_page_model.dart'; + class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); @@ -862,4 +868,4 @@ class _ScheduleProvisionalVisitPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index e8b945bd..6cea2517 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -21,4 +21,4 @@ class SignInPageModel extends FlutterFlowModel { unfocusNode.dispose(); signInTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index da1727c7..23b13170 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -56,4 +56,4 @@ class _SignInPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index 938a3b46..349ee990 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -21,4 +21,4 @@ class SignUpPageModel extends FlutterFlowModel { unfocusNode.dispose(); signUpTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index 18c575ec..8d68605b 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -57,4 +57,4 @@ class _SignUpPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart index 522b0d2d..c8e9cc15 100644 --- a/lib/pages/test_page/test_page.dart +++ b/lib/pages/test_page/test_page.dart @@ -1,63 +1,63 @@ -import 'dart:developer'; +// import 'dart:developer'; -import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:flutter/material.dart'; +// import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +// import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; +// import 'package:flutter/material.dart'; -class TestPage extends StatelessWidget { - const TestPage({Key? key}) : super(key: key); +// class TestPage extends StatelessWidget { +// const TestPage({Key? key}) : super(key: key); - @override - Widget build(BuildContext context) { - // Exemplo de dados para os HashMaps - final Map labelsHashMap = { - 'Nome:': 'Gabriel da Silva', - 'Entrada:': '08:00 AM 01/01/2022', - 'Saída:': '17:00 PM 01/01/2022', - }; +// @override +// Widget build(BuildContext context) { +// // Exemplo de dados para os HashMaps +// final Map labelsHashMap = { +// 'Nome:': 'Gabriel da Silva', +// 'Entrada:': '08:00 AM 01/01/2022', +// 'Saída:': '17:00 PM 01/01/2022', +// }; - // Ajuste para o novo tipo esperado pelo componente - final Map statusHashMap = { - 'Ativo': FlutterFlowTheme.of(context).success, - }; +// // Ajuste para o novo tipo esperado pelo componente +// final Map statusHashMap = { +// 'Ativo': FlutterFlowTheme.of(context).success, +// }; - // função set statusHashMap que recebe um String status faz um switch case e retorna um Map - Map getStatusHashMap(String status) { - switch (status) { - case 'Ativo': - return {'Ativo': FlutterFlowTheme.of(context).success}; - case 'Inativo': - return {'Inativo': FlutterFlowTheme.of(context).error}; - default: - return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; - } - } +// // função set statusHashMap que recebe um String status faz um switch case e retorna um Map +// Map getStatusHashMap(String status) { +// switch (status) { +// case 'Ativo': +// return {'Ativo': FlutterFlowTheme.of(context).success}; +// case 'Inativo': +// return {'Inativo': FlutterFlowTheme.of(context).error}; +// default: +// return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; +// } +// } - // Ajuste para passar os valores corretos para a URL da imagem - final Map imageKeyValue = { - 'key': 'docID', - 'value': 'imageType', - }; +// // Ajuste para passar os valores corretos para a URL da imagem +// final Map imageKeyValue = { +// 'key': 'docID', +// 'value': 'imageType', +// }; - return Scaffold( - appBar: AppBar( - title: const Text('Test Page'), - ), - body: Center( - child: ListView.builder( - itemCount: 10, - itemBuilder: (context, index) { - return CardItemTemplateComponentWidget( - labelsHashMap: labelsHashMap, - statusHashMap: statusHashMap, - imageHashMap: imageKeyValue, - onTapCardItemAction: () async { - // Ação ao tocar no card - log('Card tapped'); - }, - ); - }), - ), - ); - } -} +// return Scaffold( +// appBar: AppBar( +// title: const Text('Test Page'), +// ), +// body: Center( +// child: ListView.builder( +// itemCount: 10, +// itemBuilder: (context, index) { +// return CardItemTemplateComponentWidget( +// labelsHashMap: labelsHashMap, +// statusHashMap: statusHashMap, +// imageHashMap: imageKeyValue, +// onTapCardItemAction: () async { +// // Ação ao tocar no card +// log('Card tapped'); +// }, +// ); +// }), +// ), +// ); +// } +// } diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart index 327fe168..c0c3bed8 100644 --- a/lib/pages/visit_history_page/visit_history_page_model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,10 +1,11 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; -import 'package:flutter/material.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'visit_history_page_widget.dart' show VisitHistoryPageWidget; + +import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; class VisitHistoryPageModel extends FlutterFlowModel { final _visitHistoryManager = FutureRequestManager(); @@ -104,4 +105,4 @@ class VisitHistoryPageModel extends FlutterFlowModel { return false; } -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index ad681eb1..52130219 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -1,19 +1,23 @@ import 'dart:developer'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:f_r_e_hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '../../backend/api_requests/api_calls.dart'; -import '../../components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '../../flutter_flow/flutter_flow_icon_button.dart'; -import '../../flutter_flow/flutter_flow_theme.dart'; -import '../../flutter_flow/flutter_flow_util.dart'; class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ @@ -327,10 +331,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -574,7 +578,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -583,26 +587,26 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -611,8 +615,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -640,7 +644,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -652,26 +656,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -751,4 +755,4 @@ Widget visitHistory( ), ), ); -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index b8a54a7e..4c08929e 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -25,4 +25,4 @@ class WelcomePageModel extends FlutterFlowModel { unfocusNode.dispose(); welcomeTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index 6089703a..5ec8a486 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -77,4 +77,4 @@ class _WelcomePageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 7c09b904..276cf9cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: f_r_e_hub +name: hub description: A new Flutter project. # The following line prevents the package from being accidentally published to @@ -133,6 +133,7 @@ flutter_launcher_icons: adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg' + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -148,6 +149,8 @@ flutter: assets: - assets/fonts/ - assets/images/ + - assets/images/dark/ + - assets/images/light/ - assets/videos/ - assets/audios/ - assets/lottie_animations/ @@ -195,4 +198,3 @@ flutter: # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages - diff --git a/test/widget_test.dart b/test/widget_test.dart index 9e847a93..76de18a9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,17 +1,17 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. +// // This is a basic Flutter widget test. +// // +// // To perform an interaction with a widget in your test, use the WidgetTester +// // utility that Flutter provides. For example, you can send tap and scroll +// // gestures. You can also use WidgetTester to find child widgets in the widget +// // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter_test/flutter_test.dart'; +// import 'package:flutter_test/flutter_test.dart'; -import 'package:f_r_e_hub/main.dart'; +// import 'package:f_r_e_hub/main.dart'; -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - }); -} +// void main() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(MyApp()); +// }); +// } From fc80d2542b3fe2e364c71816986bd3e6d28d569e Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:51:10 +0000 Subject: [PATCH 04/34] teste --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- lib/backend/api_requests/api_calls.dart | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 528c549d..54618e39 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409627A31CD000820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409B27A31CD100820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409F27A31CD300820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409F27A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409627A31CD000820AF7 /* pt */, - 6436409B27A31CD100820AF7 /* en */, + 6436409F27A31CD300820AF7 /* pt */, + 6436409F27A31CD500820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index e7852f78..8d97cc39 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -36,6 +36,7 @@ class PhpGroup { static GetAccessCall getAccessCall = GetAccessCall(); static GetLiberationsCall getLiberationsCall = GetLiberationsCall(); static GetMessagesCall getMessagesCall = GetMessagesCall(); + static TesteCall testeCall = TesteCall(); } class LoginCall { @@ -2167,6 +2168,26 @@ class GetMessagesCall { .toList(); } +class TesteCall { + Future call() async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'teste', + apiUrl: '${baseUrl}est', + callType: ApiCallType.GET, + headers: {}, + params: {}, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + } +} + /// End PHP Group Code class ApiPagingParams { From 54ee3ebda05b561f182b4d3a2a4e293f0877176b Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:22:13 +0000 Subject: [PATCH 05/34] o grande rollback --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- lib/backend/api_requests/api_calls.dart | 21 --------------------- lib/pages/home_page/home_page_widget.dart | 17 ----------------- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 54618e39..71e06db7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409F27A31CD300820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409F27A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409B27A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409F27A31CD300820AF7 /* pt */, - 6436409F27A31CD500820AF7 /* en */, + 6436409B27A31CDD00820AF7 /* pt */, + 6436409227A31CD500820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 8d97cc39..e7852f78 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -36,7 +36,6 @@ class PhpGroup { static GetAccessCall getAccessCall = GetAccessCall(); static GetLiberationsCall getLiberationsCall = GetLiberationsCall(); static GetMessagesCall getMessagesCall = GetMessagesCall(); - static TesteCall testeCall = TesteCall(); } class LoginCall { @@ -2168,26 +2167,6 @@ class GetMessagesCall { .toList(); } -class TesteCall { - Future call() async { - final baseUrl = PhpGroup.getBaseUrl(); - - return ApiManager.instance.makeApiCall( - callName: 'teste', - apiUrl: '${baseUrl}est', - callType: ApiCallType.GET, - headers: {}, - params: {}, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, - ); - } -} - /// End PHP Group Code class ApiPagingParams { diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index e28895db..292f13c8 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1047,23 +1047,6 @@ class _HomePageWidgetState extends State { width: 100.0, height: 50.0, decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - print('IconButton pressed ...'); - }, - ), - ), ), ), ], From a4a389854c38eebe1daae03f61e123d49cfbdad6 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Sat, 20 Jul 2024 02:11:30 +0000 Subject: [PATCH 06/34] Updating to latest FlutterFlow output. --- .../menu_staggered_view_component_widget.dart | 2 +- .../view_visit_detail_model.dart | 0 .../view_visit_detail_widget.dart | 0 lib/flutter_flow/internationalization.dart | 28 ++- lib/flutter_flow/nav/nav.dart | 16 +- lib/index.dart | 3 + .../preferences_page_model.dart | 27 +++ .../preferences_page_widget.dart | 167 ++++++++++++++++++ .../settings_page/settings_page_model.dart | 17 ++ .../settings_page/settings_page_widget.dart | 71 ++++++++ 10 files changed, 328 insertions(+), 3 deletions(-) rename lib/components/{ => templates_components}/view_visit_detail/view_visit_detail_model.dart (100%) rename lib/components/{ => templates_components}/view_visit_detail/view_visit_detail_widget.dart (100%) create mode 100644 lib/pages/preferences_page/preferences_page_model.dart create mode 100644 lib/pages/preferences_page/preferences_page_widget.dart create mode 100644 lib/pages/settings_page/settings_page_model.dart create mode 100644 lib/pages/settings_page/settings_page_widget.dart diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 35a411d6..7c6b2888 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -86,7 +86,7 @@ class _MenuStaggeredViewComponentWidgetState ), crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, - itemCount: 8, + itemCount: 9, padding: const EdgeInsets.fromLTRB( 0, 10.0, diff --git a/lib/components/view_visit_detail/view_visit_detail_model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart similarity index 100% rename from lib/components/view_visit_detail/view_visit_detail_model.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart similarity index 100% rename from lib/components/view_visit_detail/view_visit_detail_widget.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index ca4cb34f..af72217d 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -152,7 +152,7 @@ final kTranslationsMap = >>[ 'en': 'FREE ACCESS', }, 'mp6igsok': { - 'pt': 'Home', + 'pt': '', 'en': '', }, }, @@ -490,6 +490,28 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // preferencesPage + { + '1vyj6y7n': { + 'pt': 'Preferencias', + 'en': '', + }, + 'uv1iug83': { + 'pt': '', + 'en': '', + }, + }, + // settingsPage + { + 'bc698859': { + 'pt': 'Preferencias', + 'en': '', + }, + '8fgc7z33': { + 'pt': '', + 'en': '', + }, + }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -844,6 +866,10 @@ final kTranslationsMap = >>[ 'pt': 'Histórico\nde Liberação', 'en': 'Liberation\nHistory', }, + 'dzk31zpc': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, }, // messageWellComponent { diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 29785cdc..3c024d17 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -75,7 +75,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => const HomePageWidget(), + builder: (context, params) => params.isEmpty + ? const NavBarPage(initialPage: 'homePage') + : const HomePageWidget(), ), FFRoute( name: 'visitHistoryPage', @@ -185,6 +187,18 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget(), + ), + FFRoute( + name: 'preferencesPage', + path: '/preferencesPage', + builder: (context, params) => const PreferencesPageWidget(), + ), + FFRoute( + name: 'settingsPage', + path: '/settingsPage', + builder: (context, params) => params.isEmpty + ? const NavBarPage(initialPage: 'settingsPage') + : const SettingsPageWidget(), ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index 69f127d0..cfba6f3f 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -24,3 +24,6 @@ export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; +export '/pages/preferences_page/preferences_page_widget.dart' + show PreferencesPageWidget; +export '/pages/settings_page/settings_page_widget.dart' show SettingsPageWidget; diff --git a/lib/pages/preferences_page/preferences_page_model.dart b/lib/pages/preferences_page/preferences_page_model.dart new file mode 100644 index 00000000..dfe2b66b --- /dev/null +++ b/lib/pages/preferences_page/preferences_page_model.dart @@ -0,0 +1,27 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'preferences_page_widget.dart' show PreferencesPageWidget; +import 'package:flutter/material.dart'; + +class PreferencesPageModel extends FlutterFlowModel { + /// Local state fields for this page. + + bool fingerprint = false; + + bool? person; + + bool? changPass; + + bool? notify; + + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + unfocusNode.dispose(); + } +} diff --git a/lib/pages/preferences_page/preferences_page_widget.dart b/lib/pages/preferences_page/preferences_page_widget.dart new file mode 100644 index 00000000..917b4a2a --- /dev/null +++ b/lib/pages/preferences_page/preferences_page_widget.dart @@ -0,0 +1,167 @@ +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'preferences_page_model.dart'; +export 'preferences_page_model.dart'; + +class PreferencesPageWidget extends StatefulWidget { + const PreferencesPageWidget({super.key}); + + @override + State createState() => _PreferencesPageWidgetState(); +} + +class _PreferencesPageWidgetState extends State { + late PreferencesPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => PreferencesPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + title: Text( + FFLocalizations.of(context).getText( + '1vyj6y7n' /* Preferencias */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0), + child: GridView( + padding: const EdgeInsets.fromLTRB( + 0, + 20.0, + 0, + 20.0, + ), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + childAspectRatio: 1.0, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: [ + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: double.infinity, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.fingerprint, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.fingerprint + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.person, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.person! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.notifications_active, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.notify! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).alternate, + disabledIconColor: FlutterFlowTheme.of(context).primary, + icon: Icon( + Icons.password_sharp, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 40.0, + ), + onPressed: _model.changPass! + ? null + : () { + print('IconButton pressed ...'); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/settings_page/settings_page_model.dart b/lib/pages/settings_page/settings_page_model.dart new file mode 100644 index 00000000..1fa111cc --- /dev/null +++ b/lib/pages/settings_page/settings_page_model.dart @@ -0,0 +1,17 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'settings_page_widget.dart' show SettingsPageWidget; +import 'package:flutter/material.dart'; + +class SettingsPageModel extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + unfocusNode.dispose(); + } +} diff --git a/lib/pages/settings_page/settings_page_widget.dart b/lib/pages/settings_page/settings_page_widget.dart new file mode 100644 index 00000000..11227b96 --- /dev/null +++ b/lib/pages/settings_page/settings_page_widget.dart @@ -0,0 +1,71 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'settings_page_model.dart'; +export 'settings_page_model.dart'; + +class SettingsPageWidget extends StatefulWidget { + const SettingsPageWidget({super.key}); + + @override + State createState() => _SettingsPageWidgetState(); +} + +class _SettingsPageWidgetState extends State { + late SettingsPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => SettingsPageModel()); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primary, + automaticallyImplyLeading: false, + title: Text( + FFLocalizations.of(context).getText( + 'bc698859' /* Preferencias */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: const SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [], + ), + ), + ), + ); + } +} From a097bd30e51265d5c3cc1bf9c00ae4a3c4c0db6f Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 25 Jul 2024 15:04:38 +0000 Subject: [PATCH 07/34] fix: Form de Login do APP --- ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Podfile | 2 +- ios/Runner.xcodeproj/project.pbxproj | 6 +- .../sign_in_template_component_model.dart | 4 +- .../sign_in_template_component_widget.dart | 62 ++++++++++++++----- lib/flutter_flow/flutter_flow_util.dart | 11 +++- lib/flutter_flow/internationalization.dart | 26 +++----- 7 files changed, 71 insertions(+), 42 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index ff0dcf11..748aee74 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 14.0 + 14.0.0 diff --git a/ios/Podfile b/ios/Podfile index a43aebd4..8f4bfd94 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '14.0' +platform :ios, '14.0.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9ace6cd2..cc3d86e0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -363,7 +363,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -458,7 +458,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -507,7 +507,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; 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 5c89397f..fd542965 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 @@ -21,7 +21,9 @@ class SignInTemplateComponentModel } if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; + return FFLocalizations.of(context).getText( + 's3j1hjqx' /* E-mail Inv */, + ); } return null; } 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 59612d43..ae8cc9df 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 @@ -4,6 +4,7 @@ import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; @@ -219,7 +220,16 @@ class _SignInTemplateComponentWidgetState .emailAddressTextController, focusNode: _model .emailAddressFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], textCapitalization: TextCapitalization.none, textInputAction: @@ -351,7 +361,16 @@ class _SignInTemplateComponentWidgetState .passwordTextController, focusNode: _model.passwordFocusNode, - autofocus: false, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.password + ], textInputAction: TextInputAction.send, obscureText: !_model @@ -499,19 +518,26 @@ class _SignInTemplateComponentWidgetState .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, + onPressed: ((_model.emailAddressTextController + .text == + '') && + (_model.passwordTextController + .text == + '')) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, text: FFLocalizations.of( context) .getText( @@ -568,6 +594,12 @@ class _SignInTemplateComponentWidgetState borderRadius: BorderRadius.circular( 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), showLoadingIndicator: false, ), diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index ba7e763b..e66e26b7 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -395,8 +395,15 @@ extension FFTextEditingControllerExt on TextEditingController? { } extension IterableExt on Iterable { - List sortedList([S Function(T)? keyOf]) => toList() - ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + List sortedList( + {S Function(T)? keyOf, bool desc = false}) { + final sortedAscending = toList() + ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + if (desc) { + return sortedAscending.reversed.toList(); + } + return sortedAscending; + } List mapIndexed(S Function(int, T) func) => toList() .asMap() diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index af72217d..9123791e 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -241,10 +241,6 @@ final kTranslationsMap = >>[ 'pt': 'Qual o período de validade da visita?', 'en': 'Visit Validity Period', }, - 'qygj6ra5': { - 'pt': 'Inicio da Visita', - 'en': 'Start of Visit', - }, 'bv2edxku': { 'pt': '', 'en': 'End of Visit', @@ -253,10 +249,6 @@ final kTranslationsMap = >>[ 'pt': 'Quando você inicia a visita?', 'en': 'When do you start the visit?', }, - 'p4ws3t66': { - 'pt': 'Fim da Visita', - 'en': 'End of Visit', - }, 'yw6d2jj8': { 'pt': '', 'en': 'End of Visit', @@ -269,10 +261,6 @@ final kTranslationsMap = >>[ 'pt': 'Quais são os motivos da visita?', 'en': 'What are the reasons for the visit?', }, - '2f68zi9t': { - 'pt': 'Motivo da Visita', - 'en': 'End of Visit', - }, '6p3e0bzr': { 'pt': 'Escolha um motivo aqui', 'en': 'Choose a reason here', @@ -281,10 +269,6 @@ final kTranslationsMap = >>[ 'pt': 'Search for an item...', 'en': '', }, - 'il4di4ln': { - 'pt': 'Nível de Acesso', - 'en': 'End of Visit', - }, '2wun8p6c': { 'pt': 'Escolha um nível de acesso aqui', 'en': 'Choose an access level here', @@ -496,7 +480,7 @@ final kTranslationsMap = >>[ 'pt': 'Preferencias', 'en': '', }, - 'uv1iug83': { + 'sejj3t8w': { 'pt': '', 'en': '', }, @@ -507,7 +491,7 @@ final kTranslationsMap = >>[ 'pt': 'Preferencias', 'en': '', }, - '8fgc7z33': { + 'sejj3t8w': { 'pt': '', 'en': '', }, @@ -900,6 +884,10 @@ final kTranslationsMap = >>[ 'pt': 'Campo é necessário', 'en': 'Field is required', }, + 's3j1hjqx': { + 'pt': 'E-mail Inv', + 'en': '', + }, '2ib9bf67': { 'pt': 'Please choose an option from the dropdown', 'en': '', @@ -934,7 +922,7 @@ final kTranslationsMap = >>[ }, 'p5c6d54y': { 'pt': ' Recupere aqui', - 'en': 'recover here', + 'en': ' recover here', }, 'olf967cj': { 'pt': 'Termo de Uso', From c8e043eccc494e018ec3b1dc0ebe37c3d1c3ff4c Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:51:10 +0000 Subject: [PATCH 08/34] teste --- lib/backend/api_requests/api_calls.dart | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 2a8838ec..29312482 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -2389,6 +2389,26 @@ class GetLiberationsCopyCall { .toList(); } +class TesteCall { + Future call() async { + final baseUrl = PhpGroup.getBaseUrl(); + + return ApiManager.instance.makeApiCall( + callName: 'teste', + apiUrl: '${baseUrl}est', + callType: ApiCallType.GET, + headers: {}, + params: {}, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); + } +} + /// End PHP Group Code class ApiPagingParams { From de8735385528cc56ee964fa90b05308195109087 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:22:13 +0000 Subject: [PATCH 09/34] o grande rollback --- lib/backend/api_requests/api_calls.dart | 20 - lib/pages/home_page/home_page_widget.dart | 1046 +++++++++++++++++---- 2 files changed, 881 insertions(+), 185 deletions(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 29312482..2a8838ec 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -2389,26 +2389,6 @@ class GetLiberationsCopyCall { .toList(); } -class TesteCall { - Future call() async { - final baseUrl = PhpGroup.getBaseUrl(); - - return ApiManager.instance.makeApiCall( - callName: 'teste', - apiUrl: '${baseUrl}est', - callType: ApiCallType.GET, - headers: {}, - params: {}, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, - ); - } -} - /// End PHP Group Code class ApiPagingParams { diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index c81132ab..b89dc5a1 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -481,192 +481,908 @@ class _HomePageWidgetState extends State { .divide(const SizedBox(width: 0.0)) .around(const SizedBox(width: 0.0)), ), - ), - ].addToStart(const SizedBox(height: 30.0)), + ].addToStart(const SizedBox(height: 30.0)), + ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + 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), + ), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), + .customColor1, + width: 0.5, ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, + .bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .labelMediumFamily), + .bodyMediumFamily), ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), + validator: _model.textControllerValidator + .asValidator(context), ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textControllerValidator - .asValidator(context), ), ), - ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), ), - ), - Flexible( - child: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - options: [ - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', + Flexible( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 20.0, 10.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kfast, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'dlaeicxd' /* Auto-Visita */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.khome, + color: + FlutterFlowTheme.of(context) + .primary, + size: 24.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + '53jd930v' /* Condominio */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kpets, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'ptsx0rln' /* Cadastrar Pet */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kvector1, + color: + FlutterFlowTheme.of(context) + .primary, + size: 22.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'rgxgw626' /* Cadastrar Visitante */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kvector2, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'j2tn9lpw' /* QR Code de Acesso */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kvector3, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + '9weuwgs1' /* Histórico de Acesso */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.0), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 40.0, + height: 40.0, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Icon( + FFIcons.kvector1, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'vuk5bjau' /* Agendar Visita */, + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ), + Icon( + Icons.chevron_right_rounded, + color: FlutterFlowTheme.of(context) + .customColor1, + size: 24.0, + ), + ], + ), + ), + ), + ), + Divider( + thickness: 0.1, + color: + FlutterFlowTheme.of(context).customColor1, + ), + ], ), - icon: Icons.person_add_alt_1_outlined, - ), - MenuButtonWidget( - action: () => scheduleVisitOptAction(context), - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitors', - ptText: 'Registrar Visitantes', - ), - icon: Icons.person_add_alt_1_outlined, - ), + ], + ), + ), + ), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); - ], - expandable: false, - style: MenuView.list, - item: MenuItem.card, + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, ), - ), + borderRadius: BorderRadius.circular(50.0), ), ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, - ), - borderRadius: BorderRadius.circular(50.0), - ), - ), - ].addToEnd(const SizedBox(height: 64.0)), + ].addToEnd(const SizedBox(height: 64.0)), + ), ), ), ), - ); + body: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: + FlutterFlowTheme.of(context) + .primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState! + .openDrawer(); + }, + ), + ), + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, + ), + ), + ), + ), + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme + .of(context) + .info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: + FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + wrapWithModel( + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: const LocalProfileComponentWidget(), + ), + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget(), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ), + ), + ); } } From 5f84d796294497acb6c5eca2d905ec258875e23c Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Fri, 26 Jul 2024 11:24:14 -0300 Subject: [PATCH 10/34] fix: Fix Files --- .../menu_staggered_view_component_widget.dart | 2 +- lib/flutter_flow/nav/nav.dart | 1 + lib/index.dart | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 7c6b2888..35a411d6 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -86,7 +86,7 @@ class _MenuStaggeredViewComponentWidgetState ), crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, - itemCount: 9, + itemCount: 8, padding: const EdgeInsets.fromLTRB( 0, 10.0, diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 3c024d17..78e2a9da 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -7,6 +7,7 @@ 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:provider/provider.dart'; +import '../../main.dart'; import '/backend/schema/structs/index.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/index.dart'; diff --git a/lib/index.dart b/lib/index.dart index cfba6f3f..a312d3c1 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -24,6 +24,5 @@ export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; -export '/pages/preferences_page/preferences_page_widget.dart' - show PreferencesPageWidget; +export '/pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget; export '/pages/settings_page/settings_page_widget.dart' show SettingsPageWidget; From aea9b851c0173f54146f7f2a19ac5ea1dfde0ba5 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 26 Jul 2024 14:41:21 -0300 Subject: [PATCH 11/34] fix menu --- .../menu_button_item_widget.dart | 3 + .../menu_card_item/menu_card_item.dart | 110 ++ .../menu_item/menu_item.dart | 7 + .../menu_component/menu_component_widget.dart | 165 +-- .../menu_list_view_component_widget.dart | 63 +- .../menu_staggered_view_component_widget.dart | 960 +------------ ...etails_modal_template_component_model.dart | 2 +- .../view_visit_detail_widget.dart | 959 +++++++++++++ lib/flutter_flow/nav/nav.dart | 16 +- lib/index.dart | 1 - lib/pages/home_page/home_page_widget.dart | 1227 +++++------------ .../preferences_page_model.dart | 27 - .../preferences_page_widget.dart | 167 --- .../settings_page/settings_page_model.dart | 17 - .../settings_page/settings_page_widget.dart | 71 - .../visit_history_page_widget.dart | 1 - 16 files changed, 1531 insertions(+), 2265 deletions(-) create mode 100644 lib/components/atomic_components/menu_card_item/menu_card_item.dart create mode 100644 lib/components/view_visit_detail/view_visit_detail_widget.dart delete mode 100644 lib/pages/preferences_page/preferences_page_model.dart delete mode 100644 lib/pages/preferences_page/preferences_page_widget.dart delete mode 100644 lib/pages/settings_page/settings_page_model.dart delete mode 100644 lib/pages/settings_page/settings_page_widget.dart 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 b0ee89d4..fd0df4ca 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 @@ -21,9 +21,12 @@ class MenuButtonWidget extends MenuEntry { @override _MenuButtonWidgetState createState() => _MenuButtonWidgetState(); + } class _MenuButtonWidgetState extends State { + get action => action; + @override Widget build(BuildContext context) { return InkWell( 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 new file mode 100644 index 00000000..ac553c46 --- /dev/null +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -0,0 +1,110 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + + + +class MenuCardItem extends MenuEntry { + const MenuCardItem({ + Key? key, + this.action, + this.title, + this.icon, + }) : super(key: key); + + final Function()? action; + final String? title; + final IconData? icon; + + @override + _MenuCardItemState createState() => _MenuCardItemState(); + +} + +class _MenuCardItemState extends State { + get action => action; + + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.action?.call(); + }, + child: Card( + elevation: 0, + color: FlutterFlowTheme.of(context).primaryBackground, + child: Padding( + padding: const EdgeInsets.all(4.0), + child: + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(8.0, 0.0, 10.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + widget.icon, + fill: null, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Text( + widget.title ?? '', + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart index 1d2926b5..042a9353 100644 --- a/lib/components/molecular_components/menu_item/menu_item.dart +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -5,8 +5,15 @@ import 'package:flutter/material.dart'; abstract class MenuEntry extends StatefulWidget { const MenuEntry({ Key? key, + this.action, + this.title, + this.icon, }) : super(key: key); + final Function()? action; + final String? title; + final IconData? icon; + } \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index 6803c748..bbe0830f 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -1,6 +1,8 @@ import 'dart:developer'; import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; @@ -18,13 +20,10 @@ class MenuComponentWidget extends StatefulWidget { required this.style, required this.item, required this.expandable, - required this.options, }); final MenuView style; final MenuItem item; final bool expandable; - final List options; - @override State createState() => _MenuComponentWidgetState(); } @@ -32,8 +31,11 @@ class MenuComponentWidget extends StatefulWidget { class _MenuComponentWidgetState extends State { late MenuComponentModel _model; + + @override void setState(VoidCallback callback) { + super.setState(callback); _model.onUpdate(); } @@ -42,6 +44,7 @@ class _MenuComponentWidgetState extends State { void initState() { super.initState(); _model = createModel(context, () => MenuComponentModel()); + } @override @@ -53,7 +56,39 @@ class _MenuComponentWidgetState extends State { @override Widget build(BuildContext context) { - log('MenuComponentWidget: ${widget.options.toList().toString()}'); + final options = widget.item == MenuItem.button + ? [ + MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar/Visita' ,),), + + MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro de Visitante' ,),), + + // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), + // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'' ,),), + + MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'' ,),), + ] : [ + MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar/Visita' ,),), + + MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),), + + // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), + // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), + + MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'' ,),), + + MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'' ,),), + + MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'' ,),), + + MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'' ,),), + + ]; return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Builder( @@ -65,44 +100,13 @@ class _MenuComponentWidgetState extends State { updateCallback: () => setState(() {}), updateOnChange: true, child: MenuListViewComponentWidget( - options: widget.options, + options: options, expandable: widget.expandable, item: widget.item, - - changeMenuStyle: () async { await _model.changeMenuStyle(context); setState(() {}); }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - ), ); } else { @@ -111,85 +115,32 @@ class _MenuComponentWidgetState extends State { updateCallback: () => setState(() {}), updateOnChange: true, child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { await _model.changeMenuStyle(context); setState(() {}); }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, ), ); } } if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - expandable: widget.expandable, - item: widget.item, - options: widget.options, - messageHistoryAction: () async { - await _model.messageHistoryAction(context); - setState(() {}); - }, - - - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - - - ), - ); + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); } return const SizedBox(); }, diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index d9418237..1a2cac35 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -17,16 +17,10 @@ class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, required this.changeMenuStyle, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, + required this.expandable, required this.item, required this.options, - required this.messageHistoryAction, }); final bool expandable; @@ -34,13 +28,6 @@ class MenuListViewComponentWidget extends StatefulWidget { final List options; final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - final Future Function()? messageHistoryAction; @override State createState() => @@ -97,37 +84,43 @@ class _MenuListViewComponentWidgetState width: double.infinity, child: ListView.builder( addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, + padding: const EdgeInsets.symmetric(horizontal: 15), shrinkWrap: true, physics: const AlwaysScrollableScrollPhysics(), scrollDirection: Axis.horizontal, - itemCount: widget.options.length, itemBuilder: (context, index) { - return SizedBox( - height: 115, - width: 115, - child: widget.options[index]); + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); }, ), ); case MenuItem.card: - return ListView.builder( - addAutomaticKeepAlives: true, - padding: EdgeInsets.zero, - shrinkWrap: true, - physics: const AlwaysScrollableScrollPhysics(), - itemCount: widget.options.length, - itemBuilder: (context, index) { - return MenuButtonWidget( - action: widget.registerVisitorOptAction, - title: FFLocalizations.of(context).getVariableText( - enText: 'Register Visitor', - ptText: 'Registrar Visitante', + return SizedBox( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.8, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: const EdgeInsets.symmetric(horizontal: 15), + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + itemCount: widget.options.length, + itemBuilder: (context, index) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: SizedBox( + height: 115, + width: 115, + child: widget.options[index]), + ); + }, ), - icon: Icons.person_add_alt_1_outlined, - ); - }, ); } } diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 35a411d6..0b4f3c6b 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -3,6 +3,8 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; import 'package:hub/flutter_flow/custom_icons.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; @@ -15,22 +17,17 @@ import 'package:hub/flutter_flow/internationalization.dart'; class MenuStaggeredViewComponentWidget extends StatefulWidget { const MenuStaggeredViewComponentWidget({ super.key, - required this.changeMenuStyleAction, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.preferencesSettings, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, + required this.changeMenuStyle, + required this.expandable, + required this.item, + required this.options, }); - final Future Function()? changeMenuStyleAction; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? preferencesSettings; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; + final bool expandable; + final MenuItem item; + + final List options; + final Future Function()? changeMenuStyle; @override State createState() => @@ -86,7 +83,7 @@ class _MenuStaggeredViewComponentWidgetState ), crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, - itemCount: 8, + itemCount: widget.options.length, padding: const EdgeInsets.fromLTRB( 0, 10.0, @@ -95,933 +92,10 @@ class _MenuStaggeredViewComponentWidgetState ), shrinkWrap: true, itemBuilder: (context, index) { - return [ - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ee33l0ms' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ya37l3jt' /* Cadastrar - Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'h8s3adu8' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'j6tfixen' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9tli4i2x' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'i22hecs8' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Consult\nHistories', - ptText: 'Consultar\nHistóricos', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getVariableText( - enText: 'Preferences\nSettings', - ptText: 'Preferências\ndo Sistema', - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - - ][index](); + return SizedBox( + height: 100, + width: 100, + child: widget.options[index]); }, ), ), @@ -1069,7 +143,7 @@ Propriedade */ color: FlutterFlowTheme.of(context).primary, ), onPressed: () async { - await widget.changeMenuStyleAction?.call(); + await widget.changeMenuStyle?.call(); }, ), ), diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index 8da449ab..9ec1e19d 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,8 +1,8 @@ import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import 'package:hub/components/view_visit_detail/view_visit_detail_model.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:flutter/material.dart'; diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/view_visit_detail/view_visit_detail_widget.dart new file mode 100644 index 00000000..91cb0f7c --- /dev/null +++ b/lib/components/view_visit_detail/view_visit_detail_widget.dart @@ -0,0 +1,959 @@ +import 'dart:developer'; + +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:share_plus/share_plus.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; + + + +class ViewVisitDetailWidget extends StatefulWidget { + const ViewVisitDetailWidget({ + super.key, + this.visitorImgPath, + required this.visitStartDate, + required this.visitEndDate, + required this.visitReasonStr, + required this.visitLevelStr, + required this.visitTempStr, + required this.visitObsStr, + required this.visitStatusStr, + required this.visitorStrList, + this.visitorJsonList, + required this.visitIdStr, + required this.visitStatusColor, + }); + + final String? visitorImgPath; + final String? visitStartDate; + final String? visitEndDate; + final String? visitReasonStr; + final String? visitLevelStr; + final String? visitTempStr; + final String? visitObsStr; + final String? visitStatusStr; + final String? visitorStrList; + final List? visitorJsonList; + final String? visitIdStr; + final Color? visitStatusColor; + + @override + State createState() => _ViewVisitDetailWidgetState(); +} + +List? findVisitorById(List? jsonList, String? id) { + if (jsonList == null || id == null) return null; + try { + var foundItem = jsonList.firstWhere( + (item) => item["VAW_ID"] == id, + orElse: () => null, + ); + return foundItem != null ? [foundItem] : null; + } catch (e) { + log("Error searching item: $e"); + return null; + } +} + +class _ViewVisitDetailWidgetState extends State { + late ViewVisitDetailModel _model; + bool isLoading = true; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => ViewVisitDetailModel()); + + // On component load action. + // SchedulerBinding.instance.addPostFrameCallback((_) async { + // if (widget.visitStatusStr != null) { + // _model.visitStatusColor = await action_blocks.manageStatusColorAction( + // context, + // visitStatusStr: widget.visitStatusStr!, + // ); + // } + // }); + + _model.textController1 = TextEditingController( + text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? ''); + _model.textFieldFocusNode1 ??= FocusNode(); + + _model.textController2 ??= + TextEditingController(text: widget.visitStartDate); + _model.textFieldFocusNode2 ??= FocusNode(); + + _model.textController3 ??= + TextEditingController(text: widget.visitEndDate); + _model.textFieldFocusNode3 ??= FocusNode(); + + _model.textController4 ??= + TextEditingController(text: widget.visitReasonStr); + _model.textFieldFocusNode4 ??= FocusNode(); + + _model.textController5 ??= + TextEditingController(text: widget.visitLevelStr); + _model.textFieldFocusNode5 ??= FocusNode(); + + _model.textController6 ??= TextEditingController(text: widget.visitObsStr); + _model.textFieldFocusNode6 ??= FocusNode(); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + var filteredVisitorJsonList = + findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null'; + + context.watch(); + + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Container( + width: double.infinity, + height: 35.0, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Align( + alignment: const AlignmentDirectional(1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 15.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + ), + ), + ), + Container( + decoration: const BoxDecoration( + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 20.0, 20.0), + child: Container( + width: 100.0, + decoration: const BoxDecoration(), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100.0), + ), + child: Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: + const VisitorDetailsModalTemplateComponentWidget(), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + widget.visitorImgPath, + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), + ), + ), + ), + ), + ), + ), + ), + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 10.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + '9yu35pzg' /* Encerramento da Visita */, + ), + 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), + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController1Validator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'aj6scczp' /* Início */, + ), + 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), + ), + hintText: FFLocalizations.of(context).getText( + 'ub084nhy' /* dd/mm/yyyy */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'rvi5z7wg' /* Término */, + ), + 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), + ), + hintText: FFLocalizations.of(context).getText( + 'ixs67mrz' /* dd/mm/yyyy */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'yxilg7ek' /* Motivo da Visita */, + ), + 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), + ), + hintText: FFLocalizations.of(context).getText( + 'ypeydbem' /* Motivo */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'dgr3pk3a' /* Nível de Acesso */, + ), + 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), + ), + hintText: FFLocalizations.of(context).getText( + 'rs3d4gb8' /* Nível de Acesso */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController5Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Container( + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController6, + focusNode: _model.textFieldFocusNode6, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'lppn9rxa' /* Observações da Visita */, + ), + 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), + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController6Validator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: 35.0, + decoration: BoxDecoration( + color: widget.visitStatusColor, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + child: Builder( + builder: (context) { + if (widget.visitStatusStr == 'A') { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.block_sharp, + color: FlutterFlowTheme.of(context) + .primaryBackground, + size: 24.0, + ), + onPressed: () async { + _model.deleteVisit = + await PhpGroup.deleteVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'cancelaVisita', + idVisita: widget.visitIdStr, + ); + + if (PhpGroup.deleteVisitCall.error( + (_model.deleteVisit?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.deleteVisitCall.msg( + (_model.deleteVisit?.jsonBody ?? + ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + ), + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.share, + color: FlutterFlowTheme.of(context) + .primaryBackground, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + // Implement share functionality here + Share.share( + 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', + ); + + }, + ), + ], + ); + } else if ((widget.visitStatusStr == 'C') || + (widget.visitStatusStr == 'F') || + (widget.visitStatusStr == 'B') || + (widget.visitStatusStr == 'I')) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + + context.pushNamed( + 'scheduleCompleteVisitPage', + queryParameters: { + 'visitStartDateStr': serializeParam( + dateTimeFormat( + 'd/M/y H:mm:ss', + getCurrentTimestamp, + locale: FFLocalizations.of(context) + .languageCode, + ), + ParamType.String, + ), + 'visitEndDateStr': serializeParam( + '', + ParamType.String, + ), + 'visitReasonStr': serializeParam( + widget.visitReasonStr, + ParamType.String, + ), + 'visitLevelStr': serializeParam( + widget.visitLevelStr, + ParamType.String, + ), + 'visitTempBol': serializeParam( + widget.visitTempStr == 'Sim' ? true : false, + ParamType.bool, + ), + 'visitObsStr': serializeParam( + widget.visitObsStr, + ParamType.String, + ), + 'visitorStrList': serializeParam( + widget.visitorStrList, + ParamType.String, + ), + 'visitorJsonList': serializeParam( + filteredVisitorJsonList, + ParamType.JSON, + isList: true, + ), + }.withoutNulls, + ); + }, + child: Icon( + Icons.repeat, + color: FlutterFlowTheme.of(context).secondaryText, + size: 24.0, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + ); + } + }, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 78e2a9da..86f9ca21 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -77,7 +77,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'homePage', path: '/homePage', builder: (context, params) => params.isEmpty - ? const NavBarPage(initialPage: 'homePage') + ? const HomePageWidget() : const HomePageWidget(), ), FFRoute( @@ -194,13 +194,13 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( path: '/preferencesPage', builder: (context, params) => const PreferencesPageWidget(), ), - FFRoute( - name: 'settingsPage', - path: '/settingsPage', - builder: (context, params) => params.isEmpty - ? const NavBarPage(initialPage: 'settingsPage') - : const SettingsPageWidget(), - ) + // FFRoute( + // name: 'settingsPage', + // path: '/settingsPage', + // builder: (context, params) => params.isEmpty + // ? const NavBarPage(initialPage: 'settingsPage') + // : const SettingsPageWidget(), + // ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index a312d3c1..0e675d5a 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -25,4 +25,3 @@ export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; export '/pages/preferences_settings_page/preferences_settings_widget.dart' show PreferencesPageWidget; -export '/pages/settings_page/settings_page_widget.dart' show SettingsPageWidget; diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index b89dc5a1..d9185a2c 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -166,9 +166,6 @@ class _HomePageWidgetState extends State { model: _model.menuComponentModel, updateCallback: () => setState(() {}), child: MenuComponentWidget( - options: [ - - ], expandable: true, style: MenuView.list_grid, item: MenuItem.button, @@ -481,908 +478,364 @@ class _HomePageWidgetState extends State { .divide(const SizedBox(width: 0.0)) .around(const SizedBox(width: 0.0)), ), + ), ].addToStart(const SizedBox(height: 30.0)), ), ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - 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), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily), ), - validator: _model.textControllerValidator - .asValidator(context), - ), - ), - ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Flexible( - child: Container( - width: double.infinity, - height: double.infinity, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kfast, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'dlaeicxd' /* Auto-Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .customColor1, + width: 0.5, ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .primary, - size: 24.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '53jd930v' /* Condominio */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'ptsx0rln' /* Cadastrar Pet */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 22.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rgxgw626' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'j2tn9lpw' /* QR Code de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector3, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '9weuwgs1' /* Histórico de Acesso */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 40.0, - height: 40.0, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'vuk5bjau' /* Agendar Visita */, - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ), - Icon( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - ], - ), - ], - ), - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), + borderRadius: BorderRadius.circular(2.0), ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), + ), + ), ), - borderRadius: BorderRadius.circular(50.0), - ), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), ), + ), + Expanded( + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.card, + ), + ), + ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), ), ), ), - ), - body: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - print('IconButton pressed ...'); - }, - ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: const LocalProfileComponentWidget(), - ), - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget(), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ], - ), - ], - ), - ], - ), - ), - ), - ), - ); + ); + + // body: Container( + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryBackground, + // ), + // child: SingleChildScrollView( + // child: Column( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // child: Container( + // width: 100.0, + // height: 100.0, + // decoration: const BoxDecoration( + // color: Color(0xFF1AAB5F), + // ), + // child: Row( + // mainAxisSize: MainAxisSize.min, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 10.0, 0.0, 0.0, 0.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: + // FlutterFlowTheme.of(context) + // .primary, + // icon: const Icon( + // Icons.menu_rounded, + // color: Colors.white, + // size: 28.0, + // ), + // onPressed: () async { + // scaffoldKey.currentState! + // .openDrawer(); + // }, + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(-1.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 60.0, 15.0, 0.0, 0.0), + // child: ClipRRect( + // borderRadius: + // BorderRadius.circular(8.0), + // child: Image.network( + // 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + // width: 50.0, + // height: 200.0, + // fit: BoxFit.none, + // ), + // ), + // ), + // ), + // Align( + // alignment: + // const AlignmentDirectional(0.0, 0.0), + // child: Padding( + // padding: const EdgeInsetsDirectional + // .fromSTEB( + // 0.0, 15.0, 0.0, 0.0), + // child: Text( + // FFLocalizations.of(context) + // .getText( + // 'rg9pzkpz' /* FRE ACCESS */, + // ), + // style: + // FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily, + // color: FlutterFlowTheme + // .of(context) + // .info, + // letterSpacing: 0.0, + // useGoogleFonts: GoogleFonts + // .asMap() + // .containsKey( + // FlutterFlowTheme.of( + // context) + // .bodyMediumFamily), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: 100.0, + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(1.0, 1.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // icon: Icon( + // Icons.notifications_sharp, + // color: + // FlutterFlowTheme.of(context).info, + // size: 24.0, + // ), + // onPressed: () { + // print('IconButton pressed ...'); + // }, + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // wrapWithModel( + // model: _model.localComponentModel, + // updateCallback: () => setState(() {}), + // child: const LocalProfileComponentWidget(), + // ), + // Wrap( + // spacing: 0.0, + // runSpacing: 0.0, + // alignment: WrapAlignment.start, + // crossAxisAlignment: WrapCrossAlignment.start, + // direction: Axis.horizontal, + // runAlignment: WrapAlignment.start, + // verticalDirection: VerticalDirection.down, + // clipBehavior: Clip.none, + // children: [ + // wrapWithModel( + // model: _model.menuComponentModel, + // updateCallback: () => setState(() {}), + // child: const MenuComponentWidget(), + // ), + // Align( + // alignment: const AlignmentDirectional(0.0, 0.0), + // child: wrapWithModel( + // model: _model.messageWellComponentModel, + // updateCallback: () => setState(() {}), + // child: const MessageWellComponentWidget(), + // ), + // ), + // ], + // ), + // ], + // ), + // ], + // ), + // ), + // ), + // ), + // ); + } } diff --git a/lib/pages/preferences_page/preferences_page_model.dart b/lib/pages/preferences_page/preferences_page_model.dart deleted file mode 100644 index dfe2b66b..00000000 --- a/lib/pages/preferences_page/preferences_page_model.dart +++ /dev/null @@ -1,27 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'preferences_page_widget.dart' show PreferencesPageWidget; -import 'package:flutter/material.dart'; - -class PreferencesPageModel extends FlutterFlowModel { - /// Local state fields for this page. - - bool fingerprint = false; - - bool? person; - - bool? changPass; - - bool? notify; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - } -} diff --git a/lib/pages/preferences_page/preferences_page_widget.dart b/lib/pages/preferences_page/preferences_page_widget.dart deleted file mode 100644 index 917b4a2a..00000000 --- a/lib/pages/preferences_page/preferences_page_widget.dart +++ /dev/null @@ -1,167 +0,0 @@ -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'preferences_page_model.dart'; -export 'preferences_page_model.dart'; - -class PreferencesPageWidget extends StatefulWidget { - const PreferencesPageWidget({super.key}); - - @override - State createState() => _PreferencesPageWidgetState(); -} - -class _PreferencesPageWidgetState extends State { - late PreferencesPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => PreferencesPageModel()); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - title: Text( - FFLocalizations.of(context).getText( - '1vyj6y7n' /* Preferencias */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0), - child: GridView( - padding: const EdgeInsets.fromLTRB( - 0, - 20.0, - 0, - 20.0, - ), - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - childAspectRatio: 1.0, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: [ - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: double.infinity, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.fingerprint, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.fingerprint - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.person! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.notifications_active, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.notify! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.password_sharp, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.changPass! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/pages/settings_page/settings_page_model.dart b/lib/pages/settings_page/settings_page_model.dart deleted file mode 100644 index 1fa111cc..00000000 --- a/lib/pages/settings_page/settings_page_model.dart +++ /dev/null @@ -1,17 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'settings_page_widget.dart' show SettingsPageWidget; -import 'package:flutter/material.dart'; - -class SettingsPageModel extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - } -} diff --git a/lib/pages/settings_page/settings_page_widget.dart b/lib/pages/settings_page/settings_page_widget.dart deleted file mode 100644 index 11227b96..00000000 --- a/lib/pages/settings_page/settings_page_widget.dart +++ /dev/null @@ -1,71 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'settings_page_model.dart'; -export 'settings_page_model.dart'; - -class SettingsPageWidget extends StatefulWidget { - const SettingsPageWidget({super.key}); - - @override - State createState() => _SettingsPageWidgetState(); -} - -class _SettingsPageWidgetState extends State { - late SettingsPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SettingsPageModel()); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primary, - automaticallyImplyLeading: false, - title: Text( - FFLocalizations.of(context).getText( - 'bc698859' /* Preferencias */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: const SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [], - ), - ), - ), - ); - } -} diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index 52130219..3e813f39 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -6,7 +6,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; From dadbaff7a00ff6e4d6ff07ab6299c8a6dbc9dade Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:14:10 +0000 Subject: [PATCH 12/34] update --- ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/actions/actions.dart | 2 +- .../local_profile_component_model.dart | 12 - .../local_profile_component_widget.dart | 151 - .../menu_component/menu_component_model.dart | 117 - .../menu_component/menu_component_widget.dart | 120 - .../menu_list_view_component_model.dart | 12 - .../menu_list_view_component_widget.dart | 1096 ------ .../menu_staggered_view_component_model.dart | 13 - .../menu_staggered_view_component_widget.dart | 1161 ------ .../message_well_component_model.dart | 12 - .../message_well_component_widget.dart | 125 - .../sign_in_template_component_model.dart | 61 - .../sign_in_template_component_widget.dart | 1026 ------ .../sign_up_template_component_model.dart | 91 - .../sign_up_template_component_widget.dart | 866 ----- .../welcome_template_component_model.dart | 13 - .../welcome_template_component_widget.dart | 445 --- lib/flutter_flow/internationalization.dart | 488 ++- lib/flutter_flow/nav/nav.dart | 17 +- lib/index.dart | 3 - lib/main.dart | 72 - ...cation_modal_template_component_model.dart | 0 ...ation_modal_template_component_widget.dart | 0 .../arrow_linked_locals_component_model.dart | 0 .../arrow_linked_locals_component_widget.dart | 0 ...m_arrow_linked_locals_component_model.dart | 0 ..._arrow_linked_locals_component_widget.dart | 0 .../card_item_template_component_model.dart | 0 .../card_item_template_component_widget.dart | 0 ...got_password_template_component_model.dart | 0 ...ot_password_template_component_widget.dart | 2 +- ...item_details_template_component_model.dart | 0 ...tem_details_template_component_widget.dart | 0 .../opt_modal/opt_modal_model.dart | 0 .../opt_modal/opt_modal_widget.dart | 0 .../option_selection_modal_model.dart | 0 .../option_selection_modal_widget.dart | 0 ...ode_pass_key_template_component_model.dart | 0 ...de_pass_key_template_component_widget.dart | 0 ...siter_vistor_template_component_model.dart | 0 ...iter_vistor_template_component_widget.dart | 2 +- .../schedule_visit_detail_model.dart | 0 .../schedule_visit_detail_widget.dart | 4 +- .../text_field_component_model.dart | 0 .../text_field_component_widget.dart | 0 .../throw_exception_model.dart | 0 .../throw_exception_widget.dart | 0 ...p_arrow_linked_locals_component_model.dart | 0 ..._arrow_linked_locals_component_widget.dart | 0 .../view_visit_detail_model.dart | 0 .../view_visit_detail_widget.dart | 4 +- ...etails_modal_template_component_model.dart | 4 +- ...tails_modal_template_component_widget.dart | 4 +- ...isit_request_template_component_model.dart | 0 ...sit_request_template_component_widget.dart | 0 ...etails_modal_template_component_model.dart | 0 ...tails_modal_template_component_widget.dart | 0 .../visitor_not_found_component_model.dart | 0 .../visitor_not_found_component_widget.dart | 2 +- ...search_modal_template_component_model.dart | 0 ...earch_modal_template_component_widget.dart | 4 +- .../acess_history_page_model.dart | 2 +- .../acess_history_page_widget.dart | 2 +- lib/pages/home_page/home_page_model.dart | 21 +- lib/pages/home_page/home_page_widget.dart | 3193 ++++++++++++++++- .../preferences_page_model.dart | 27 - .../preferences_page_widget.dart | 167 - .../qr_code_page/qr_code_page_widget.dart | 2 +- .../register_visitor_page_widget.dart | 2 +- .../schedule_complete_visit_page_widget.dart | 8 +- ...chedule_provisional_visit_page_widget.dart | 4 +- .../settings_page/settings_page_model.dart | 17 - .../settings_page/settings_page_widget.dart | 71 - .../sign_in_page/sign_in_page_model.dart | 49 +- .../sign_in_page/sign_in_page_widget.dart | 1094 +++++- .../sign_up_page/sign_up_page_model.dart | 79 +- .../sign_up_page/sign_up_page_widget.dart | 884 ++++- .../welcome_page/welcome_page_model.dart | 9 +- .../welcome_page/welcome_page_widget.dart | 435 ++- 80 files changed, 5924 insertions(+), 6079 deletions(-) delete mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_model.dart delete mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_widget.dart delete mode 100644 lib/components/organism_components/menu_component/menu_component_model.dart delete mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart delete mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart delete mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart delete mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart delete mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart delete mode 100644 lib/components/organism_components/message_well_component/message_well_component_model.dart delete mode 100644 lib/components/organism_components/message_well_component/message_well_component_widget.dart delete mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart delete mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart delete mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart delete mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart delete mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart delete mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart rename lib/{components/templates_components => modals}/access_notification_modal_template_component/access_notification_modal_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart (100%) rename lib/{components/organism_components => modals}/arrow_linked_locals_component/arrow_linked_locals_component_model.dart (100%) rename lib/{components/organism_components => modals}/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart (100%) rename lib/{components/organism_components => modals}/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart (100%) rename lib/{components/organism_components => modals}/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart (100%) rename lib/{components/templates_components => modals}/card_item_template_component/card_item_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/card_item_template_component/card_item_template_component_widget.dart (100%) rename lib/{components/templates_components => modals}/forgot_password_template_component/forgot_password_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/forgot_password_template_component/forgot_password_template_component_widget.dart (99%) rename lib/{components/templates_components => modals}/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart (100%) rename lib/{components/molecular_components => modals}/opt_modal/opt_modal_model.dart (100%) rename lib/{components/molecular_components => modals}/opt_modal/opt_modal_widget.dart (100%) rename lib/{components/molecular_components => modals}/option_selection_modal/option_selection_modal_model.dart (100%) rename lib/{components/molecular_components => modals}/option_selection_modal/option_selection_modal_widget.dart (100%) rename lib/{components/templates_components => modals}/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart (100%) rename lib/{components/templates_components => modals}/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart (99%) rename lib/{components/organism_components => modals}/schedule_visit_detail/schedule_visit_detail_model.dart (100%) rename lib/{components/organism_components => modals}/schedule_visit_detail/schedule_visit_detail_widget.dart (99%) rename lib/{components/atomic_components => modals}/text_field_component/text_field_component_model.dart (100%) rename lib/{components/atomic_components => modals}/text_field_component/text_field_component_widget.dart (100%) rename lib/{components/molecular_components => modals}/throw_exception/throw_exception_model.dart (100%) rename lib/{components/molecular_components => modals}/throw_exception/throw_exception_widget.dart (100%) rename lib/{components/organism_components => modals}/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart (100%) rename lib/{components/organism_components => modals}/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart (100%) rename lib/{components/templates_components => modals}/view_visit_detail/view_visit_detail_model.dart (100%) rename lib/{components/templates_components => modals}/view_visit_detail/view_visit_detail_widget.dart (99%) rename lib/{components/templates_components => modals}/visit_details_modal_template_component/visit_details_modal_template_component_model.dart (84%) rename lib/{components/templates_components => modals}/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart (95%) rename lib/{components/templates_components => modals}/visit_request_template_component/visit_request_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/visit_request_template_component/visit_request_template_component_widget.dart (100%) rename lib/{components/templates_components => modals}/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart (100%) rename lib/{components/molecular_components => modals}/visitor_not_found_component/visitor_not_found_component_model.dart (100%) rename lib/{components/molecular_components => modals}/visitor_not_found_component/visitor_not_found_component_widget.dart (98%) rename lib/{components/templates_components => modals}/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart (100%) rename lib/{components/templates_components => modals}/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart (99%) delete mode 100644 lib/pages/preferences_page/preferences_page_model.dart delete mode 100644 lib/pages/preferences_page/preferences_page_widget.dart delete mode 100644 lib/pages/settings_page/settings_page_model.dart delete mode 100644 lib/pages/settings_page/settings_page_widget.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 71e06db7..a5237d97 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409B27A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409227A31CD500820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409127A31CDF00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409E27A31CD200820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409B27A31CDD00820AF7 /* pt */, - 6436409227A31CD500820AF7 /* en */, + 6436409127A31CDF00820AF7 /* pt */, + 6436409E27A31CD200820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 30c1b6b9..31ae88e8 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,7 +1,7 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; import '/actions/actions.dart' as action_blocks; import '/custom_code/actions/index.dart' as actions; import '/flutter_flow/random_data_util.dart' as random_data; diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart deleted file mode 100644 index 25442482..00000000 --- a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; -import 'package:flutter/material.dart'; - -class LocalProfileComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart deleted file mode 100644 index 80e43f30..00000000 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ /dev/null @@ -1,151 +0,0 @@ -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/random_data_util.dart' as random_data; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'local_profile_component_model.dart'; -export 'local_profile_component_model.dart'; - -class LocalProfileComponentWidget extends StatefulWidget { - const LocalProfileComponentWidget({super.key}); - - @override - State createState() => - _LocalProfileComponentWidgetState(); -} - -class _LocalProfileComponentWidgetState - extends State { - late LocalProfileComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => LocalProfileComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Visibility( - visible: random_data.randomInteger(0, 10) != null, - child: Container( - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Material( - color: Colors.transparent, - elevation: 0.0, - child: Container( - width: double.infinity, - height: 119.0, - decoration: BoxDecoration( - color: const Color(0xFF1AAB5F), - border: Border.all( - color: const Color(0xFF1AAB5F), - ), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(2.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: const Color(0x00FFFFFF), - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: double.infinity, - child: - BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(200.0), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => - Image.asset( - 'assets/images/error_image.svg', - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - ), - ), - ), - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - valueOrDefault( - functions.convertToUppercase(FFAppState().local), - 'NOME DO LOCAL', - ), - style: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 20.0)) - .addToEnd(const SizedBox(width: 20.0)), - ), - ), - ), - ), - ), - ); - } -} diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart deleted file mode 100644 index d50f9dfe..00000000 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ /dev/null @@ -1,117 +0,0 @@ -import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; -import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_component_widget.dart' show MenuComponentWidget; -import 'package:flutter/material.dart'; - -class MenuComponentModel extends FlutterFlowModel { - /// Local state fields for this component. - - bool isGrid = false; - - /// State fields for stateful widgets in this component. - - // Model for menuListViewComponent. - late MenuListViewComponentModel menuListViewComponentModel; - // Model for menuStaggeredViewComponent. - late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel; - - @override - void initState(BuildContext context) { - menuListViewComponentModel = - createModel(context, () => MenuListViewComponentModel()); - menuStaggeredViewComponentModel = - createModel(context, () => MenuStaggeredViewComponentModel()); - } - - @override - void dispose() { - menuListViewComponentModel.dispose(); - menuStaggeredViewComponentModel.dispose(); - } - - /// Action blocks. - Future changeMenuStyle(BuildContext context) async { - isGrid = !isGrid; - } - - Future scheduleVisitOptAction(BuildContext context) async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const OptionSelectionModalWidget(), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, - ), - }, - ); - } - - Future acessHistoryOptAction(BuildContext context) async { - context.pushNamed( - 'acessHistoryPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future liberationHistoryOptAction(BuildContext context) async { - context.pushNamed( - 'liberationHistory', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } -} diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart deleted file mode 100644 index 79afe54b..00000000 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ /dev/null @@ -1,120 +0,0 @@ -import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'menu_component_model.dart'; -export 'menu_component_model.dart'; - -class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({super.key}); - - @override - State createState() => _MenuComponentWidgetState(); -} - -class _MenuComponentWidgetState extends State { - late MenuComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Builder( - builder: (context) { - if (_model.isGrid == true) { - return wrapWithModel( - model: _model.menuListViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuListViewComponentWidget( - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - acessHistoryOptAction: () async { - await _model.acessHistoryOptAction(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - accessHistoryOptAction: () async { - await _model.acessHistoryOptAction(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, - ), - ); - } - }, - ), - ); - } -} diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart deleted file mode 100644 index 7ce9985b..00000000 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; -import 'package:flutter/material.dart'; - -class MenuListViewComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart deleted file mode 100644 index 0f7b62aa..00000000 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ /dev/null @@ -1,1096 +0,0 @@ -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'menu_list_view_component_model.dart'; -export 'menu_list_view_component_model.dart'; - -class MenuListViewComponentWidget extends StatefulWidget { - const MenuListViewComponentWidget({ - super.key, - required this.changeMenuStyle, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.acessHistoryOptAction, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, - }); - - final Future Function()? changeMenuStyle; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? acessHistoryOptAction; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - - @override - State createState() => - _MenuListViewComponentWidgetState(); -} - -class _MenuListViewComponentWidgetState - extends State { - late MenuListViewComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuListViewComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), - child: Container( - width: double.infinity, - height: 125.0, - decoration: const BoxDecoration(), - child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), - scrollDirection: Axis.horizontal, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'utgue9a5' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '82b5f8yz' /* Cadastrar -Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.khome, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 't4ie13ut' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'n3n76pha' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'l6b9o7yn' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.people, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rxnrtdau' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.acessHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'nxssjz3q' /* Consultar -Históricos */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.acessHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '589qufkw' /* Histórico -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '944g4ib1' /* Histórico -de Liberação */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ), - ].divide(const SizedBox(width: 15.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_down_outlined, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyle?.call(); - }, - ), - ), - ], - ); - } -} diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart deleted file mode 100644 index 8aebfc69..00000000 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart +++ /dev/null @@ -1,13 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_widget.dart' - show MenuStaggeredViewComponentWidget; -import 'package:flutter/material.dart'; - -class MenuStaggeredViewComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart deleted file mode 100644 index f4db990c..00000000 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ /dev/null @@ -1,1161 +0,0 @@ -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'menu_staggered_view_component_model.dart'; -export 'menu_staggered_view_component_model.dart'; - -class MenuStaggeredViewComponentWidget extends StatefulWidget { - const MenuStaggeredViewComponentWidget({ - super.key, - required this.changeMenuStyleAction, - required this.registerVisitorOptAction, - required this.scheduleVisitOptAction, - required this.peopleOnThePropertyOptAction, - required this.accessHistoryOptAction, - required this.liberationHistoryOptAction, - required this.accessQRCodeOptAction, - }); - - final Future Function()? changeMenuStyleAction; - final Future Function()? registerVisitorOptAction; - final Future Function()? scheduleVisitOptAction; - final Future Function()? peopleOnThePropertyOptAction; - final Future Function()? accessHistoryOptAction; - final Future Function()? liberationHistoryOptAction; - final Future Function()? accessQRCodeOptAction; - - @override - State createState() => - _MenuStaggeredViewComponentWidgetState(); -} - -class _MenuStaggeredViewComponentWidgetState - extends State { - late MenuStaggeredViewComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MenuStaggeredViewComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Container( - width: double.infinity, - height: MediaQuery.sizeOf(context).height * 0.498, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: MasonryGridView.builder( - physics: const NeverScrollableScrollPhysics(), - gridDelegate: const SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - ), - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - itemCount: 9, - padding: const EdgeInsets.fromLTRB( - 0, - 10.0, - 0, - 10.0, - ), - shrinkWrap: true, - itemBuilder: (context, index) { - return [ - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector1, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ee33l0ms' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'ya37l3jt' /* Cadastrar - Visitante */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.khome, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'h8s3adu8' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Icon( - FFIcons.kpets, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'j6tfixen' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - FFIcons.kvector2, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '9tli4i2x' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.people, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'i22hecs8' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '6jzghbyi' /* Histórico -de Acesso */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.history_sharp, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'u8qu4v6q' /* Histórico -de Liberação */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - () => InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, 0.0), - child: Icon( - Icons.settings_rounded, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'dzk31zpc' /* Preferencias -do Sistema */ - , - ), - style: FlutterFlowTheme.of(context) - .titleLarge - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), - ), - ), - ), - ), - ][index](); - }, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_up_sharp, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyleAction?.call(); - }, - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart deleted file mode 100644 index 3da2a723..00000000 --- a/lib/components/organism_components/message_well_component/message_well_component_model.dart +++ /dev/null @@ -1,12 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'message_well_component_widget.dart' show MessageWellComponentWidget; -import 'package:flutter/material.dart'; - -class MessageWellComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart deleted file mode 100644 index d8a5b8b8..00000000 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ /dev/null @@ -1,125 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'message_well_component_model.dart'; -export 'message_well_component_model.dart'; - -class MessageWellComponentWidget extends StatefulWidget { - const MessageWellComponentWidget({super.key}); - - @override - State createState() => - _MessageWellComponentWidgetState(); -} - -class _MessageWellComponentWidgetState - extends State { - late MessageWellComponentModel _model; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => MessageWellComponentModel()); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 40.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 167.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - FFLocalizations.of(context).getText( - '8fworxmb' /* Mural de Mensagens */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Nunito Sans', - letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito Sans'), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: FFLocalizations.of(context).getText( - 'yikill36' /* Todos */, - ), - options: FFButtonOptions( - width: 260.0, - height: 20.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: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).customColor4, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Container( - width: 464.0, - height: 127.0, - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: ListView( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - children: const [], - ), - ), - ), - ), - ], - ), - ), - ), - ); - } -} 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 deleted file mode 100644 index fd542965..00000000 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart +++ /dev/null @@ -1,61 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_in_template_component_widget.dart' - show SignInTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class SignInTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - String? _emailAddressTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'xhnawzcb' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return FFLocalizations.of(context).getText( - 's3j1hjqx' /* E-mail Inv */, - ); - } - return null; - } - - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - String? _passwordTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '9cs5wlmc' /* Campo é necessário */, - ); - } - - return null; - } - - @override - void initState(BuildContext context) { - emailAddressTextControllerValidator = _emailAddressTextControllerValidator; - passwordVisibility = false; - passwordTextControllerValidator = _passwordTextControllerValidator; - } - - @override - void dispose() { - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); - } -} 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 deleted file mode 100644 index ae8cc9df..00000000 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ /dev/null @@ -1,1026 +0,0 @@ -import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; -import 'package:easy_debounce/easy_debounce.dart'; -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'sign_in_template_component_model.dart'; -export 'sign_in_template_component_model.dart'; - -class SignInTemplateComponentWidget extends StatefulWidget { - const SignInTemplateComponentWidget({ - super.key, - required this.toggleSignUpPage, - }); - - final Future Function()? toggleSignUpPage; - - @override - State createState() => - _SignInTemplateComponentWidgetState(); -} - -class _SignInTemplateComponentWidgetState - extends State with TickerProviderStateMixin { - late SignInTemplateComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SignInTemplateComponentModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - - _model.passwordTextController ??= TextEditingController(); - _model.passwordFocusNode ??= FocusNode(); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), - child: Container( - width: 548.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Text( - FFLocalizations.of(context).getText( - '9hbdjxrz' /* VAMOS LA! ENTRE COM A SUA CONT... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 34.0, 0.0, 34.0, 0.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Form( - key: _model.formKey, - autovalidateMode: - AutovalidateMode.always, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailAddressTextController, - focusNode: _model - .emailAddressFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.emailAddressTextController', - const Duration(milliseconds: 500), - () => setState(() {}), - ), - autofocus: true, - autofillHints: const [ - AutofillHints.email - ], - textCapitalization: - TextCapitalization.none, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - '1ltg0ylb' /* Email */, - ), - labelStyle: FlutterFlowTheme - .of(context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of( - context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: TextInputType - .emailAddress, - validator: _model - .emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordTextController, - 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, - 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: 16.0, - 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), - ), - 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), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: - Color(0xFFFF5963), - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordVisibility = - !_model - .passwordVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: - FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, - ), - ), - ), - style: FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordTextControllerValidator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Builder( - builder: (context) { - 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), - child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && - (_model.passwordTextController - .text == - '')) - ? null - : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, - text: FFLocalizations.of( - context) - .getText( - 'k44tm7wo' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: - FlutterFlowTheme.of( - context) - .primary, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: - Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular( - 12.0), - disabledColor: - FlutterFlowTheme.of( - context) - .customColor5, - disabledTextColor: - Colors.white, - ), - showLoadingIndicator: false, - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget - .toggleSignUpPage - ?.call(); - }, - text: FFLocalizations.of( - context) - .getText( - '14u7ipws' /* Cadastrar */, - ), - 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: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .secondaryText, - fontSize: 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: - Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: FFButtonWidget( - onPressed: (((_model.emailAddressTextController - .text == - '') || - ((_model.emailAddressFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.emailAddressTextController - .text == - '') || - ((_model.passwordTextController.text == - '') || - ((_model.passwordFocusNode?.hasFocus ?? - false) != - null)))) - ? null - : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); - }, - text: FFLocalizations.of( - context) - .getText( - '1x926nsn' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: - FlutterFlowTheme.of( - context) - .accent1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors - .transparent, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular(12.0), - disabledColor: - const Color(0xE81AAB5F), - ), - showLoadingIndicator: - false, - ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget - .toggleSignUpPage - ?.call(); - }, - text: FFLocalizations.of( - context) - .getText( - 'jwvd4ai1' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: - FlutterFlowTheme.of( - context) - .customColor1, - 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, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular(12.0), - ), - showLoadingIndicator: - false, - ), - ), - ), - ].divide(const SizedBox(width: 7.0)), - ); - } - }, - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ); - }, - ).then( - (value) => safeSetState(() {})); - }, - child: RichText( - textScaler: MediaQuery.of(context) - .textScaler, - text: TextSpan( - children: [ - TextSpan( - text: FFLocalizations.of( - context) - .getText( - '05dx91ku' /* Você esqueceu a sua senha? */, - ), - style: TextStyle( - color: FlutterFlowTheme.of( - context) - .primaryText, - ), - ), - 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: 14.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.normal, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - mouseCursor: - SystemMouseCursors.click, - recognizer: - TapGestureRecognizer() - ..onTap = () async { - await showModalBottomSheet( - isScrollControlled: - true, - backgroundColor: - Colors - .transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState( - () {})); - }, - ) - ], - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - Text( - FFLocalizations.of(context).getText( - 'olf967cj' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - ], - ), - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart deleted file mode 100644 index bbcd4725..00000000 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart +++ /dev/null @@ -1,91 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'sign_up_template_component_widget.dart' - show SignUpTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class SignUpTemplateComponentModel - extends FlutterFlowModel { - /// State fields for stateful widgets in this component. - - final formKey = GlobalKey(); - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '3bs10dfq' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } - return null; - } - - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - String? _emailRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'mlvw63yj' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '6nn79lmh' /* Campo é necessário */, - ); - } - - return null; - } - - // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. - bool? signUp; - - @override - void initState(BuildContext context) { - nameRegisterFormTextControllerValidator = - _nameRegisterFormTextControllerValidator; - emailRegisterFormTextControllerValidator = - _emailRegisterFormTextControllerValidator; - passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = - _passwordRegisterFormTextControllerValidator; - } - - @override - void dispose() { - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); - } -} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart deleted file mode 100644 index 0d5327b0..00000000 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ /dev/null @@ -1,866 +0,0 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/actions/actions.dart' as action_blocks; -import 'package:easy_debounce/easy_debounce.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; -import 'sign_up_template_component_model.dart'; -export 'sign_up_template_component_model.dart'; - -class SignUpTemplateComponentWidget extends StatefulWidget { - const SignUpTemplateComponentWidget({ - super.key, - required this.toggleSignInPage, - }); - - final Future Function()? toggleSignInPage; - - @override - State createState() => - _SignUpTemplateComponentWidgetState(); -} - -class _SignUpTemplateComponentWidgetState - extends State with TickerProviderStateMixin { - late SignUpTemplateComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SignUpTemplateComponentModel()); - - _model.nameRegisterFormTextController ??= TextEditingController(); - _model.nameRegisterFormFocusNode ??= FocusNode(); - _model.nameRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.emailRegisterFormTextController ??= TextEditingController(); - _model.emailRegisterFormFocusNode ??= FocusNode(); - _model.emailRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.passwordRegisterFormTextController ??= TextEditingController(); - _model.passwordRegisterFormFocusNode ??= FocusNode(); - _model.passwordRegisterFormFocusNode!.addListener(() => setState(() {})); - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - context.watch(); - - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 669.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Text( - FFLocalizations.of(context).getText( - '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Form( - key: _model.formKey, - autovalidateMode: - AutovalidateMode.disabled, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .nameRegisterFormTextController, - focusNode: _model - .nameRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.nameRegisterFormTextController', - const Duration( - milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.name - ], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - '3corpwhd' /* Nome */, - ), - labelStyle: FlutterFlowTheme - .of(context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - suffixIcon: Icon( - Icons.person, - color: - FlutterFlowTheme.of( - context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.name, - validator: _model - .nameRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailRegisterFormTextController, - focusNode: _model - .emailRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.emailRegisterFormTextController', - const Duration( - milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.email - ], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - '80wonb69' /* Email */, - ), - labelStyle: FlutterFlowTheme - .of(context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .primaryText, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of( - context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .customColor1, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: TextInputType - .emailAddress, - validator: _model - .emailRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordRegisterFormTextController, - focusNode: _model - .passwordRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.passwordRegisterFormTextController', - const Duration( - milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.password - ], - obscureText: !_model - .passwordRegisterFormVisibility, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - '0firji8l' /* Senha */, - ), - labelStyle: FlutterFlowTheme - .of(context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: - Color(0xFF1AAB5F), - width: 0.25, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - 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), - ), - filled: true, - fillColor: - FlutterFlowTheme.of( - context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordRegisterFormVisibility = - !_model - .passwordRegisterFormVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordRegisterFormVisibility - ? 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: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: (((_model.nameRegisterFormTextController - .text != - '') || - ((_model.nameRegisterFormFocusNode?.hasFocus ?? - false) != - null)) && - ((_model.emailRegisterFormTextController - .text != - '') || - ((_model.emailRegisterFormFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.passwordRegisterFormTextController - .text != - '') || - ((_model.passwordRegisterFormFocusNode - ?.hasFocus ?? - false) != - null))) - ? null - : () async { - var shouldSetState = false; - _model.signUp = - await action_blocks - .signUpRegisterAction( - context, - name: _model - .nameRegisterFormTextController - .text, - passwd: _model - .passwordRegisterFormTextController - .text, - email: _model - .emailRegisterFormTextController - .text, - device: FFAppState().device, - ); - shouldSetState = true; - if (_model.signUp == true) { - await widget - .toggleSignInPage - ?.call(); - } else { - if (shouldSetState) { - setState(() {}); - } - return; - } - - if (shouldSetState) { - setState(() {}); - } - }, - text: FFLocalizations.of(context) - .getText( - 'rnvdwzei' /* Cadastrar-se */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .accent1, - textStyle: FlutterFlowTheme.of( - context) - .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, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.toggleSignInPage - ?.call(); - }, - child: RichText( - textScaler: MediaQuery.of(context) - .textScaler, - text: TextSpan( - children: [ - TextSpan( - text: FFLocalizations.of( - context) - .getText( - 'a9smhn5b' /* Você já tem uma conta? */, - ), - style: TextStyle( - color: FlutterFlowTheme.of( - context) - .primaryText, - ), - ), - TextSpan( - text: FFLocalizations.of( - context) - .getText( - '09xv5ctc' /* Clique aqui */, - ), - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ) - ], - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - Text( - FFLocalizations.of(context).getText( - 'huygnka2' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ), - ), - ], - ); - } -} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart deleted file mode 100644 index 17ea3047..00000000 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart +++ /dev/null @@ -1,13 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'welcome_template_component_widget.dart' - show WelcomeTemplateComponentWidget; -import 'package:flutter/material.dart'; - -class WelcomeTemplateComponentModel - extends FlutterFlowModel { - @override - void initState(BuildContext context) {} - - @override - void dispose() {} -} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart deleted file mode 100644 index bdb465b1..00000000 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ /dev/null @@ -1,445 +0,0 @@ -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'welcome_template_component_model.dart'; -export 'welcome_template_component_model.dart'; - -class WelcomeTemplateComponentWidget extends StatefulWidget { - const WelcomeTemplateComponentWidget({ - super.key, - required this.toggleSignUpPage, - required this.toggleSignInPage, - }); - - final Future Function()? toggleSignUpPage; - final Future Function()? toggleSignInPage; - - @override - State createState() => - _WelcomeTemplateComponentWidgetState(); -} - -class _WelcomeTemplateComponentWidgetState - extends State - with TickerProviderStateMixin { - late WelcomeTemplateComponentModel _model; - - final animationsMap = {}; - - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } - - @override - void initState() { - super.initState(); - _model = createModel(context, () => WelcomeTemplateComponentModel()); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); - } - - @override - void dispose() { - _model.maybeDispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SafeArea( - child: Container( - width: 648.0, - height: 208.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - FFLocalizations.of(context).getText( - 'dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - 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... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), - ), - ), - ), - Container( - width: 284.0, - height: 200.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', - width: 603.0, - height: double.infinity, - fit: BoxFit.contain, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - boxShadow: const [ - BoxShadow( - blurRadius: 0.0, - color: Colors.transparent, - offset: Offset( - 0.0, - 0.0, - ), - ) - ], - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Builder( - builder: (context) { - 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), - child: FFButtonWidget( - onPressed: () async { - await widget.toggleSignInPage?.call(); - }, - text: - FFLocalizations.of(context).getText( - 'dynet730' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of(context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget.toggleSignUpPage?.call(); - }, - text: - FFLocalizations.of(context).getText( - 'hha60cg7' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .customColor1, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of(context) - .primaryBackground, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget.toggleSignInPage - ?.call(); - }, - text: FFLocalizations.of(context) - .getText( - 'zvtay8ee' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () async { - await widget.toggleSignUpPage - ?.call(); - }, - text: FFLocalizations.of(context) - .getText( - 'o6zob50a' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .primary, - textStyle: FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - ].divide(const SizedBox(width: 7.0)), - ); - } - }, - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index b0b78958..90baffdf 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -151,6 +151,86 @@ final kTranslationsMap = >>[ 'pt': 'FRE ACCESS', 'en': 'FREE ACCESS', }, + 'b2qdcsh0': { + 'pt': 'Agendar \nVisita', + 'en': '', + }, + 'intigjrx': { + 'pt': 'Cadastrar\nVisitante', + 'en': '', + }, + 'dcpn2r8i': { + 'pt': 'Vincular \nCondomínio', + 'en': '', + }, + 'rt57fpea': { + 'pt': 'Cadastrar \nPet', + 'en': '', + }, + 'e7o77oeh': { + 'pt': 'QR Code \nde Acesso', + 'en': '', + }, + 'xua67fn9': { + 'pt': 'Pessoas na\nPropriedade', + 'en': '', + }, + 'hli1jd0i': { + 'pt': 'Consultar \nHistóricos', + 'en': '', + }, + 'kbvld4ht': { + 'pt': 'Histórico \nde Acesso', + 'en': '', + }, + 'csz6cjye': { + 'pt': 'Histórico \nde Liberação', + 'en': '', + }, + 'lzag0674': { + 'pt': 'Agendar \nVisita', + 'en': '', + }, + 'mopkb1cs': { + 'pt': 'Cadastrar\n Visitante', + 'en': '', + }, + '9n0bfmlf': { + 'pt': 'Vincular\nCondomínio', + 'en': '', + }, + '3hkp1x8r': { + 'pt': 'Cadastrar\nPet', + 'en': '', + }, + 'fi81uwmz': { + 'pt': 'QR Code\nde Acesso', + 'en': '', + }, + '1djx7nvm': { + 'pt': 'Pessoas na\nPropriedade', + 'en': '', + }, + 'ttj9zmi8': { + 'pt': 'Histórico\nde Acesso', + 'en': '', + }, + 'h989n5uy': { + 'pt': 'Histórico\nde Liberação', + 'en': '', + }, + 'fx7ci8gw': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, + 'rgpcq2s6': { + 'pt': 'Mural de Mensagens', + 'en': '', + }, + 'bdvbpuo8': { + 'pt': 'Todos', + 'en': '', + }, 'mp6igsok': { 'pt': '', 'en': '', @@ -424,6 +504,66 @@ final kTranslationsMap = >>[ }, // signInPage { + 'v9f4ae9n': { + 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', + 'en': '', + }, + 'i6dx9dz4': { + 'pt': 'Email', + 'en': '', + }, + 'kpsqzbuz': { + 'pt': 'Senha', + 'en': '', + }, + 'aobfkrs0': { + 'pt': 'Campo é necessário', + 'en': '', + }, + 'axa3n3lr': { + 'pt': 'E-mail Inv', + 'en': '', + }, + '1z37vela': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '9h4qk3c9': { + 'pt': 'Campo é necessário', + 'en': '', + }, + '5v5xvc3b': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'q4tx90yp': { + 'pt': 'Entrar', + 'en': '', + }, + 'lzfmqkly': { + 'pt': 'Cadastrar', + 'en': '', + }, + '7niwis9z': { + 'pt': 'Entrar', + 'en': '', + }, + 'bl377mgi': { + 'pt': 'Cadastrar', + 'en': '', + }, + '7dntd49d': { + 'pt': 'Você esqueceu a sua senha?', + 'en': '', + }, + '31y04wkg': { + 'pt': ' Recupere aqui', + 'en': '', + }, + 'jou5axcb': { + 'pt': 'Termo de Uso', + 'en': '', + }, 'kosqqghj': { 'pt': 'Home', 'en': '', @@ -431,6 +571,66 @@ final kTranslationsMap = >>[ }, // signUpPage { + 'bv7d4en2': { + 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', + 'en': '', + }, + 'evcb30xo': { + 'pt': 'Nome', + 'en': '', + }, + 'p7snp67t': { + 'pt': 'Email', + 'en': '', + }, + 'l0z1d0ca': { + 'pt': '', + 'en': '', + }, + 'u30lpbvg': { + 'pt': 'Senha', + 'en': '', + }, + 'iv6d5xk3': { + 'pt': 'Campo é necessário', + 'en': '', + }, + '51g9xnav': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'w3nl41ps': { + 'pt': 'Campo é necessário', + 'en': '', + }, + '9aweyu6u': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'ql1bxvno': { + 'pt': 'Campo é necessário', + 'en': '', + }, + '2cwu613g': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '2a4f1t3w': { + 'pt': 'Cadastrar-se', + 'en': '', + }, + 'uy41jbvn': { + 'pt': 'Você já tem uma conta? ', + 'en': '', + }, + 'ynungy80': { + 'pt': 'Clique aqui', + 'en': '', + }, + 'r5rm6pll': { + 'pt': 'Termo de Uso', + 'en': '', + }, 'bq5k4yne': { 'pt': 'Home', 'en': '', @@ -438,6 +638,30 @@ final kTranslationsMap = >>[ }, // welcomePage { + '77d2ypub': { + 'pt': 'UMA EXPERIÊCIA COMPLETA', + 'en': '', + }, + 'avhdhlhw': { + 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', + 'en': '', + }, + 'iw9yx5fr': { + 'pt': 'Entrar', + 'en': '', + }, + 'bs5mbse6': { + 'pt': 'Cadastrar', + 'en': '', + }, + 'cq85bqnj': { + 'pt': 'Entrar', + 'en': '', + }, + 'iupuq6xs': { + 'pt': 'Cadastrar', + 'en': '', + }, 'byab1t50': { 'pt': 'Home', 'en': '', @@ -474,28 +698,6 @@ final kTranslationsMap = >>[ 'en': '', }, }, - // preferencesPage - { - '1vyj6y7n': { - 'pt': 'Preferencias', - 'en': '', - }, - 'sejj3t8w': { - 'pt': '', - 'en': '', - }, - }, - // settingsPage - { - 'bc698859': { - 'pt': 'Preferencias', - 'en': '', - }, - 'sejj3t8w': { - 'pt': '', - 'en': '', - }, - }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -769,248 +971,6 @@ final kTranslationsMap = >>[ 'en': 'Schedule\nComplete', }, }, - // menuListViewComponent - { - 'utgue9a5': { - 'pt': 'Agendar \nVisita', - 'en': 'Schedule \nVisit', - }, - '82b5f8yz': { - 'pt': 'Cadastrar\nVisitante', - 'en': 'Register\nVisitor', - }, - 't4ie13ut': { - 'pt': 'Vincular \nCondomínio', - 'en': 'Link\nCondominium', - }, - 'n3n76pha': { - 'pt': 'Cadastrar \nPet', - 'en': 'Register\npet', - }, - 'l6b9o7yn': { - 'pt': 'QR Code \nde Acesso', - 'en': 'QR Code\nAccess', - }, - 'rxnrtdau': { - 'pt': 'Pessoas na\nPropriedade', - 'en': 'People on\nthe Property', - }, - 'nxssjz3q': { - 'pt': 'Consultar \nHistóricos', - 'en': 'Consult \nHistories', - }, - '589qufkw': { - 'pt': 'Histórico \nde Acesso', - 'en': 'Access \nHistory', - }, - '944g4ib1': { - 'pt': 'Histórico \nde Liberação', - 'en': 'Liberation\nHistory', - }, - }, - // menuStaggeredViewComponent - { - 'ee33l0ms': { - 'pt': 'Agendar \nVisita', - 'en': 'Schedule \nVisit', - }, - 'ya37l3jt': { - 'pt': 'Cadastrar\n Visitante', - 'en': 'Register\n Visitor', - }, - 'h8s3adu8': { - 'pt': 'Vincular\nCondomínio', - 'en': 'Link\nCondominium', - }, - 'j6tfixen': { - 'pt': 'Cadastrar\nPet', - 'en': 'Register\npet', - }, - '9tli4i2x': { - 'pt': 'QR Code\nde Acesso', - 'en': 'QR Code\nAccess', - }, - 'i22hecs8': { - 'pt': 'Pessoas na\nPropriedade', - 'en': 'People on\nthe Property', - }, - '6jzghbyi': { - 'pt': 'Histórico\nde Acesso', - 'en': 'Access\nHistory', - }, - 'u8qu4v6q': { - 'pt': 'Histórico\nde Liberação', - 'en': 'Liberation\nHistory', - }, - 'dzk31zpc': { - 'pt': 'Preferencias\ndo Sistema', - 'en': '', - }, - }, - // messageWellComponent - { - '8fworxmb': { - 'pt': 'Mural de Mensagens', - 'en': 'Message Wall', - }, - 'yikill36': { - 'pt': 'Todos', - 'en': 'All', - }, - }, - // signInTemplateComponent - { - '9hbdjxrz': { - 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', - 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', - }, - '1ltg0ylb': { - 'pt': 'Email', - 'en': 'Email', - }, - '2x19ce8k': { - 'pt': 'Senha', - 'en': 'Password', - }, - 'xhnawzcb': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', - }, - 's3j1hjqx': { - 'pt': 'E-mail Inv', - 'en': '', - }, - '2ib9bf67': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - '9cs5wlmc': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', - }, - 'rkxwb0sg': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'k44tm7wo': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - '14u7ipws': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - '1x926nsn': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'jwvd4ai1': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - '05dx91ku': { - 'pt': 'Você esqueceu a sua senha?', - 'en': 'Have you forgotten your password?', - }, - 'p5c6d54y': { - 'pt': ' Recupere aqui', - 'en': ' recover here', - }, - 'olf967cj': { - 'pt': 'Termo de Uso', - 'en': 'Terms of use', - }, - }, - // signUpTemplateComponent - { - '49609olv': { - 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', - 'en': 'ENTER YOUR EMAIL AND PASSWORD, LET\'S REGISTER YOU!', - }, - '3corpwhd': { - 'pt': 'Nome', - 'en': 'Name', - }, - '80wonb69': { - 'pt': 'Email', - 'en': 'Email', - }, - 'ws143wf4': { - 'pt': '', - 'en': '', - }, - '0firji8l': { - 'pt': 'Senha', - 'en': 'Password', - }, - '3bs10dfq': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', - }, - 'ph22karc': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'mlvw63yj': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', - }, - 'z0bv6wi2': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - '6nn79lmh': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', - }, - 'rcikqhf1': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'rnvdwzei': { - 'pt': 'Cadastrar-se', - 'en': 'Sign-Up', - }, - 'a9smhn5b': { - 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', - }, - '09xv5ctc': { - 'pt': 'Clique aqui', - 'en': 'Click here', - }, - 'huygnka2': { - 'pt': 'Termo de Uso', - 'en': '', - }, - }, - // welcomeTemplateComponent - { - 'dsc9tuc8': { - 'pt': 'UMA EXPERIÊCIA COMPLETA', - 'en': 'A COMPLETE EXPERIENCE', - }, - '5bgqn16z': { - 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', - 'en': 'WITH COMFORT WHEREVER YOU ARE.', - }, - 'dynet730': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'hha60cg7': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - 'zvtay8ee': { - 'pt': 'Entrar', - 'en': 'Sign-In', - }, - 'o6zob50a': { - 'pt': 'Cadastrar', - 'en': 'Sign-Up', - }, - }, // forgotPasswordTemplateComponent { 'xxm3ajsy': { diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index d6c54bca..fb4887f7 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -6,7 +6,6 @@ import 'package:provider/provider.dart'; import '/backend/schema/structs/index.dart'; import '/index.dart'; -import '/main.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -63,9 +62,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( FFRoute( name: 'homePage', path: '/homePage', - builder: (context, params) => params.isEmpty - ? const NavBarPage(initialPage: 'homePage') - : const HomePageWidget(), + builder: (context, params) => const HomePageWidget(), ), FFRoute( name: 'registerVisitorPage', @@ -150,18 +147,6 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget(), - ), - FFRoute( - name: 'preferencesPage', - path: '/preferencesPage', - builder: (context, params) => const PreferencesPageWidget(), - ), - FFRoute( - name: 'settingsPage', - path: '/settingsPage', - builder: (context, params) => params.isEmpty - ? const NavBarPage(initialPage: 'settingsPage') - : const SettingsPageWidget(), ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index 996c7347..e7526939 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -16,6 +16,3 @@ export '/pages/sign_in_page/sign_in_page_widget.dart' show SignInPageWidget; export '/pages/sign_up_page/sign_up_page_widget.dart' show SignUpPageWidget; export '/pages/welcome_page/welcome_page_widget.dart' show WelcomePageWidget; export '/pages/qr_code_page/qr_code_page_widget.dart' show QrCodePageWidget; -export '/pages/preferences_page/preferences_page_widget.dart' - show PreferencesPageWidget; -export '/pages/settings_page/settings_page_widget.dart' show SettingsPageWidget; diff --git a/lib/main.dart b/lib/main.dart index 85cc7135..05c412f7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,6 @@ import 'package:flutter_web_plugins/url_strategy.dart'; import 'flutter_flow/flutter_flow_theme.dart'; import 'flutter_flow/flutter_flow_util.dart'; import 'flutter_flow/internationalization.dart'; -import 'index.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -120,74 +119,3 @@ class _MyAppState extends State { ); } } - -class NavBarPage extends StatefulWidget { - const NavBarPage({super.key, this.initialPage, this.page}); - - final String? initialPage; - final Widget? page; - - @override - _NavBarPageState createState() => _NavBarPageState(); -} - -/// This is the private State class that goes with NavBarPage. -class _NavBarPageState extends State { - String _currentPageName = 'homePage'; - late Widget? _currentPage; - - @override - void initState() { - super.initState(); - _currentPageName = widget.initialPage ?? _currentPageName; - _currentPage = widget.page; - } - - @override - Widget build(BuildContext context) { - final tabs = { - 'homePage': const HomePageWidget(), - 'settingsPage': const SettingsPageWidget(), - }; - final currentIndex = tabs.keys.toList().indexOf(_currentPageName); - - return Scaffold( - body: _currentPage ?? tabs[_currentPageName], - bottomNavigationBar: BottomNavigationBar( - currentIndex: currentIndex, - onTap: (i) => setState(() { - _currentPage = null; - _currentPageName = tabs.keys.toList()[i]; - }), - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - selectedItemColor: FlutterFlowTheme.of(context).primary, - unselectedItemColor: FlutterFlowTheme.of(context).primaryText, - showSelectedLabels: false, - showUnselectedLabels: false, - type: BottomNavigationBarType.fixed, - items: [ - BottomNavigationBarItem( - icon: const Icon( - Icons.home, - size: 24.0, - ), - label: FFLocalizations.of(context).getText( - 'mp6igsok' /* */, - ), - tooltip: '', - ), - BottomNavigationBarItem( - icon: const Icon( - Icons.settings_rounded, - size: 24.0, - ), - label: FFLocalizations.of(context).getText( - 'sejj3t8w' /* */, - ), - tooltip: '', - ) - ], - ), - ); - } -} diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_model.dart similarity index 100% rename from lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart rename to lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_model.dart diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart rename to lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_model.dart similarity index 100% rename from lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart rename to lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_model.dart diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart similarity index 100% rename from lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart rename to lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart similarity index 100% rename from lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart rename to lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart similarity index 100% rename from lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart rename to lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/modals/card_item_template_component/card_item_template_component_model.dart similarity index 100% rename from lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart rename to lib/modals/card_item_template_component/card_item_template_component_model.dart diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/modals/card_item_template_component/card_item_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart rename to lib/modals/card_item_template_component/card_item_template_component_widget.dart diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/modals/forgot_password_template_component/forgot_password_template_component_model.dart similarity index 100% rename from lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart rename to lib/modals/forgot_password_template_component/forgot_password_template_component_model.dart diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/modals/forgot_password_template_component/forgot_password_template_component_widget.dart similarity index 99% rename from lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart rename to lib/modals/forgot_password_template_component/forgot_password_template_component_widget.dart index 39cce295..09fdeb47 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/modals/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -1,8 +1,8 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart similarity index 100% rename from lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart rename to lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart rename to lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart b/lib/modals/opt_modal/opt_modal_model.dart similarity index 100% rename from lib/components/molecular_components/opt_modal/opt_modal_model.dart rename to lib/modals/opt_modal/opt_modal_model.dart diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart b/lib/modals/opt_modal/opt_modal_widget.dart similarity index 100% rename from lib/components/molecular_components/opt_modal/opt_modal_widget.dart rename to lib/modals/opt_modal/opt_modal_widget.dart diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart b/lib/modals/option_selection_modal/option_selection_modal_model.dart similarity index 100% rename from lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart rename to lib/modals/option_selection_modal/option_selection_modal_model.dart diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/modals/option_selection_modal/option_selection_modal_widget.dart similarity index 100% rename from lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart rename to lib/modals/option_selection_modal/option_selection_modal_widget.dart diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart b/lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart similarity index 100% rename from lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart rename to lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart rename to lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart similarity index 100% rename from lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart rename to lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart similarity index 99% rename from lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart rename to lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 4a00c919..85b06c3f 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,11 +1,11 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/upload_data.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/modals/schedule_visit_detail/schedule_visit_detail_model.dart similarity index 100% rename from lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart rename to lib/modals/schedule_visit_detail/schedule_visit_detail_model.dart diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart similarity index 99% rename from lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart rename to lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart index 9641ca52..07e45567 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -1,9 +1,9 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; +import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart b/lib/modals/text_field_component/text_field_component_model.dart similarity index 100% rename from lib/components/atomic_components/text_field_component/text_field_component_model.dart rename to lib/modals/text_field_component/text_field_component_model.dart diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart b/lib/modals/text_field_component/text_field_component_widget.dart similarity index 100% rename from lib/components/atomic_components/text_field_component/text_field_component_widget.dart rename to lib/modals/text_field_component/text_field_component_widget.dart diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart b/lib/modals/throw_exception/throw_exception_model.dart similarity index 100% rename from lib/components/molecular_components/throw_exception/throw_exception_model.dart rename to lib/modals/throw_exception/throw_exception_model.dart diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/modals/throw_exception/throw_exception_widget.dart similarity index 100% rename from lib/components/molecular_components/throw_exception/throw_exception_widget.dart rename to lib/modals/throw_exception/throw_exception_widget.dart diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart similarity index 100% rename from lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart rename to lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart similarity index 100% rename from lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart rename to lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart b/lib/modals/view_visit_detail/view_visit_detail_model.dart similarity index 100% rename from lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart rename to lib/modals/view_visit_detail/view_visit_detail_model.dart diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/modals/view_visit_detail/view_visit_detail_widget.dart similarity index 99% rename from lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart rename to lib/modals/view_visit_detail/view_visit_detail_widget.dart index 73f3e397..a9e1fa7a 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/modals/view_visit_detail/view_visit_detail_widget.dart @@ -1,9 +1,9 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; +import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart similarity index 84% rename from lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart rename to lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index a4052e41..66664873 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,6 +1,6 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import '/modals/view_visit_detail/view_visit_detail_widget.dart'; import 'visit_details_modal_template_component_widget.dart' show VisitDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart similarity index 95% rename from lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart rename to lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 7e668742..0bd52e6c 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,6 +1,6 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import '/modals/view_visit_detail/view_visit_detail_widget.dart'; import 'package:flutter/material.dart'; import 'visit_details_modal_template_component_model.dart'; export 'visit_details_modal_template_component_model.dart'; diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/modals/visit_request_template_component/visit_request_template_component_model.dart similarity index 100% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart rename to lib/modals/visit_request_template_component/visit_request_template_component_model.dart diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/modals/visit_request_template_component/visit_request_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart rename to lib/modals/visit_request_template_component/visit_request_template_component_widget.dart diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart b/lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart similarity index 100% rename from lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart rename to lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart similarity index 100% rename from lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart rename to lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/modals/visitor_not_found_component/visitor_not_found_component_model.dart similarity index 100% rename from lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart rename to lib/modals/visitor_not_found_component/visitor_not_found_component_model.dart diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart similarity index 98% rename from lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart rename to lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart index 115a6304..d161d91e 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,8 +1,8 @@ -import '/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'visitor_not_found_component_model.dart'; diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart b/lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart similarity index 100% rename from lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart rename to lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart similarity index 99% rename from lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart rename to lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index f393b4ec..3961ff49 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,10 +1,10 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/modals/visitor_not_found_component/visitor_not_found_component_widget.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index 71a5824f..15d9230c 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,6 +1,6 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/request_manager.dart'; import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; 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 8b4f8b03..b3e81a86 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -1,8 +1,8 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/modals/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index 01e742ae..f4c7637a 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,6 +1,3 @@ -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'home_page_widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; @@ -17,30 +14,14 @@ class HomePageModel extends FlutterFlowModel { FocusNode? textFieldFocusNode; TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; - // Model for localComponent. - late LocalProfileComponentModel localComponentModel; - // Model for menuComponent component. - late MenuComponentModel menuComponentModel; - // Model for messageWellComponent component. - late MessageWellComponentModel messageWellComponentModel; @override - void initState(BuildContext context) { - localComponentModel = - createModel(context, () => LocalProfileComponentModel()); - menuComponentModel = createModel(context, () => MenuComponentModel()); - messageWellComponentModel = - createModel(context, () => MessageWellComponentModel()); - } + void initState(BuildContext context) {} @override void dispose() { unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); - - localComponentModel.dispose(); - menuComponentModel.dispose(); - messageWellComponentModel.dispose(); } } diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 292f13c8..f7fe3b51 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,13 +1,12 @@ -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'home_page_model.dart'; @@ -1047,6 +1046,23 @@ class _HomePageWidgetState extends State { width: 100.0, height: 50.0, decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: + FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), ), ), ], @@ -1055,10 +1071,124 @@ class _HomePageWidgetState extends State { ), ], ), - wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: const LocalProfileComponentWidget(), + Container( + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Material( + color: Colors.transparent, + elevation: 0.0, + child: Container( + width: double.infinity, + height: 119.0, + decoration: BoxDecoration( + color: const Color(0xFF1AAB5F), + border: Border.all( + color: const Color(0xFF1AAB5F), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(2.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: const Color(0x00FFFFFF), + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode + .canRequestFocus + ? FocusScope.of(context) + .requestFocus( + _model.unfocusNode) + : FocusScope.of(context) + .unfocus(), + child: Padding( + padding: + MediaQuery.viewInsetsOf( + context), + child: const SizedBox( + height: double.infinity, + child: + BottomArrowLinkedLocalsComponentWidget(), + ), + ), + ); + }, + ).then( + (value) => safeSetState(() {})); + }, + child: ClipRRect( + borderRadius: + BorderRadius.circular(200.0), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + errorBuilder: + (context, error, stackTrace) => + Image.asset( + 'assets/images/error_image.svg', + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + ), + ), + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + valueOrDefault( + functions.convertToUppercase( + FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .info, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ], + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 20.0)) + .addToEnd(const SizedBox(width: 20.0)), + ), + ), + ), + ), ), Wrap( spacing: 0.0, @@ -1070,17 +1200,3048 @@ class _HomePageWidgetState extends State { verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget(), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Builder( + builder: (context) { + if (_model.isGrid == true) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 0.0), + child: Container( + width: double.infinity, + height: 125.0, + decoration: const BoxDecoration(), + child: ListView( + padding: const EdgeInsets.fromLTRB( + 10.0, + 0, + 10.0, + 0, + ), + scrollDirection: Axis.horizontal, + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + FFIcons + .kvector1, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'b2qdcsh0' /* Agendar +Visita */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + FFIcons + .kvector, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'intigjrx' /* Cadastrar +Visitante */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + FFIcons + .khome, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'dcpn2r8i' /* Vincular +Condomínio */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + FFIcons + .kpets, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'rt57fpea' /* Cadastrar +Pet */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + FFIcons + .kvector2, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'e7o77oeh' /* QR Code +de Acesso */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + Icons + .people, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'xua67fn9' /* Pessoas na +Propriedade */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + Icons + .history_sharp, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'hli1jd0i' /* Consultar +Históricos */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + Icons + .history_sharp, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'kbvld4ht' /* Histórico +de Acesso */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of( + context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: FlutterFlowTheme.of( + context) + .primaryBackground, + shape: BoxShape + .circle, + ), + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Icon( + Icons + .history_sharp, + color: FlutterFlowTheme.of( + context) + .accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'csz6cjye' /* Histórico +de Liberação */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Nunito'), + ), + ), + ), + ], + ), + ), + ].divide( + const SizedBox(height: 0.0)), + ), + ), + ), + ), + ].divide(const SizedBox(width: 15.0)), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_down_outlined, + color: FlutterFlowTheme.of(context) + .primary, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + ], + ); + } else { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Container( + width: double.infinity, + height: + MediaQuery.sizeOf(context).height * + 0.498, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: MasonryGridView.builder( + physics: + const NeverScrollableScrollPhysics(), + gridDelegate: + const SliverSimpleGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + ), + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + itemCount: 9, + padding: const EdgeInsets.fromLTRB( + 0, + 10.0, + 0, + 10.0, + ), + shrinkWrap: true, + itemBuilder: (context, index) { + return [ + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + FFIcons + .kvector1, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'lzag0674' /* Agendar +Visita */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + FFIcons + .kvector, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'mopkb1cs' /* Cadastrar + Visitante */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + FFIcons + .khome, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + '9n0bfmlf' /* Vincular +Condomínio */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + FFIcons + .kpets, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + '3hkp1x8r' /* Cadastrar +Pet */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + FFIcons + .kvector2, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'fi81uwmz' /* QR Code +de Acesso */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + Icons + .people, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + '1djx7nvm' /* Pessoas na +Propriedade */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + Icons + .history_sharp, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'ttj9zmi8' /* Histórico +de Acesso */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + Icons + .history_sharp, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'h989n5uy' /* Histórico +de Liberação */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme + .of(context) + .primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme + .of(context) + .customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: + BorderRadius.circular( + 24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: + FlutterFlowTheme.of( + context) + .alternate, + width: 0.5, + ), + ), + child: Padding( + padding: + const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: + MainAxisSize.min, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .max, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: + 30.0, + height: + 30.0, + decoration: + BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + shape: + BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, + 0.0), + child: + Icon( + Icons + .settings_rounded, + color: + FlutterFlowTheme.of(context).accent1, + size: + 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize + .min, + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + FFLocalizations.of( + context) + .getText( + 'fx7ci8gw' /* Preferencias +do Sistema */ + , + ), + style: FlutterFlowTheme.of( + context) + .titleLarge + .override( + fontFamily: + 'Nunito', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox( + height: 0.0)), + ), + ), + ), + ][index](); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_up_sharp, + color: + FlutterFlowTheme.of(context) + .primary, + ), + onPressed: () { + print('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ); + } + }, + ), ), Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 40.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: 167.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + FFLocalizations.of(context).getText( + 'rgpcq2s6' /* Mural de Mensagens */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Nunito Sans', + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito Sans'), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 5.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: FFLocalizations.of(context).getText( + 'bdvbpuo8' /* Todos */, + ), + options: FFButtonOptions( + width: 260.0, + height: 20.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: const Color(0xFF1AAB5F), + textStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context) + .customColor4, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .labelMediumFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(8.0), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Container( + width: 464.0, + height: 127.0, + decoration: const BoxDecoration( + shape: BoxShape.rectangle, + ), + child: ListView( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + children: const [], + ), + ), + ), + ), + ], + ), + ), ), ), ], diff --git a/lib/pages/preferences_page/preferences_page_model.dart b/lib/pages/preferences_page/preferences_page_model.dart deleted file mode 100644 index dfe2b66b..00000000 --- a/lib/pages/preferences_page/preferences_page_model.dart +++ /dev/null @@ -1,27 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'preferences_page_widget.dart' show PreferencesPageWidget; -import 'package:flutter/material.dart'; - -class PreferencesPageModel extends FlutterFlowModel { - /// Local state fields for this page. - - bool fingerprint = false; - - bool? person; - - bool? changPass; - - bool? notify; - - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - } -} diff --git a/lib/pages/preferences_page/preferences_page_widget.dart b/lib/pages/preferences_page/preferences_page_widget.dart deleted file mode 100644 index 917b4a2a..00000000 --- a/lib/pages/preferences_page/preferences_page_widget.dart +++ /dev/null @@ -1,167 +0,0 @@ -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'preferences_page_model.dart'; -export 'preferences_page_model.dart'; - -class PreferencesPageWidget extends StatefulWidget { - const PreferencesPageWidget({super.key}); - - @override - State createState() => _PreferencesPageWidgetState(); -} - -class _PreferencesPageWidgetState extends State { - late PreferencesPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => PreferencesPageModel()); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - title: Text( - FFLocalizations.of(context).getText( - '1vyj6y7n' /* Preferencias */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 20.0, 0.0), - child: GridView( - padding: const EdgeInsets.fromLTRB( - 0, - 20.0, - 0, - 20.0, - ), - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - childAspectRatio: 1.0, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: [ - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: double.infinity, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.fingerprint, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.fingerprint - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.person! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.notifications_active, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.notify! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: FlutterFlowTheme.of(context).primary, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, - icon: Icon( - Icons.password_sharp, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 40.0, - ), - onPressed: _model.changPass! - ? null - : () { - print('IconButton pressed ...'); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ); - } -} 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 3d37a4c5..b7da1d61 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,9 +1,9 @@ -import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; import 'dart:async'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:barcode_widget/barcode_widget.dart'; diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index 6f9e7722..62a92670 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,5 +1,4 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -7,6 +6,7 @@ import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/upload_data.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; 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 8643f7c6..230ce3c0 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 @@ -1,14 +1,14 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; +import '/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index b8528fa3..bc791565 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,10 +1,10 @@ import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/modals/throw_exception/throw_exception_widget.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/pages/settings_page/settings_page_model.dart b/lib/pages/settings_page/settings_page_model.dart deleted file mode 100644 index 1fa111cc..00000000 --- a/lib/pages/settings_page/settings_page_model.dart +++ /dev/null @@ -1,17 +0,0 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'settings_page_widget.dart' show SettingsPageWidget; -import 'package:flutter/material.dart'; - -class SettingsPageModel extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - - @override - void initState(BuildContext context) {} - - @override - void dispose() { - unfocusNode.dispose(); - } -} diff --git a/lib/pages/settings_page/settings_page_widget.dart b/lib/pages/settings_page/settings_page_widget.dart deleted file mode 100644 index 11227b96..00000000 --- a/lib/pages/settings_page/settings_page_widget.dart +++ /dev/null @@ -1,71 +0,0 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'settings_page_model.dart'; -export 'settings_page_model.dart'; - -class SettingsPageWidget extends StatefulWidget { - const SettingsPageWidget({super.key}); - - @override - State createState() => _SettingsPageWidgetState(); -} - -class _SettingsPageWidgetState extends State { - late SettingsPageModel _model; - - final scaffoldKey = GlobalKey(); - - @override - void initState() { - super.initState(); - _model = createModel(context, () => SettingsPageModel()); - } - - @override - void dispose() { - _model.dispose(); - - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primary, - automaticallyImplyLeading: false, - title: Text( - FFLocalizations.of(context).getText( - 'bc698859' /* Preferencias */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, - ), - body: const SafeArea( - top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [], - ), - ), - ), - ); - } -} diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index e8b945bd..df0ba706 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -1,4 +1,3 @@ -import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'sign_in_page_widget.dart' show SignInPageWidget; import 'package:flutter/material.dart'; @@ -7,18 +6,56 @@ class SignInPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - // Model for signInTemplateComponent component. - late SignInTemplateComponentModel signInTemplateComponentModel; + final formKey = GlobalKey(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'aobfkrs0' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 'axa3n3lr' /* E-mail Inv */, + ); + } + return null; + } + + // State field(s) for password widget. + FocusNode? passwordFocusNode; + TextEditingController? passwordTextController; + late bool passwordVisibility; + String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9h4qk3c9' /* Campo é necessário */, + ); + } + + return null; + } @override void initState(BuildContext context) { - signInTemplateComponentModel = - createModel(context, () => SignInTemplateComponentModel()); + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; } @override void dispose() { unfocusNode.dispose(); - signInTemplateComponentModel.dispose(); + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + + passwordFocusNode?.dispose(); + passwordTextController?.dispose(); } } diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index da1727c7..7945a411 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -1,8 +1,14 @@ -import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/modals/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'sign_in_page_model.dart'; export 'sign_in_page_model.dart'; @@ -13,15 +19,61 @@ class SignInPageWidget extends StatefulWidget { State createState() => _SignInPageWidgetState(); } -class _SignInPageWidgetState extends State { +class _SignInPageWidgetState extends State + with TickerProviderStateMixin { late SignInPageModel _model; final scaffoldKey = GlobalKey(); + final animationsMap = {}; + @override void initState() { super.initState(); _model = createModel(context, () => SignInPageModel()); + + _model.emailAddressTextController ??= TextEditingController(); + _model.emailAddressFocusNode ??= FocusNode(); + + _model.passwordTextController ??= TextEditingController(); + _model.passwordFocusNode ??= FocusNode(); + + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); } @override @@ -42,15 +94,1035 @@ class _SignInPageWidgetState extends State { backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: wrapWithModel( - model: _model.signInTemplateComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: SignInTemplateComponentWidget( - toggleSignUpPage: () async { - await action_blocks.toggleSignUpPage(context); - }, - ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 6, + child: Container( + width: 100.0, + height: double.infinity, + decoration: const BoxDecoration(), + alignment: const AlignmentDirectional(0.0, -1.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 35.0, 0.0, 35.0), + child: Container( + width: 548.0, + height: 112.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: const EdgeInsets.all(3.0), + child: Text( + FFLocalizations.of(context).getText( + 'v9f4ae9n' /* VAMOS LA! ENTRE COM A SUA CONT... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Container( + width: 291.0, + height: 167.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', + width: 603.0, + height: 155.0, + fit: BoxFit.contain, + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 34.0, 0.0, 34.0, 0.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + borderRadius: BorderRadius.circular(12.0), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.always, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailAddressTextController, + focusNode: _model + .emailAddressFocusNode, + onChanged: (_) => + EasyDebounce + .debounce( + '_model.emailAddressTextController', + const Duration( + milliseconds: + 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], + textCapitalization: + TextCapitalization + .none, + textInputAction: + TextInputAction + .next, + obscureText: false, + decoration: + InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + 'i6dx9dz4' /* Email */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme + .of(context) + .accent1, + size: 22.0, + ), + ), + style: + FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType + .emailAddress, + validator: _model + .emailAddressTextControllerValidator + .asValidator( + context), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordTextController, + 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, + decoration: + InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + 'kpsqzbuz' /* Senha */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0xFF1AAB5F), + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + 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), + ), + filled: true, + fillColor: FlutterFlowTheme + .of(context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => + setState( + () => _model + .passwordVisibility = + !_model + .passwordVisibility, + ), + focusNode: FocusNode( + skipTraversal: + true), + child: Icon( + _model.passwordVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: FlutterFlowTheme + .of(context) + .accent1, + size: 24.0, + ), + ), + ), + style: + FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordTextControllerValidator + .asValidator( + context), + ), + ), + ), + ], + ), + ), + Builder( + builder: (context) { + 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), + child: FFButtonWidget( + onPressed: ((_model.emailAddressTextController + .text == + '') && + (_model.passwordTextController + .text == + '')) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: + _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState( + () {}); + }, + text: FFLocalizations + .of(context) + .getText( + 'q4tx90yp' /* Entrar */, + ), + options: + FFButtonOptions( + width: + double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: FlutterFlowTheme + .of(context) + .primary, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, + ), + showLoadingIndicator: + false, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 16.0), + child: FFButtonWidget( + onPressed: () { + print( + 'signUpButtonLoginForm pressed ...'); + }, + text: FFLocalizations + .of(context) + .getText( + 'lzfmqkly' /* Cadastrar */, + ), + options: + FFButtonOptions( + width: + double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: FlutterFlowTheme + .of(context) + .customColor1, + 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, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + showLoadingIndicator: + false, + ), + ), + ], + ); + } else { + return Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 16.0), + child: FFButtonWidget( + onPressed: (((_model.emailAddressTextController.text == + '') || + ((_model.emailAddressFocusNode?.hasFocus ?? + false) != + null)) && + ((_model.emailAddressTextController.text == + '') || + ((_model.passwordTextController.text == '') || + ((_model.passwordFocusNode?.hasFocus ?? false) != + null)))) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState( + () {}); + }, + text: FFLocalizations + .of(context) + .getText( + '7niwis9z' /* Entrar */, + ), + options: + FFButtonOptions( + width: double + .infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: FlutterFlowTheme + .of(context) + .accent1, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .info, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + disabledColor: + const Color( + 0xE81AAB5F), + ), + showLoadingIndicator: + false, + ), + ), + ), + Expanded( + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 16.0), + child: FFButtonWidget( + onPressed: () { + print( + 'signUpButtonLoginForm pressed ...'); + }, + text: FFLocalizations + .of(context) + .getText( + 'bl377mgi' /* Cadastrar */, + ), + options: + FFButtonOptions( + width: double + .infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: FlutterFlowTheme + .of(context) + .customColor1, + 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, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + showLoadingIndicator: + false, + ), + ), + ), + ].divide( + const SizedBox(width: 7.0)), + ); + } + }, + ), + + // You will have to add an action on this rich text to go to your login page. + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: + Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode + .canRequestFocus + ? FocusScope.of( + context) + .requestFocus(_model + .unfocusNode) + : FocusScope.of( + context) + .unfocus(), + child: Padding( + padding: MediaQuery + .viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + child: RichText( + textScaler: + MediaQuery.of(context) + .textScaler, + text: TextSpan( + children: [ + TextSpan( + text: + FFLocalizations.of( + context) + .getText( + '7dntd49d' /* Você esqueceu a sua senha? */, + ), + style: TextStyle( + color: FlutterFlowTheme + .of(context) + .primaryText, + ), + ), + TextSpan( + text: + FFLocalizations.of( + context) + .getText( + '31y04wkg' /* Recupere aqui */, + ), + style: + FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primary, + fontSize: + 14.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .normal, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + mouseCursor: + SystemMouseCursors + .click, + recognizer: + TapGestureRecognizer() + ..onTap = + () async { + await showModalBottomSheet( + isScrollControlled: + true, + backgroundColor: + Colors + .transparent, + context: + context, + builder: + (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode + .canRequestFocus + ? FocusScope.of(context).requestFocus(_model + .unfocusNode) + : FocusScope.of(context) + .unfocus(), + child: + Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + const ForgotPasswordTemplateComponentWidget(), + ), + ); + }, + ).then((value) => + safeSetState( + () {})); + }, + ) + ], + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + Text( + FFLocalizations.of(context) + .getText( + 'jou5axcb' /* Termo de Uso */, + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ], + ), + ), + ), + ).animateOnPageLoad(animationsMap[ + 'containerOnPageLoadAnimation']!), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ], ), ), ), diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index 938a3b46..c2bbea7c 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -1,4 +1,3 @@ -import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'sign_up_page_widget.dart' show SignUpPageWidget; import 'package:flutter/material.dart'; @@ -7,18 +6,86 @@ class SignUpPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - // Model for signUpTemplateComponent component. - late SignUpTemplateComponentModel signUpTemplateComponentModel; + final formKey = GlobalKey(); + // State field(s) for nameRegisterForm widget. + FocusNode? nameRegisterFormFocusNode; + TextEditingController? nameRegisterFormTextController; + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'iv6d5xk3' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { + return 'Must start with a letter and can only contain letters, digits and - or _.'; + } + return null; + } + + // State field(s) for emailRegisterForm widget. + FocusNode? emailRegisterFormFocusNode; + TextEditingController? emailRegisterFormTextController; + String? Function(BuildContext, String?)? + emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'w3nl41ps' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + + // State field(s) for passwordRegisterForm widget. + FocusNode? passwordRegisterFormFocusNode; + TextEditingController? passwordRegisterFormTextController; + late bool passwordRegisterFormVisibility; + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'ql1bxvno' /* Campo é necessário */, + ); + } + + return null; + } + + // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. + bool? signUp; @override void initState(BuildContext context) { - signUpTemplateComponentModel = - createModel(context, () => SignUpTemplateComponentModel()); + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; + passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; } @override void dispose() { unfocusNode.dispose(); - signUpTemplateComponentModel.dispose(); + nameRegisterFormFocusNode?.dispose(); + nameRegisterFormTextController?.dispose(); + + emailRegisterFormFocusNode?.dispose(); + emailRegisterFormTextController?.dispose(); + + passwordRegisterFormFocusNode?.dispose(); + passwordRegisterFormTextController?.dispose(); } } diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index 18c575ec..3c087762 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -1,8 +1,14 @@ -import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; import 'sign_up_page_model.dart'; export 'sign_up_page_model.dart'; @@ -13,15 +19,64 @@ class SignUpPageWidget extends StatefulWidget { State createState() => _SignUpPageWidgetState(); } -class _SignUpPageWidgetState extends State { +class _SignUpPageWidgetState extends State + with TickerProviderStateMixin { late SignUpPageModel _model; final scaffoldKey = GlobalKey(); + final animationsMap = {}; + @override void initState() { super.initState(); _model = createModel(context, () => SignUpPageModel()); + + _model.nameRegisterFormTextController ??= TextEditingController(); + _model.nameRegisterFormFocusNode ??= FocusNode(); + _model.nameRegisterFormFocusNode!.addListener(() => setState(() {})); + _model.emailRegisterFormTextController ??= TextEditingController(); + _model.emailRegisterFormFocusNode ??= FocusNode(); + _model.emailRegisterFormFocusNode!.addListener(() => setState(() {})); + _model.passwordRegisterFormTextController ??= TextEditingController(); + _model.passwordRegisterFormFocusNode ??= FocusNode(); + _model.passwordRegisterFormFocusNode!.addListener(() => setState(() {})); + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); } @override @@ -33,6 +88,8 @@ class _SignUpPageWidgetState extends State { @override Widget build(BuildContext context) { + context.watch(); + return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) @@ -42,16 +99,819 @@ class _SignUpPageWidgetState extends State { backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: wrapWithModel( - model: _model.signUpTemplateComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: SignUpTemplateComponentWidget( - toggleSignInPage: () async { - await action_blocks.toggleSignInPage(context); - setState(() {}); - }, - ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 6, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + alignment: const AlignmentDirectional(0.0, -1.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + width: 669.0, + height: 112.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + FFLocalizations.of(context).getText( + 'bv7d4en2' /* INSIRA SEU EMAIL E SENHA, VAMO... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Container( + width: 291.0, + height: 167.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: SvgPicture.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', + width: 603.0, + height: 155.0, + fit: BoxFit.contain, + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(34.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + borderRadius: BorderRadius.circular(12.0), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.disabled, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .nameRegisterFormTextController, + focusNode: _model + .nameRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce + .debounce( + '_model.nameRegisterFormTextController', + const Duration( + milliseconds: + 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.name + ], + obscureText: false, + decoration: + InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + 'evcb30xo' /* Nome */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + filled: true, + fillColor: FlutterFlowTheme + .of(context) + .primaryBackground, + suffixIcon: Icon( + Icons.person, + color: FlutterFlowTheme + .of(context) + .accent1, + size: 22.0, + ), + ), + style: + FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType.name, + validator: _model + .nameRegisterFormTextControllerValidator + .asValidator( + context), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailRegisterFormTextController, + focusNode: _model + .emailRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce + .debounce( + '_model.emailRegisterFormTextController', + const Duration( + milliseconds: + 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.email + ], + obscureText: false, + decoration: + InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + 'p7snp67t' /* Email */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .primaryText, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + filled: true, + fillColor: FlutterFlowTheme + .of(context) + .primaryBackground, + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme + .of(context) + .accent1, + size: 22.0, + ), + ), + style: + FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .customColor1, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType + .emailAddress, + validator: _model + .emailRegisterFormTextControllerValidator + .asValidator( + context), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordRegisterFormTextController, + focusNode: _model + .passwordRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce + .debounce( + '_model.passwordRegisterFormTextController', + const Duration( + milliseconds: + 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.password + ], + obscureText: !_model + .passwordRegisterFormVisibility, + decoration: + InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + 'u30lpbvg' /* Senha */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: + BorderSide( + color: FlutterFlowTheme + .of(context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0xFF1AAB5F), + width: 0.25, + ), + borderRadius: + BorderRadius + .circular( + 12.0), + ), + 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), + ), + filled: true, + fillColor: FlutterFlowTheme + .of(context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => + setState( + () => _model + .passwordRegisterFormVisibility = + !_model + .passwordRegisterFormVisibility, + ), + focusNode: FocusNode( + skipTraversal: + true), + child: Icon( + _model.passwordRegisterFormVisibility + ? 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: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordRegisterFormTextControllerValidator + .asValidator( + context), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: (((_model.nameRegisterFormTextController + .text != + '') || + ((_model + .nameRegisterFormFocusNode?.hasFocus ?? + false) != + null)) && + ((_model.emailRegisterFormTextController + .text != + '') || + ((_model.emailRegisterFormFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.passwordRegisterFormTextController + .text != + '') || + ((_model.passwordRegisterFormFocusNode + ?.hasFocus ?? + false) != + null))) + ? null + : () async { + var shouldSetState = + false; + _model.signUp = + await action_blocks + .signUpRegisterAction( + context, + name: _model + .nameRegisterFormTextController + .text, + passwd: _model + .passwordRegisterFormTextController + .text, + email: _model + .emailRegisterFormTextController + .text, + device: FFAppState() + .device, + ); + shouldSetState = true; + if (_model.signUp != + true) { + if (shouldSetState) { + setState(() {}); + } + return; + } + if (shouldSetState) { + setState(() {}); + } + }, + text: + FFLocalizations.of(context) + .getText( + '2a4f1t3w' /* Cadastrar-se */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .accent1, + textStyle: FlutterFlowTheme + .of(context) + .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, + width: 1.0, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + showLoadingIndicator: false, + ), + ), + + // You will have to add an action on this rich text to go to your login page. + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: RichText( + textScaler: + MediaQuery.of(context) + .textScaler, + text: TextSpan( + children: [ + TextSpan( + text: FFLocalizations.of( + context) + .getText( + 'uy41jbvn' /* Você já tem uma conta? */, + ), + style: TextStyle( + color: + FlutterFlowTheme.of( + context) + .primaryText, + ), + ), + TextSpan( + text: FFLocalizations.of( + context) + .getText( + 'ynungy80' /* Clique aqui */, + ), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w600, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ) + ], + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ), + ), + ).animateOnPageLoad(animationsMap[ + 'containerOnPageLoadAnimation']!), + ), + ), + ], + ), + Text( + FFLocalizations.of(context).getText( + 'r5rm6pll' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .secondaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ], + ), + ), + ), + ), + ), + ], ), ), ), diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index b8a54a7e..ae64ac31 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -1,4 +1,3 @@ -import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'welcome_page_widget.dart' show WelcomePageWidget; import 'package:flutter/material.dart'; @@ -11,18 +10,12 @@ class WelcomePageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - // Model for welcomeTemplateComponent component. - late WelcomeTemplateComponentModel welcomeTemplateComponentModel; @override - void initState(BuildContext context) { - welcomeTemplateComponentModel = - createModel(context, () => WelcomeTemplateComponentModel()); - } + void initState(BuildContext context) {} @override void dispose() { unfocusNode.dispose(); - welcomeTemplateComponentModel.dispose(); } } diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index 6089703a..7c0bab8f 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -1,9 +1,12 @@ -import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/actions/actions.dart' as action_blocks; +import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'welcome_page_model.dart'; export 'welcome_page_model.dart'; @@ -15,11 +18,14 @@ class WelcomePageWidget extends StatefulWidget { State createState() => _WelcomePageWidgetState(); } -class _WelcomePageWidgetState extends State { +class _WelcomePageWidgetState extends State + with TickerProviderStateMixin { late WelcomePageModel _model; final scaffoldKey = GlobalKey(); + final animationsMap = {}; + @override void initState() { super.initState(); @@ -38,6 +44,43 @@ class _WelcomePageWidgetState extends State { setState(() {}); } }); + + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); } @override @@ -60,17 +103,381 @@ class _WelcomePageWidgetState extends State { backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: wrapWithModel( - model: _model.welcomeTemplateComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: WelcomeTemplateComponentWidget( - toggleSignUpPage: () async { - await action_blocks.toggleSignUpPage(context); - }, - toggleSignInPage: () async { - await action_blocks.toggleSignInPage(context); - }, + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SafeArea( + child: Container( + width: 648.0, + height: 208.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + FFLocalizations.of(context).getText( + '77d2ypub' /* UMA EXPERIÊCIA COMPLETA */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .accent1, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Text( + FFLocalizations.of(context).getText( + 'avhdhlhw' /* COM CONFORTO ONDE VOCÊ ESTIVER... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ), + Container( + width: 284.0, + height: 200.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: SvgPicture.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', + width: 603.0, + height: double.infinity, + fit: BoxFit.contain, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(34.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + boxShadow: const [ + BoxShadow( + blurRadius: 0.0, + color: Colors.transparent, + offset: Offset( + 0.0, + 0.0, + ), + ) + ], + borderRadius: BorderRadius.circular(12.0), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Builder( + builder: (context) { + 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), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: FFLocalizations.of(context) + .getText( + 'iw9yx5fr' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of(context) + .primary, + textStyle: + FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: FFLocalizations.of(context) + .getText( + 'bs5mbse6' /* Cadastrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of(context) + .customColor1, + textStyle: + FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryBackground, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ], + ); + } else { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: + FFLocalizations.of(context) + .getText( + 'cq85bqnj' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .primary, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: + FFLocalizations.of(context) + .getText( + 'iupuq6xs' /* Cadastrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .primary, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + ].divide(const SizedBox(width: 7.0)), + ); + } + }, + ), + ], + ), + ), + ), + ).animateOnPageLoad( + animationsMap['containerOnPageLoadAnimation']!), + ), + ), + ], + ), ), ), ), From dc9bc215b9b9298495f6383b6f8e0eff303b785b Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 26 Jul 2024 16:50:48 -0300 Subject: [PATCH 13/34] chore: Update MenuComponentWidget to use const constructor --- lib/pages/home_page/home_page_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index d9185a2c..6955a811 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -165,7 +165,7 @@ class _HomePageWidgetState extends State { wrapWithModel( model: _model.menuComponentModel, updateCallback: () => setState(() {}), - child: MenuComponentWidget( + child: const MenuComponentWidget( expandable: true, style: MenuView.list_grid, item: MenuItem.button, From 68942bbc34591d7a98f6b45d47dd598bf87b2d30 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Fri, 26 Jul 2024 17:23:19 -0300 Subject: [PATCH 14/34] fix: Carregamento de Imagem de Welcome Offline --- assets/images/dark/login.svg:Zone.Identifier | 3 - .../images/dark/welcome.svg:Zone.Identifier | 3 - assets/images/light/login.svg:Zone.Identifier | 3 - .../images/light/welcome.svg:Zone.Identifier | 3 - ios/Podfile.lock | 2 +- .../atom_image_svg_theme.dart | 208 ++---------------- .../menu_component/menu_component_widget.dart | 22 +- .../welcome_template_component_widget.dart | 9 +- 8 files changed, 32 insertions(+), 221 deletions(-) delete mode 100644 assets/images/dark/login.svg:Zone.Identifier delete mode 100644 assets/images/dark/welcome.svg:Zone.Identifier delete mode 100644 assets/images/light/login.svg:Zone.Identifier delete mode 100644 assets/images/light/welcome.svg:Zone.Identifier diff --git a/assets/images/dark/login.svg:Zone.Identifier b/assets/images/dark/login.svg:Zone.Identifier deleted file mode 100644 index 1bf0b28e..00000000 --- a/assets/images/dark/login.svg:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -HostUrl=https://github.com/ diff --git a/assets/images/dark/welcome.svg:Zone.Identifier b/assets/images/dark/welcome.svg:Zone.Identifier deleted file mode 100644 index 1bf0b28e..00000000 --- a/assets/images/dark/welcome.svg:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -HostUrl=https://github.com/ diff --git a/assets/images/light/login.svg:Zone.Identifier b/assets/images/light/login.svg:Zone.Identifier deleted file mode 100644 index 1bf0b28e..00000000 --- a/assets/images/light/login.svg:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -HostUrl=https://github.com/ diff --git a/assets/images/light/welcome.svg:Zone.Identifier b/assets/images/light/welcome.svg:Zone.Identifier deleted file mode 100644 index 1bf0b28e..00000000 --- a/assets/images/light/welcome.svg:Zone.Identifier +++ /dev/null @@ -1,3 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -HostUrl=https://github.com/ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 20609413..dbd080c3 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -311,6 +311,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 -PODFILE CHECKSUM: f2b7abe080b8e8f49e642b85431f5117d22149fe +PODFILE CHECKSUM: d7f4d1b71f8c708247c1078c4aec33a28c763405 COCOAPODS: 1.15.2 diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart index f2173bfd..94484ab5 100644 --- a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -1,199 +1,25 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; -import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; -import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; -import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +class AtomImageSvgTheme extends StatelessWidget { + final String filename; + final double width; + final double height; -class PreferencesPageWidget extends StatelessWidget { - const PreferencesPageWidget({super.key}); + const AtomImageSvgTheme({ + super.key, + required this.filename, + required this.width, + required this.height + }); @override Widget build(BuildContext context) { - return ChangeNotifierProvider( - create: (_) => PreferencesPageModel(), - child: Consumer( - builder: (context, model, child) => GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Preferences', - ptText: 'Preferências', - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 17.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - centerTitle: true, - elevation: 0.0, - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [ - Container(), - Expanded( - flex: 2, - child: ListView.builder( - // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - // crossAxisCount: 3, - // crossAxisSpacing: 12.0, - // mainAxisSpacing: 12.0, - // childAspectRatio: 1.0, - // mainAxisExtent: 100.0, - // ), - itemCount: 6, // Assuming 4 items for simplicity - padding: const EdgeInsets.symmetric(horizontal: 20.0), - physics: const AlwaysScrollableScrollPhysics(), - itemBuilder: (BuildContext context, int index) { - return _buildIconButton(context, index, model); - }, - ), - ), - ], - ), - ), - ), - ), - ); + final brightness = MediaQuery.of(context).platformBrightness; + final isDarkMode = brightness == Brightness.dark; + final path = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg"; + + return SvgPicture.asset(path, width: width, height: height); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { - IconData icon; - Function() onPressed =() => {}; - bool isEnabled; - String content; - - switch (index) { - case 0: - icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false - isEnabled = FFAppState().fingerprint; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative a autenticação por impressão digital para login seguro.', - enText: 'Enable fingerprint authentication for secure login.', - ); - break; - case 1: - icon = Icons.person; - onPressed = () => model.enablePerson(context); - isEnabled = FFAppState().person; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Exibir código de identificação remota', - enText: 'Display remote identification code', - ); - break; - case 2: - icon = Icons.notifications; - onPressed = model.toggleNotify; - isEnabled = FFAppState().notify; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para receber sua notificação de acesso', - enText: 'Enable to receive your access notification', - ); - break; - case 3: - icon = Icons.lock_clock_sharp; - // onLongPress = model.togglePass(context, model); - isEnabled = FFAppState().pass; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para inserir uma credencial de acesso para o QRCode', - enText: 'Enable to enter an access credential for the QRCode', - ); - break; - case 4: - icon = Icons.landscape; - onPressed = model.localLogout; - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para se desvincular do local selecionado', - enText: 'Enable to unlink from the selected location', - ); - break; - case 5: - icon = Icons.delete; - onPressed = () => model.deleteAccount(context); - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Delete sua conta e todos os dados associados permanentemente.', - enText: 'Delete your account and all associated data permanently.', - ); - break; - default: - throw Exception('Invalid index: $index'); - } - - return Container( - height: 100, - child: GestureDetector( - onTap: index != 3 ? onPressed : () {model.togglePass(context);}, - child: Row( - children: [ - CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, - child: Icon( - icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, - // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), - // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, - // borderRadius: 20.0, - // borderWidth: 1.0, - // buttonSize: 40.0, - // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, - // disabledColor: FlutterFlowTheme.of(context).alternate, - // disabledIconColor: FlutterFlowTheme.of(context).primary, - ), - ), - SizedBox(width: 8.0), - Expanded( - child: Text( - content, - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), - overflow: TextOverflow.clip, - ), - ), - ], - ), - ), - ); - } -} \ No newline at end of file +} diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index bbe0830f..5839264c 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -58,35 +58,35 @@ class _MenuComponentWidgetState extends State { Widget build(BuildContext context) { final options = widget.item == MenuItem.button ? [ - MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar/Visita' ,),), + MenuButtonWidget(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule\nVisit' , ptText:'Agendar\nVisita' ,),), - MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro de Visitante' ,),), + MenuButtonWidget(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\nVisitor' , ptText:'Cadastro\nde Visitante' ,),), // MenuButtonWidget(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link\nCondominum' , ptText:'' ,),), // MenuButtonWidget(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), - MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'' ,),), + MenuButtonWidget(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode\nAccess' , ptText:'QRCode\nde Acesso' ,),), - MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'' ,),), + MenuButtonWidget(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on\nthe Property' , ptText:'Pessoas na\nPropriedade' ,),), - MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'' ,),), + MenuButtonWidget(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult\nHistories' , ptText:'Consultar\nHistóricos' ,),), - MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'' ,),), + MenuButtonWidget(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences\nSettings' , ptText:'Configurações' ,),), ] : [ - MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar/Visita' ,),), + MenuCardItem(icon: FFIcons.kvector1, action: () async { await _model.scheduleVisitOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Schedule Visit' , ptText:'Agendar\nVisita' ,),), MenuCardItem(icon: FFIcons.khome, action: () async {await _model.registerVisitorOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register Visitor' , ptText:'Cadastro de Visitante' ,),), // MenuCardItem(icon: FFIcons.kvector2, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Link Condominum' , ptText:'' ,),), // MenuCardItem(icon: FFIcons.kpets, action: () async {setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Register\Pet' , ptText:'' ,),), - MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'' ,),), + MenuCardItem(icon: Icons.qr_code, action: () async {await _model.accessQRCodeOptAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'QRCode Access' , ptText:'QRCode de Acesso' ,),), - MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'' ,),), + MenuCardItem(icon: Icons.people, action: () async {await _model.peopleOnThePropertyAction(context); setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Poeple on the Property' , ptText:'Pessoas na Propriedade' ,),), - MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'' ,),), + MenuCardItem(icon: Icons.history_sharp, action: () async {await _model.liberationHistoryOptAction(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Consult Histories' , ptText:'Consultar Historicos' ,),), - MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'' ,),), + MenuCardItem(icon: Icons.settings, action: () async {await _model.preferencesSettings(context);setState(() {});}, title: FFLocalizations.of(context).getVariableText(enText:'Preferences Settings' , ptText:'Configurações' ,),), ]; return Padding( diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index bdb465b1..e0b97fe2 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; + import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -164,12 +166,7 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', - width: 603.0, - height: double.infinity, - fit: BoxFit.contain, - ), + child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity), ), ), Align( From eb775ca85b8fe7cf19379e72b61a085794a2fca5 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 26 Jul 2024 20:33:03 +0000 Subject: [PATCH 15/34] rollback --- ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/actions/actions.dart | 2 +- .../text_field_component_model.dart | 0 .../text_field_component_widget.dart | 0 .../opt_modal/opt_modal_model.dart | 0 .../opt_modal/opt_modal_widget.dart | 0 .../option_selection_modal_model.dart | 0 .../option_selection_modal_widget.dart | 0 .../throw_exception_model.dart | 0 .../throw_exception_widget.dart | 0 .../visitor_not_found_component_model.dart | 0 .../visitor_not_found_component_widget.dart | 2 +- .../arrow_linked_locals_component_model.dart | 0 .../arrow_linked_locals_component_widget.dart | 0 ...m_arrow_linked_locals_component_model.dart | 0 ..._arrow_linked_locals_component_widget.dart | 0 .../local_profile_component_model.dart | 12 + .../local_profile_component_widget.dart | 151 + .../menu_component/menu_component_model.dart | 117 + .../menu_component/menu_component_widget.dart | 120 + .../menu_list_view_component_model.dart | 12 + .../menu_list_view_component_widget.dart | 1096 ++++++ .../menu_staggered_view_component_model.dart | 13 + .../menu_staggered_view_component_widget.dart | 1161 ++++++ .../message_well_component_model.dart | 12 + .../message_well_component_widget.dart | 125 + .../schedule_visit_detail_model.dart | 0 .../schedule_visit_detail_widget.dart | 4 +- ...p_arrow_linked_locals_component_model.dart | 0 ..._arrow_linked_locals_component_widget.dart | 0 ...cation_modal_template_component_model.dart | 0 ...ation_modal_template_component_widget.dart | 0 .../card_item_template_component_model.dart | 0 .../card_item_template_component_widget.dart | 0 ...got_password_template_component_model.dart | 0 ...ot_password_template_component_widget.dart | 2 +- ...item_details_template_component_model.dart | 0 ...tem_details_template_component_widget.dart | 0 ...ode_pass_key_template_component_model.dart | 0 ...de_pass_key_template_component_widget.dart | 0 ...siter_vistor_template_component_model.dart | 0 ...iter_vistor_template_component_widget.dart | 2 +- .../sign_in_template_component_model.dart | 61 + .../sign_in_template_component_widget.dart | 1026 ++++++ .../sign_up_template_component_model.dart | 91 + .../sign_up_template_component_widget.dart | 866 +++++ .../view_visit_detail_model.dart | 0 .../view_visit_detail_widget.dart | 4 +- ...etails_modal_template_component_model.dart | 4 +- ...tails_modal_template_component_widget.dart | 4 +- ...isit_request_template_component_model.dart | 0 ...sit_request_template_component_widget.dart | 0 ...etails_modal_template_component_model.dart | 0 ...tails_modal_template_component_widget.dart | 0 ...search_modal_template_component_model.dart | 0 ...earch_modal_template_component_widget.dart | 4 +- .../welcome_template_component_model.dart | 13 + .../welcome_template_component_widget.dart | 445 +++ lib/flutter_flow/internationalization.dart | 466 +-- .../acess_history_page_model.dart | 2 +- .../acess_history_page_widget.dart | 2 +- lib/pages/home_page/home_page_model.dart | 21 +- lib/pages/home_page/home_page_widget.dart | 3176 +---------------- .../qr_code_page/qr_code_page_widget.dart | 2 +- .../register_visitor_page_widget.dart | 2 +- .../schedule_complete_visit_page_widget.dart | 8 +- ...chedule_provisional_visit_page_widget.dart | 4 +- .../sign_in_page/sign_in_page_model.dart | 49 +- .../sign_in_page/sign_in_page_widget.dart | 1094 +----- .../sign_up_page/sign_up_page_model.dart | 79 +- .../sign_up_page/sign_up_page_widget.dart | 884 +---- .../welcome_page/welcome_page_model.dart | 9 +- .../welcome_page/welcome_page_widget.dart | 435 +-- 73 files changed, 5684 insertions(+), 5906 deletions(-) rename lib/{modals => components/atomic_components}/text_field_component/text_field_component_model.dart (100%) rename lib/{modals => components/atomic_components}/text_field_component/text_field_component_widget.dart (100%) rename lib/{modals => components/molecular_components}/opt_modal/opt_modal_model.dart (100%) rename lib/{modals => components/molecular_components}/opt_modal/opt_modal_widget.dart (100%) rename lib/{modals => components/molecular_components}/option_selection_modal/option_selection_modal_model.dart (100%) rename lib/{modals => components/molecular_components}/option_selection_modal/option_selection_modal_widget.dart (100%) rename lib/{modals => components/molecular_components}/throw_exception/throw_exception_model.dart (100%) rename lib/{modals => components/molecular_components}/throw_exception/throw_exception_widget.dart (100%) rename lib/{modals => components/molecular_components}/visitor_not_found_component/visitor_not_found_component_model.dart (100%) rename lib/{modals => components/molecular_components}/visitor_not_found_component/visitor_not_found_component_widget.dart (98%) rename lib/{modals => components/organism_components}/arrow_linked_locals_component/arrow_linked_locals_component_model.dart (100%) rename lib/{modals => components/organism_components}/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart (100%) rename lib/{modals => components/organism_components}/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart (100%) rename lib/{modals => components/organism_components}/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart (100%) create mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_model.dart create mode 100644 lib/components/organism_components/local_profile_component/local_profile_component_widget.dart create mode 100644 lib/components/organism_components/menu_component/menu_component_model.dart create mode 100644 lib/components/organism_components/menu_component/menu_component_widget.dart create mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart create mode 100644 lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart create mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart create mode 100644 lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart create mode 100644 lib/components/organism_components/message_well_component/message_well_component_model.dart create mode 100644 lib/components/organism_components/message_well_component/message_well_component_widget.dart rename lib/{modals => components/organism_components}/schedule_visit_detail/schedule_visit_detail_model.dart (100%) rename lib/{modals => components/organism_components}/schedule_visit_detail/schedule_visit_detail_widget.dart (99%) rename lib/{modals => components/organism_components}/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart (100%) rename lib/{modals => components/organism_components}/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart (100%) rename lib/{modals => components/templates_components}/access_notification_modal_template_component/access_notification_modal_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/card_item_template_component/card_item_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/card_item_template_component/card_item_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/forgot_password_template_component/forgot_password_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/forgot_password_template_component/forgot_password_template_component_widget.dart (99%) rename lib/{modals => components/templates_components}/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart (99%) create mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart create mode 100644 lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart create mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart create mode 100644 lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart rename lib/{modals => components/templates_components}/view_visit_detail/view_visit_detail_model.dart (100%) rename lib/{modals => components/templates_components}/view_visit_detail/view_visit_detail_widget.dart (99%) rename lib/{modals => components/templates_components}/visit_details_modal_template_component/visit_details_modal_template_component_model.dart (84%) rename lib/{modals => components/templates_components}/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart (95%) rename lib/{modals => components/templates_components}/visit_request_template_component/visit_request_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/visit_request_template_component/visit_request_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart (100%) rename lib/{modals => components/templates_components}/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart (100%) rename lib/{modals => components/templates_components}/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart (99%) create mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart create mode 100644 lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a5237d97..806c139f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409127A31CDF00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409E27A31CD200820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409D27A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409127A31CDF00820AF7 /* pt */, - 6436409E27A31CD200820AF7 /* en */, + 6436409D27A31CDC00820AF7 /* pt */, + 6436409227A31CDD00820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 31ae88e8..30c1b6b9 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,7 +1,7 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; import '/actions/actions.dart' as action_blocks; import '/custom_code/actions/index.dart' as actions; import '/flutter_flow/random_data_util.dart' as random_data; diff --git a/lib/modals/text_field_component/text_field_component_model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart similarity index 100% rename from lib/modals/text_field_component/text_field_component_model.dart rename to lib/components/atomic_components/text_field_component/text_field_component_model.dart diff --git a/lib/modals/text_field_component/text_field_component_widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart similarity index 100% rename from lib/modals/text_field_component/text_field_component_widget.dart rename to lib/components/atomic_components/text_field_component/text_field_component_widget.dart diff --git a/lib/modals/opt_modal/opt_modal_model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart similarity index 100% rename from lib/modals/opt_modal/opt_modal_model.dart rename to lib/components/molecular_components/opt_modal/opt_modal_model.dart diff --git a/lib/modals/opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart similarity index 100% rename from lib/modals/opt_modal/opt_modal_widget.dart rename to lib/components/molecular_components/opt_modal/opt_modal_widget.dart diff --git a/lib/modals/option_selection_modal/option_selection_modal_model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart similarity index 100% rename from lib/modals/option_selection_modal/option_selection_modal_model.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart diff --git a/lib/modals/option_selection_modal/option_selection_modal_widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart similarity index 100% rename from lib/modals/option_selection_modal/option_selection_modal_widget.dart rename to lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart diff --git a/lib/modals/throw_exception/throw_exception_model.dart b/lib/components/molecular_components/throw_exception/throw_exception_model.dart similarity index 100% rename from lib/modals/throw_exception/throw_exception_model.dart rename to lib/components/molecular_components/throw_exception/throw_exception_model.dart diff --git a/lib/modals/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart similarity index 100% rename from lib/modals/throw_exception/throw_exception_widget.dart rename to lib/components/molecular_components/throw_exception/throw_exception_widget.dart diff --git a/lib/modals/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart similarity index 100% rename from lib/modals/visitor_not_found_component/visitor_not_found_component_model.dart rename to lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart diff --git a/lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart similarity index 98% rename from lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart rename to lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index d161d91e..115a6304 100644 --- a/lib/modals/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,8 +1,8 @@ +import '/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'visitor_not_found_component_model.dart'; diff --git a/lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart similarity index 100% rename from lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_model.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart diff --git a/lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart similarity index 100% rename from lib/modals/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart rename to lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart diff --git a/lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart similarity index 100% rename from lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart rename to lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart diff --git a/lib/modals/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 similarity index 100% rename from lib/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart rename to lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart new file mode 100644 index 00000000..25442482 --- /dev/null +++ b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart @@ -0,0 +1,12 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; +import 'package:flutter/material.dart'; + +class LocalProfileComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart new file mode 100644 index 00000000..80e43f30 --- /dev/null +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -0,0 +1,151 @@ +import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/custom_functions.dart' as functions; +import '/flutter_flow/random_data_util.dart' as random_data; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; +import 'local_profile_component_model.dart'; +export 'local_profile_component_model.dart'; + +class LocalProfileComponentWidget extends StatefulWidget { + const LocalProfileComponentWidget({super.key}); + + @override + State createState() => + _LocalProfileComponentWidgetState(); +} + +class _LocalProfileComponentWidgetState + extends State { + late LocalProfileComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => LocalProfileComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Visibility( + visible: random_data.randomInteger(0, 10) != null, + child: Container( + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Material( + color: Colors.transparent, + elevation: 0.0, + child: Container( + width: double.infinity, + height: 119.0, + decoration: BoxDecoration( + color: const Color(0xFF1AAB5F), + border: Border.all( + color: const Color(0xFF1AAB5F), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(2.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: const Color(0x00FFFFFF), + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const SizedBox( + height: double.infinity, + child: + BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(200.0), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + errorBuilder: (context, error, stackTrace) => + Image.asset( + 'assets/images/error_image.svg', + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + ), + ), + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + valueOrDefault( + functions.convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).info, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + ], + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 20.0)) + .addToEnd(const SizedBox(width: 20.0)), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart new file mode 100644 index 00000000..d50f9dfe --- /dev/null +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -0,0 +1,117 @@ +import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_component_widget.dart' show MenuComponentWidget; +import 'package:flutter/material.dart'; + +class MenuComponentModel extends FlutterFlowModel { + /// Local state fields for this component. + + bool isGrid = false; + + /// State fields for stateful widgets in this component. + + // Model for menuListViewComponent. + late MenuListViewComponentModel menuListViewComponentModel; + // Model for menuStaggeredViewComponent. + late MenuStaggeredViewComponentModel menuStaggeredViewComponentModel; + + @override + void initState(BuildContext context) { + menuListViewComponentModel = + createModel(context, () => MenuListViewComponentModel()); + menuStaggeredViewComponentModel = + createModel(context, () => MenuStaggeredViewComponentModel()); + } + + @override + void dispose() { + menuListViewComponentModel.dispose(); + menuStaggeredViewComponentModel.dispose(); + } + + /// Action blocks. + Future changeMenuStyle(BuildContext context) async { + isGrid = !isGrid; + } + + Future scheduleVisitOptAction(BuildContext context) async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const OptionSelectionModalWidget(), + ); + }, + ); + } + + Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); + } + + Future acessHistoryOptAction(BuildContext context) async { + context.pushNamed( + 'acessHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future liberationHistoryOptAction(BuildContext context) async { + context.pushNamed( + 'liberationHistory', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } +} diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart new file mode 100644 index 00000000..79afe54b --- /dev/null +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -0,0 +1,120 @@ +import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; +import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'menu_component_model.dart'; +export 'menu_component_model.dart'; + +class MenuComponentWidget extends StatefulWidget { + const MenuComponentWidget({super.key}); + + @override + State createState() => _MenuComponentWidgetState(); +} + +class _MenuComponentWidgetState extends State { + late MenuComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Builder( + builder: (context) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + acessHistoryOptAction: () async { + await _model.acessHistoryOptAction(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + changeMenuStyleAction: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + accessHistoryOptAction: () async { + await _model.acessHistoryOptAction(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + ), + ); + } + }, + ), + ); + } +} diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart new file mode 100644 index 00000000..7ce9985b --- /dev/null +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart @@ -0,0 +1,12 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; +import 'package:flutter/material.dart'; + +class MenuListViewComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart new file mode 100644 index 00000000..0f7b62aa --- /dev/null +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -0,0 +1,1096 @@ +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'menu_list_view_component_model.dart'; +export 'menu_list_view_component_model.dart'; + +class MenuListViewComponentWidget extends StatefulWidget { + const MenuListViewComponentWidget({ + super.key, + required this.changeMenuStyle, + required this.registerVisitorOptAction, + required this.scheduleVisitOptAction, + required this.peopleOnThePropertyOptAction, + required this.acessHistoryOptAction, + required this.liberationHistoryOptAction, + required this.accessQRCodeOptAction, + }); + + final Future Function()? changeMenuStyle; + final Future Function()? registerVisitorOptAction; + final Future Function()? scheduleVisitOptAction; + final Future Function()? peopleOnThePropertyOptAction; + final Future Function()? acessHistoryOptAction; + final Future Function()? liberationHistoryOptAction; + final Future Function()? accessQRCodeOptAction; + + @override + State createState() => + _MenuListViewComponentWidgetState(); +} + +class _MenuListViewComponentWidgetState + extends State { + late MenuListViewComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuListViewComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), + child: Container( + width: double.infinity, + height: 125.0, + decoration: const BoxDecoration(), + child: ListView( + padding: const EdgeInsets.fromLTRB( + 10.0, + 0, + 10.0, + 0, + ), + scrollDirection: Axis.horizontal, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.scheduleVisitOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.kvector1, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'utgue9a5' /* Agendar +Visita */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.registerVisitorOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.kvector, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '82b5f8yz' /* Cadastrar +Visitante */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.khome, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 't4ie13ut' /* Vincular +Condomínio */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.kpets, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'n3n76pha' /* Cadastrar +Pet */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.accessQRCodeOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.kvector2, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'l6b9o7yn' /* QR Code +de Acesso */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.peopleOnThePropertyOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + Icons.people, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rxnrtdau' /* Pessoas na +Propriedade */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.acessHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + Icons.history_sharp, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'nxssjz3q' /* Consultar +Históricos */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.acessHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + Icons.history_sharp, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '589qufkw' /* Histórico +de Acesso */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.liberationHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + Icons.history_sharp, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '944g4ib1' /* Histórico +de Liberação */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ), + ].divide(const SizedBox(width: 15.0)), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_down_outlined, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ); + } +} diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart new file mode 100644 index 00000000..8aebfc69 --- /dev/null +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart @@ -0,0 +1,13 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'menu_staggered_view_component_widget.dart' + show MenuStaggeredViewComponentWidget; +import 'package:flutter/material.dart'; + +class MenuStaggeredViewComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart new file mode 100644 index 00000000..f4db990c --- /dev/null +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -0,0 +1,1161 @@ +import '/flutter_flow/flutter_flow_icon_button.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'menu_staggered_view_component_model.dart'; +export 'menu_staggered_view_component_model.dart'; + +class MenuStaggeredViewComponentWidget extends StatefulWidget { + const MenuStaggeredViewComponentWidget({ + super.key, + required this.changeMenuStyleAction, + required this.registerVisitorOptAction, + required this.scheduleVisitOptAction, + required this.peopleOnThePropertyOptAction, + required this.accessHistoryOptAction, + required this.liberationHistoryOptAction, + required this.accessQRCodeOptAction, + }); + + final Future Function()? changeMenuStyleAction; + final Future Function()? registerVisitorOptAction; + final Future Function()? scheduleVisitOptAction; + final Future Function()? peopleOnThePropertyOptAction; + final Future Function()? accessHistoryOptAction; + final Future Function()? liberationHistoryOptAction; + final Future Function()? accessQRCodeOptAction; + + @override + State createState() => + _MenuStaggeredViewComponentWidgetState(); +} + +class _MenuStaggeredViewComponentWidgetState + extends State { + late MenuStaggeredViewComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MenuStaggeredViewComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + Container( + width: double.infinity, + height: MediaQuery.sizeOf(context).height * 0.498, + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: MasonryGridView.builder( + physics: const NeverScrollableScrollPhysics(), + gridDelegate: const SliverSimpleGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + ), + crossAxisSpacing: 10.0, + mainAxisSpacing: 10.0, + itemCount: 9, + padding: const EdgeInsets.fromLTRB( + 0, + 10.0, + 0, + 10.0, + ), + shrinkWrap: true, + itemBuilder: (context, index) { + return [ + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.scheduleVisitOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + FFIcons.kvector1, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'ee33l0ms' /* Agendar +Visita */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.registerVisitorOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + FFIcons.kvector, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'ya37l3jt' /* Cadastrar + Visitante */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.khome, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'h8s3adu8' /* Vincular +Condomínio */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + () => Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Icon( + FFIcons.kpets, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'j6tfixen' /* Cadastrar +Pet */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.accessQRCodeOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + FFIcons.kvector2, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '9tli4i2x' /* QR Code +de Acesso */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.peopleOnThePropertyOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + Icons.people, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'i22hecs8' /* Pessoas na +Propriedade */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.accessHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + Icons.history_sharp, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '6jzghbyi' /* Histórico +de Acesso */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.liberationHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + Icons.history_sharp, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'u8qu4v6q' /* Histórico +de Liberação */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + () => InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.liberationHistoryOptAction?.call(); + }, + child: Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: + FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 0.0, 0.0), + child: Container( + width: 30.0, + height: 30.0, + decoration: BoxDecoration( + color: + FlutterFlowTheme.of(context) + .primaryBackground, + shape: BoxShape.circle, + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Icon( + Icons.settings_rounded, + color: + FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + ), + ), + ), + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'dzk31zpc' /* Preferencias +do Sistema */ + , + ), + style: FlutterFlowTheme.of(context) + .titleLarge + .override( + fontFamily: 'Nunito', + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap() + .containsKey('Nunito'), + ), + ), + ), + ], + ), + ), + ].divide(const SizedBox(height: 0.0)), + ), + ), + ), + ), + ][index](); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), + ), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_up_sharp, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyleAction?.call(); + }, + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart new file mode 100644 index 00000000..3da2a723 --- /dev/null +++ b/lib/components/organism_components/message_well_component/message_well_component_model.dart @@ -0,0 +1,12 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'message_well_component_widget.dart' show MessageWellComponentWidget; +import 'package:flutter/material.dart'; + +class MessageWellComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart new file mode 100644 index 00000000..d8a5b8b8 --- /dev/null +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -0,0 +1,125 @@ +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'message_well_component_model.dart'; +export 'message_well_component_model.dart'; + +class MessageWellComponentWidget extends StatefulWidget { + const MessageWellComponentWidget({super.key}); + + @override + State createState() => + _MessageWellComponentWidgetState(); +} + +class _MessageWellComponentWidgetState + extends State { + late MessageWellComponentModel _model; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => MessageWellComponentModel()); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 40.0, 0.0, 0.0), + child: Container( + width: double.infinity, + height: 167.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + FFLocalizations.of(context).getText( + '8fworxmb' /* Mural de Mensagens */, + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Nunito Sans', + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito Sans'), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () { + print('Button pressed ...'); + }, + text: FFLocalizations.of(context).getText( + 'yikill36' /* Todos */, + ), + options: FFButtonOptions( + width: 260.0, + height: 20.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: const Color(0xFF1AAB5F), + textStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).customColor4, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Container( + width: 464.0, + height: 127.0, + decoration: const BoxDecoration( + shape: BoxShape.rectangle, + ), + child: ListView( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + children: const [], + ), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/modals/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart similarity index 100% rename from lib/modals/schedule_visit_detail/schedule_visit_detail_model.dart rename to lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart diff --git a/lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart similarity index 99% rename from lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart rename to lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 07e45567..9641ca52 100644 --- a/lib/modals/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -1,9 +1,9 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; -import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; diff --git a/lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart similarity index 100% rename from lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart diff --git a/lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart similarity index 100% rename from lib/modals/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart rename to lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart diff --git a/lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart similarity index 100% rename from lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_model.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart diff --git a/lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart similarity index 100% rename from lib/modals/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart rename to lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart diff --git a/lib/modals/card_item_template_component/card_item_template_component_model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart similarity index 100% rename from lib/modals/card_item_template_component/card_item_template_component_model.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart diff --git a/lib/modals/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart similarity index 100% rename from lib/modals/card_item_template_component/card_item_template_component_widget.dart rename to lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart diff --git a/lib/modals/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart similarity index 100% rename from lib/modals/forgot_password_template_component/forgot_password_template_component_model.dart rename to lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart diff --git a/lib/modals/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 similarity index 99% rename from lib/modals/forgot_password_template_component/forgot_password_template_component_widget.dart rename to lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart index 09fdeb47..39cce295 100644 --- a/lib/modals/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -1,8 +1,8 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; diff --git a/lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart similarity index 100% rename from lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart diff --git a/lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart similarity index 100% rename from lib/modals/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart rename to lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart diff --git a/lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart similarity index 100% rename from lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart diff --git a/lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart similarity index 100% rename from lib/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart rename to lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart diff --git a/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart similarity index 100% rename from lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart rename to lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart diff --git a/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart similarity index 99% rename from lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart rename to lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 85b06c3f..4a00c919 100644 --- a/lib/modals/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,11 +1,11 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/upload_data.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart new file mode 100644 index 00000000..fd542965 --- /dev/null +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -0,0 +1,61 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_in_template_component_widget.dart' + show SignInTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignInTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for emailAddress widget. + FocusNode? emailAddressFocusNode; + TextEditingController? emailAddressTextController; + String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'xhnawzcb' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 's3j1hjqx' /* E-mail Inv */, + ); + } + return null; + } + + // State field(s) for password widget. + FocusNode? passwordFocusNode; + TextEditingController? passwordTextController; + late bool passwordVisibility; + String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9cs5wlmc' /* Campo é necessário */, + ); + } + + return null; + } + + @override + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; + } + + @override + void dispose() { + emailAddressFocusNode?.dispose(); + emailAddressTextController?.dispose(); + + passwordFocusNode?.dispose(); + passwordTextController?.dispose(); + } +} 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 new file mode 100644 index 00000000..ae8cc9df --- /dev/null +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -0,0 +1,1026 @@ +import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'sign_in_template_component_model.dart'; +export 'sign_in_template_component_model.dart'; + +class SignInTemplateComponentWidget extends StatefulWidget { + const SignInTemplateComponentWidget({ + super.key, + required this.toggleSignUpPage, + }); + + final Future Function()? toggleSignUpPage; + + @override + State createState() => + _SignInTemplateComponentWidgetState(); +} + +class _SignInTemplateComponentWidgetState + extends State with TickerProviderStateMixin { + late SignInTemplateComponentModel _model; + + final animationsMap = {}; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => SignInTemplateComponentModel()); + + _model.emailAddressTextController ??= TextEditingController(); + _model.emailAddressFocusNode ??= FocusNode(); + + _model.passwordTextController ??= TextEditingController(); + _model.passwordFocusNode ??= FocusNode(); + + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 6, + child: Container( + width: 100.0, + height: double.infinity, + decoration: const BoxDecoration(), + alignment: const AlignmentDirectional(0.0, -1.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), + child: Container( + width: 548.0, + height: 112.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: const EdgeInsets.all(3.0), + child: Text( + FFLocalizations.of(context).getText( + '9hbdjxrz' /* VAMOS LA! ENTRE COM A SUA CONT... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Container( + width: 291.0, + height: 167.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', + width: 603.0, + height: 155.0, + fit: BoxFit.contain, + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 34.0, 0.0, 34.0, 0.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + borderRadius: BorderRadius.circular(12.0), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.always, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailAddressTextController, + focusNode: _model + .emailAddressFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], + textCapitalization: + TextCapitalization.none, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '1ltg0ylb' /* Email */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + suffixIcon: Icon( + Icons.email, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: TextInputType + .emailAddress, + validator: _model + .emailAddressTextControllerValidator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordTextController, + 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, + 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: 16.0, + 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), + ), + 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), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFFFF5963), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => setState( + () => _model + .passwordVisibility = + !_model + .passwordVisibility, + ), + focusNode: FocusNode( + skipTraversal: true), + child: Icon( + _model.passwordVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0, + ), + ), + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordTextControllerValidator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Builder( + builder: (context) { + 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), + child: FFButtonWidget( + onPressed: ((_model.emailAddressTextController + .text == + '') && + (_model.passwordTextController + .text == + '')) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, + text: FFLocalizations.of( + context) + .getText( + 'k44tm7wo' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: + FlutterFlowTheme.of( + context) + .primary, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: + Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular( + 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, + ), + showLoadingIndicator: false, + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () async { + await widget + .toggleSignUpPage + ?.call(); + }, + text: FFLocalizations.of( + context) + .getText( + '14u7ipws' /* Cadastrar */, + ), + 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: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .secondaryText, + fontSize: 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: + Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + showLoadingIndicator: false, + ), + ), + ], + ); + } else { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: FFButtonWidget( + onPressed: (((_model.emailAddressTextController + .text == + '') || + ((_model.emailAddressFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.emailAddressTextController + .text == + '') || + ((_model.passwordTextController.text == + '') || + ((_model.passwordFocusNode?.hasFocus ?? + false) != + null)))) + ? null + : () async { + await action_blocks + .singInLoginAction( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, + text: FFLocalizations.of( + context) + .getText( + '1x926nsn' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: + FlutterFlowTheme.of( + context) + .accent1, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors + .transparent, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular(12.0), + disabledColor: + const Color(0xE81AAB5F), + ), + showLoadingIndicator: + false, + ), + ), + ), + Expanded( + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), + child: FFButtonWidget( + onPressed: () async { + await widget + .toggleSignUpPage + ?.call(); + }, + text: FFLocalizations.of( + context) + .getText( + 'jwvd4ai1' /* Cadastrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, + 0.0, + 0.0, + 0.0), + color: + FlutterFlowTheme.of( + context) + .customColor1, + 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, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular(12.0), + ), + showLoadingIndicator: + false, + ), + ), + ), + ].divide(const SizedBox(width: 7.0)), + ); + } + }, + ), + + // You will have to add an action on this rich text to go to your login page. + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: + MediaQuery.viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ); + }, + ).then( + (value) => safeSetState(() {})); + }, + child: RichText( + textScaler: MediaQuery.of(context) + .textScaler, + text: TextSpan( + children: [ + TextSpan( + text: FFLocalizations.of( + context) + .getText( + '05dx91ku' /* Você esqueceu a sua senha? */, + ), + style: TextStyle( + color: FlutterFlowTheme.of( + context) + .primaryText, + ), + ), + 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: 14.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.normal, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + mouseCursor: + SystemMouseCursors.click, + recognizer: + TapGestureRecognizer() + ..onTap = () async { + await showModalBottomSheet( + isScrollControlled: + true, + backgroundColor: + Colors + .transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery + .viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ); + }, + ).then((value) => + safeSetState( + () {})); + }, + ) + ], + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + Text( + FFLocalizations.of(context).getText( + 'olf967cj' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ], + ), + ), + ), + ).animateOnPageLoad( + animationsMap['containerOnPageLoadAnimation']!), + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart new file mode 100644 index 00000000..bbcd4725 --- /dev/null +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart @@ -0,0 +1,91 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'sign_up_template_component_widget.dart' + show SignUpTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class SignUpTemplateComponentModel + extends FlutterFlowModel { + /// State fields for stateful widgets in this component. + + final formKey = GlobalKey(); + // State field(s) for nameRegisterForm widget. + FocusNode? nameRegisterFormFocusNode; + TextEditingController? nameRegisterFormTextController; + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3bs10dfq' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { + return 'Must start with a letter and can only contain letters, digits and - or _.'; + } + return null; + } + + // State field(s) for emailRegisterForm widget. + FocusNode? emailRegisterFormFocusNode; + TextEditingController? emailRegisterFormTextController; + String? Function(BuildContext, String?)? + emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'mlvw63yj' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + + // State field(s) for passwordRegisterForm widget. + FocusNode? passwordRegisterFormFocusNode; + TextEditingController? passwordRegisterFormTextController; + late bool passwordRegisterFormVisibility; + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '6nn79lmh' /* Campo é necessário */, + ); + } + + return null; + } + + // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. + bool? signUp; + + @override + void initState(BuildContext context) { + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; + passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; + } + + @override + void dispose() { + nameRegisterFormFocusNode?.dispose(); + nameRegisterFormTextController?.dispose(); + + emailRegisterFormFocusNode?.dispose(); + emailRegisterFormTextController?.dispose(); + + passwordRegisterFormFocusNode?.dispose(); + passwordRegisterFormTextController?.dispose(); + } +} diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart new file mode 100644 index 00000000..0d5327b0 --- /dev/null +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -0,0 +1,866 @@ +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; +import 'package:easy_debounce/easy_debounce.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; +import 'sign_up_template_component_model.dart'; +export 'sign_up_template_component_model.dart'; + +class SignUpTemplateComponentWidget extends StatefulWidget { + const SignUpTemplateComponentWidget({ + super.key, + required this.toggleSignInPage, + }); + + final Future Function()? toggleSignInPage; + + @override + State createState() => + _SignUpTemplateComponentWidgetState(); +} + +class _SignUpTemplateComponentWidgetState + extends State with TickerProviderStateMixin { + late SignUpTemplateComponentModel _model; + + final animationsMap = {}; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => SignUpTemplateComponentModel()); + + _model.nameRegisterFormTextController ??= TextEditingController(); + _model.nameRegisterFormFocusNode ??= FocusNode(); + _model.nameRegisterFormFocusNode!.addListener(() => setState(() {})); + _model.emailRegisterFormTextController ??= TextEditingController(); + _model.emailRegisterFormFocusNode ??= FocusNode(); + _model.emailRegisterFormFocusNode!.addListener(() => setState(() {})); + _model.passwordRegisterFormTextController ??= TextEditingController(); + _model.passwordRegisterFormFocusNode ??= FocusNode(); + _model.passwordRegisterFormFocusNode!.addListener(() => setState(() {})); + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 6, + child: Container( + width: 100.0, + height: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + alignment: const AlignmentDirectional(0.0, -1.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + width: 669.0, + height: 112.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + FFLocalizations.of(context).getText( + '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + Container( + width: 291.0, + height: 167.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: SvgPicture.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', + width: 603.0, + height: 155.0, + fit: BoxFit.contain, + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(34.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + borderRadius: BorderRadius.circular(12.0), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.disabled, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .nameRegisterFormTextController, + focusNode: _model + .nameRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.nameRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.name + ], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '3corpwhd' /* Nome */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: Icon( + Icons.person, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType.name, + validator: _model + .nameRegisterFormTextControllerValidator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailRegisterFormTextController, + focusNode: _model + .emailRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.email + ], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '80wonb69' /* Email */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .primaryText, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: Icon( + Icons.email, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .customColor1, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: TextInputType + .emailAddress, + validator: _model + .emailRegisterFormTextControllerValidator + .asValidator(context), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordRegisterFormTextController, + focusNode: _model + .passwordRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.password + ], + obscureText: !_model + .passwordRegisterFormVisibility, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '0firji8l' /* Senha */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFF1AAB5F), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + 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), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => setState( + () => _model + .passwordRegisterFormVisibility = + !_model + .passwordRegisterFormVisibility, + ), + focusNode: FocusNode( + skipTraversal: true), + child: Icon( + _model.passwordRegisterFormVisibility + ? 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: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordRegisterFormTextControllerValidator + .asValidator(context), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: (((_model.nameRegisterFormTextController + .text != + '') || + ((_model.nameRegisterFormFocusNode?.hasFocus ?? + false) != + null)) && + ((_model.emailRegisterFormTextController + .text != + '') || + ((_model.emailRegisterFormFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.passwordRegisterFormTextController + .text != + '') || + ((_model.passwordRegisterFormFocusNode + ?.hasFocus ?? + false) != + null))) + ? null + : () async { + var shouldSetState = false; + _model.signUp = + await action_blocks + .signUpRegisterAction( + context, + name: _model + .nameRegisterFormTextController + .text, + passwd: _model + .passwordRegisterFormTextController + .text, + email: _model + .emailRegisterFormTextController + .text, + device: FFAppState().device, + ); + shouldSetState = true; + if (_model.signUp == true) { + await widget + .toggleSignInPage + ?.call(); + } else { + if (shouldSetState) { + setState(() {}); + } + return; + } + + if (shouldSetState) { + setState(() {}); + } + }, + text: FFLocalizations.of(context) + .getText( + 'rnvdwzei' /* Cadastrar-se */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .accent1, + textStyle: FlutterFlowTheme.of( + context) + .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, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + + // You will have to add an action on this rich text to go to your login page. + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await widget.toggleSignInPage + ?.call(); + }, + child: RichText( + textScaler: MediaQuery.of(context) + .textScaler, + text: TextSpan( + children: [ + TextSpan( + text: FFLocalizations.of( + context) + .getText( + 'a9smhn5b' /* Você já tem uma conta? */, + ), + style: TextStyle( + color: FlutterFlowTheme.of( + context) + .primaryText, + ), + ), + TextSpan( + text: FFLocalizations.of( + context) + .getText( + '09xv5ctc' /* Clique aqui */, + ), + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + ) + ], + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ).animateOnPageLoad( + animationsMap['containerOnPageLoadAnimation']!), + ), + ), + ], + ), + Text( + FFLocalizations.of(context).getText( + 'huygnka2' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).secondaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ], + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/modals/view_visit_detail/view_visit_detail_model.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart similarity index 100% rename from lib/modals/view_visit_detail/view_visit_detail_model.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_model.dart diff --git a/lib/modals/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart similarity index 99% rename from lib/modals/view_visit_detail/view_visit_detail_widget.dart rename to lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index a9e1fa7a..73f3e397 100644 --- a/lib/modals/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -1,9 +1,9 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; -import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/actions/actions.dart' as action_blocks; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; diff --git a/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart similarity index 84% rename from lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart rename to lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index 66664873..a4052e41 100644 --- a/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,6 +1,6 @@ +import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/modals/view_visit_detail/view_visit_detail_widget.dart'; import 'visit_details_modal_template_component_widget.dart' show VisitDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; diff --git a/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart similarity index 95% rename from lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart rename to lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 0bd52e6c..7e668742 100644 --- a/lib/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,6 +1,6 @@ +import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import '/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/modals/view_visit_detail/view_visit_detail_widget.dart'; import 'package:flutter/material.dart'; import 'visit_details_modal_template_component_model.dart'; export 'visit_details_modal_template_component_model.dart'; diff --git a/lib/modals/visit_request_template_component/visit_request_template_component_model.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart similarity index 100% rename from lib/modals/visit_request_template_component/visit_request_template_component_model.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart diff --git a/lib/modals/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart similarity index 100% rename from lib/modals/visit_request_template_component/visit_request_template_component_widget.dart rename to lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart diff --git a/lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart similarity index 100% rename from lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart rename to lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart diff --git a/lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart similarity index 100% rename from lib/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart rename to lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart diff --git a/lib/modals/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 similarity index 100% rename from lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart rename to lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart diff --git a/lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart similarity index 99% rename from lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart rename to lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 3961ff49..f393b4ec 100644 --- a/lib/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,10 +1,10 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/modals/visitor_not_found_component/visitor_not_found_component_widget.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart new file mode 100644 index 00000000..17ea3047 --- /dev/null +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart @@ -0,0 +1,13 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'welcome_template_component_widget.dart' + show WelcomeTemplateComponentWidget; +import 'package:flutter/material.dart'; + +class WelcomeTemplateComponentModel + extends FlutterFlowModel { + @override + void initState(BuildContext context) {} + + @override + void dispose() {} +} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart new file mode 100644 index 00000000..bdb465b1 --- /dev/null +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -0,0 +1,445 @@ +import '/flutter_flow/flutter_flow_animations.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_animate/flutter_animate.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'welcome_template_component_model.dart'; +export 'welcome_template_component_model.dart'; + +class WelcomeTemplateComponentWidget extends StatefulWidget { + const WelcomeTemplateComponentWidget({ + super.key, + required this.toggleSignUpPage, + required this.toggleSignInPage, + }); + + final Future Function()? toggleSignUpPage; + final Future Function()? toggleSignInPage; + + @override + State createState() => + _WelcomeTemplateComponentWidgetState(); +} + +class _WelcomeTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { + late WelcomeTemplateComponentModel _model; + + final animationsMap = {}; + + @override + void setState(VoidCallback callback) { + super.setState(callback); + _model.onUpdate(); + } + + @override + void initState() { + super.initState(); + _model = createModel(context, () => WelcomeTemplateComponentModel()); + + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), + ), + ], + ), + }); + } + + @override + void dispose() { + _model.maybeDispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SafeArea( + child: Container( + width: 648.0, + height: 208.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.0), + ), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(14.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + FFLocalizations.of(context).getText( + 'dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + 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... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ), + Container( + width: 284.0, + height: 200.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(0.0), + child: SvgPicture.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', + width: 603.0, + height: double.infinity, + fit: BoxFit.contain, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(34.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + boxShadow: const [ + BoxShadow( + blurRadius: 0.0, + color: Colors.transparent, + offset: Offset( + 0.0, + 0.0, + ), + ) + ], + borderRadius: BorderRadius.circular(12.0), + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Builder( + builder: (context) { + 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), + child: FFButtonWidget( + onPressed: () async { + await widget.toggleSignInPage?.call(); + }, + text: + FFLocalizations.of(context).getText( + 'dynet730' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of(context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () async { + await widget.toggleSignUpPage?.call(); + }, + text: + FFLocalizations.of(context).getText( + 'hha60cg7' /* Cadastrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .customColor1, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of(context) + .primaryBackground, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ], + ); + } else { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () async { + await widget.toggleSignInPage + ?.call(); + }, + text: FFLocalizations.of(context) + .getText( + 'zvtay8ee' /* Entrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + onPressed: () async { + await widget.toggleSignUpPage + ?.call(); + }, + text: FFLocalizations.of(context) + .getText( + 'o6zob50a' /* Cadastrar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: + BorderRadius.circular(12.0), + ), + showLoadingIndicator: false, + ), + ), + ), + ].divide(const SizedBox(width: 7.0)), + ); + } + }, + ), + ], + ), + ), + ), + ).animateOnPageLoad( + animationsMap['containerOnPageLoadAnimation']!), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 90baffdf..91cb14b0 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -151,86 +151,6 @@ final kTranslationsMap = >>[ 'pt': 'FRE ACCESS', 'en': 'FREE ACCESS', }, - 'b2qdcsh0': { - 'pt': 'Agendar \nVisita', - 'en': '', - }, - 'intigjrx': { - 'pt': 'Cadastrar\nVisitante', - 'en': '', - }, - 'dcpn2r8i': { - 'pt': 'Vincular \nCondomínio', - 'en': '', - }, - 'rt57fpea': { - 'pt': 'Cadastrar \nPet', - 'en': '', - }, - 'e7o77oeh': { - 'pt': 'QR Code \nde Acesso', - 'en': '', - }, - 'xua67fn9': { - 'pt': 'Pessoas na\nPropriedade', - 'en': '', - }, - 'hli1jd0i': { - 'pt': 'Consultar \nHistóricos', - 'en': '', - }, - 'kbvld4ht': { - 'pt': 'Histórico \nde Acesso', - 'en': '', - }, - 'csz6cjye': { - 'pt': 'Histórico \nde Liberação', - 'en': '', - }, - 'lzag0674': { - 'pt': 'Agendar \nVisita', - 'en': '', - }, - 'mopkb1cs': { - 'pt': 'Cadastrar\n Visitante', - 'en': '', - }, - '9n0bfmlf': { - 'pt': 'Vincular\nCondomínio', - 'en': '', - }, - '3hkp1x8r': { - 'pt': 'Cadastrar\nPet', - 'en': '', - }, - 'fi81uwmz': { - 'pt': 'QR Code\nde Acesso', - 'en': '', - }, - '1djx7nvm': { - 'pt': 'Pessoas na\nPropriedade', - 'en': '', - }, - 'ttj9zmi8': { - 'pt': 'Histórico\nde Acesso', - 'en': '', - }, - 'h989n5uy': { - 'pt': 'Histórico\nde Liberação', - 'en': '', - }, - 'fx7ci8gw': { - 'pt': 'Preferencias\ndo Sistema', - 'en': '', - }, - 'rgpcq2s6': { - 'pt': 'Mural de Mensagens', - 'en': '', - }, - 'bdvbpuo8': { - 'pt': 'Todos', - 'en': '', - }, 'mp6igsok': { 'pt': '', 'en': '', @@ -504,66 +424,6 @@ final kTranslationsMap = >>[ }, // signInPage { - 'v9f4ae9n': { - 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', - 'en': '', - }, - 'i6dx9dz4': { - 'pt': 'Email', - 'en': '', - }, - 'kpsqzbuz': { - 'pt': 'Senha', - 'en': '', - }, - 'aobfkrs0': { - 'pt': 'Campo é necessário', - 'en': '', - }, - 'axa3n3lr': { - 'pt': 'E-mail Inv', - 'en': '', - }, - '1z37vela': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - '9h4qk3c9': { - 'pt': 'Campo é necessário', - 'en': '', - }, - '5v5xvc3b': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'q4tx90yp': { - 'pt': 'Entrar', - 'en': '', - }, - 'lzfmqkly': { - 'pt': 'Cadastrar', - 'en': '', - }, - '7niwis9z': { - 'pt': 'Entrar', - 'en': '', - }, - 'bl377mgi': { - 'pt': 'Cadastrar', - 'en': '', - }, - '7dntd49d': { - 'pt': 'Você esqueceu a sua senha?', - 'en': '', - }, - '31y04wkg': { - 'pt': ' Recupere aqui', - 'en': '', - }, - 'jou5axcb': { - 'pt': 'Termo de Uso', - 'en': '', - }, 'kosqqghj': { 'pt': 'Home', 'en': '', @@ -571,66 +431,6 @@ final kTranslationsMap = >>[ }, // signUpPage { - 'bv7d4en2': { - 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', - 'en': '', - }, - 'evcb30xo': { - 'pt': 'Nome', - 'en': '', - }, - 'p7snp67t': { - 'pt': 'Email', - 'en': '', - }, - 'l0z1d0ca': { - 'pt': '', - 'en': '', - }, - 'u30lpbvg': { - 'pt': 'Senha', - 'en': '', - }, - 'iv6d5xk3': { - 'pt': 'Campo é necessário', - 'en': '', - }, - '51g9xnav': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'w3nl41ps': { - 'pt': 'Campo é necessário', - 'en': '', - }, - '9aweyu6u': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - 'ql1bxvno': { - 'pt': 'Campo é necessário', - 'en': '', - }, - '2cwu613g': { - 'pt': 'Please choose an option from the dropdown', - 'en': '', - }, - '2a4f1t3w': { - 'pt': 'Cadastrar-se', - 'en': '', - }, - 'uy41jbvn': { - 'pt': 'Você já tem uma conta? ', - 'en': '', - }, - 'ynungy80': { - 'pt': 'Clique aqui', - 'en': '', - }, - 'r5rm6pll': { - 'pt': 'Termo de Uso', - 'en': '', - }, 'bq5k4yne': { 'pt': 'Home', 'en': '', @@ -638,30 +438,6 @@ final kTranslationsMap = >>[ }, // welcomePage { - '77d2ypub': { - 'pt': 'UMA EXPERIÊCIA COMPLETA', - 'en': '', - }, - 'avhdhlhw': { - 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', - 'en': '', - }, - 'iw9yx5fr': { - 'pt': 'Entrar', - 'en': '', - }, - 'bs5mbse6': { - 'pt': 'Cadastrar', - 'en': '', - }, - 'cq85bqnj': { - 'pt': 'Entrar', - 'en': '', - }, - 'iupuq6xs': { - 'pt': 'Cadastrar', - 'en': '', - }, 'byab1t50': { 'pt': 'Home', 'en': '', @@ -971,6 +747,248 @@ final kTranslationsMap = >>[ 'en': 'Schedule\nComplete', }, }, + // menuListViewComponent + { + 'utgue9a5': { + 'pt': 'Agendar \nVisita', + 'en': 'Schedule \nVisit', + }, + '82b5f8yz': { + 'pt': 'Cadastrar\nVisitante', + 'en': 'Register\nVisitor', + }, + 't4ie13ut': { + 'pt': 'Vincular \nCondomínio', + 'en': 'Link\nCondominium', + }, + 'n3n76pha': { + 'pt': 'Cadastrar \nPet', + 'en': 'Register\npet', + }, + 'l6b9o7yn': { + 'pt': 'QR Code \nde Acesso', + 'en': 'QR Code\nAccess', + }, + 'rxnrtdau': { + 'pt': 'Pessoas na\nPropriedade', + 'en': 'People on\nthe Property', + }, + 'nxssjz3q': { + 'pt': 'Consultar \nHistóricos', + 'en': 'Consult \nHistories', + }, + '589qufkw': { + 'pt': 'Histórico \nde Acesso', + 'en': 'Access \nHistory', + }, + '944g4ib1': { + 'pt': 'Histórico \nde Liberação', + 'en': 'Liberation\nHistory', + }, + }, + // menuStaggeredViewComponent + { + 'ee33l0ms': { + 'pt': 'Agendar \nVisita', + 'en': 'Schedule \nVisit', + }, + 'ya37l3jt': { + 'pt': 'Cadastrar\n Visitante', + 'en': 'Register\n Visitor', + }, + 'h8s3adu8': { + 'pt': 'Vincular\nCondomínio', + 'en': 'Link\nCondominium', + }, + 'j6tfixen': { + 'pt': 'Cadastrar\nPet', + 'en': 'Register\npet', + }, + '9tli4i2x': { + 'pt': 'QR Code\nde Acesso', + 'en': 'QR Code\nAccess', + }, + 'i22hecs8': { + 'pt': 'Pessoas na\nPropriedade', + 'en': 'People on\nthe Property', + }, + '6jzghbyi': { + 'pt': 'Histórico\nde Acesso', + 'en': 'Access\nHistory', + }, + 'u8qu4v6q': { + 'pt': 'Histórico\nde Liberação', + 'en': 'Liberation\nHistory', + }, + 'dzk31zpc': { + 'pt': 'Preferencias\ndo Sistema', + 'en': '', + }, + }, + // messageWellComponent + { + '8fworxmb': { + 'pt': 'Mural de Mensagens', + 'en': 'Message Wall', + }, + 'yikill36': { + 'pt': 'Todos', + 'en': 'All', + }, + }, + // signInTemplateComponent + { + '9hbdjxrz': { + 'pt': 'VAMOS LA! ENTRE COM A SUA CONTA', + 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', + }, + '1ltg0ylb': { + 'pt': 'Email', + 'en': 'Email', + }, + '2x19ce8k': { + 'pt': 'Senha', + 'en': 'Password', + }, + 'xhnawzcb': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 's3j1hjqx': { + 'pt': 'E-mail Inv', + 'en': '', + }, + '2ib9bf67': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '9cs5wlmc': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'rkxwb0sg': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'k44tm7wo': { + 'pt': 'Entrar', + 'en': 'Sign-In', + }, + '14u7ipws': { + 'pt': 'Cadastrar', + 'en': 'Sign-Up', + }, + '1x926nsn': { + 'pt': 'Entrar', + 'en': 'Sign-In', + }, + 'jwvd4ai1': { + 'pt': 'Cadastrar', + 'en': 'Sign-Up', + }, + '05dx91ku': { + 'pt': 'Você esqueceu a sua senha?', + 'en': 'Have you forgotten your password?', + }, + 'p5c6d54y': { + 'pt': ' Recupere aqui', + 'en': ' recover here', + }, + 'olf967cj': { + 'pt': 'Termo de Uso', + 'en': 'Terms of use', + }, + }, + // signUpTemplateComponent + { + '49609olv': { + 'pt': 'INSIRA SEU EMAIL E SENHA, VAMOS TE CADASTRAR!', + 'en': 'ENTER YOUR EMAIL AND PASSWORD, LET\'S REGISTER YOU!', + }, + '3corpwhd': { + 'pt': 'Nome', + 'en': 'Name', + }, + '80wonb69': { + 'pt': 'Email', + 'en': 'Email', + }, + 'ws143wf4': { + 'pt': '', + 'en': '', + }, + '0firji8l': { + 'pt': 'Senha', + 'en': 'Password', + }, + '3bs10dfq': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'ph22karc': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'mlvw63yj': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'z0bv6wi2': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '6nn79lmh': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'rcikqhf1': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'rnvdwzei': { + 'pt': 'Cadastrar-se', + 'en': 'Sign-Up', + }, + 'a9smhn5b': { + 'pt': 'Você já tem uma conta? ', + 'en': 'You already have an account?', + }, + '09xv5ctc': { + 'pt': 'Clique aqui', + 'en': 'Click here', + }, + 'huygnka2': { + 'pt': 'Termo de Uso', + 'en': '', + }, + }, + // welcomeTemplateComponent + { + 'dsc9tuc8': { + 'pt': 'UMA EXPERIÊCIA COMPLETA', + 'en': 'A COMPLETE EXPERIENCE', + }, + '5bgqn16z': { + 'pt': 'COM CONFORTO ONDE VOCÊ ESTIVER.', + 'en': 'WITH COMFORT WHEREVER YOU ARE.', + }, + 'dynet730': { + 'pt': 'Entrar', + 'en': 'Sign-In', + }, + 'hha60cg7': { + 'pt': 'Cadastrar', + 'en': 'Sign-Up', + }, + 'zvtay8ee': { + 'pt': 'Entrar', + 'en': 'Sign-In', + }, + 'o6zob50a': { + 'pt': 'Cadastrar', + 'en': 'Sign-Up', + }, + }, // forgotPasswordTemplateComponent { 'xxm3ajsy': { diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index 15d9230c..71a5824f 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,6 +1,6 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/request_manager.dart'; import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; 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 b3e81a86..8b4f8b03 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -1,8 +1,8 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/modals/opt_modal/opt_modal_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index f4c7637a..01e742ae 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,3 +1,6 @@ +import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import '/components/organism_components/menu_component/menu_component_widget.dart'; +import '/components/organism_components/message_well_component/message_well_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'home_page_widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; @@ -14,14 +17,30 @@ class HomePageModel extends FlutterFlowModel { FocusNode? textFieldFocusNode; TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; + // Model for localComponent. + late LocalProfileComponentModel localComponentModel; + // Model for menuComponent component. + late MenuComponentModel menuComponentModel; + // Model for messageWellComponent component. + late MessageWellComponentModel messageWellComponentModel; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + localComponentModel = + createModel(context, () => LocalProfileComponentModel()); + menuComponentModel = createModel(context, () => MenuComponentModel()); + messageWellComponentModel = + createModel(context, () => MessageWellComponentModel()); + } @override void dispose() { unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); + + localComponentModel.dispose(); + menuComponentModel.dispose(); + messageWellComponentModel.dispose(); } } diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index f7fe3b51..e28895db 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,12 +1,13 @@ +import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import '/components/organism_components/menu_component/menu_component_widget.dart'; +import '/components/organism_components/message_well_component/message_well_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'home_page_model.dart'; @@ -1071,124 +1072,10 @@ class _HomePageWidgetState extends State { ), ], ), - Container( - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Material( - color: Colors.transparent, - elevation: 0.0, - child: Container( - width: double.infinity, - height: 119.0, - decoration: BoxDecoration( - color: const Color(0xFF1AAB5F), - border: Border.all( - color: const Color(0xFF1AAB5F), - ), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(2.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: const Color(0x00FFFFFF), - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode - .canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: const SizedBox( - height: double.infinity, - child: - BottomArrowLinkedLocalsComponentWidget(), - ), - ), - ); - }, - ).then( - (value) => safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(200.0), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - errorBuilder: - (context, error, stackTrace) => - Image.asset( - 'assets/images/error_image.svg', - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - ), - ), - ), - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - valueOrDefault( - functions.convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Nunito', - color: - FlutterFlowTheme.of(context) - .info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey('Nunito'), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 20.0)) - .addToEnd(const SizedBox(width: 20.0)), - ), - ), - ), - ), + wrapWithModel( + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: const LocalProfileComponentWidget(), ), Wrap( spacing: 0.0, @@ -1200,3048 +1087,17 @@ class _HomePageWidgetState extends State { verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Builder( - builder: (context) { - if (_model.isGrid == true) { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 5.0, 0.0, 5.0, 0.0), - child: Container( - width: double.infinity, - height: 125.0, - decoration: const BoxDecoration(), - child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), - scrollDirection: Axis.horizontal, - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - FFIcons - .kvector1, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'b2qdcsh0' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - FFIcons - .kvector, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'intigjrx' /* Cadastrar -Visitante */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - FFIcons - .khome, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'dcpn2r8i' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - FFIcons - .kpets, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'rt57fpea' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - FFIcons - .kvector2, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'e7o77oeh' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - Icons - .people, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'xua67fn9' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - Icons - .history_sharp, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'hli1jd0i' /* Consultar -Históricos */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - Icons - .history_sharp, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'kbvld4ht' /* Histórico -de Acesso */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: - FlutterFlowTheme.of( - context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: FlutterFlowTheme.of( - context) - .primaryBackground, - shape: BoxShape - .circle, - ), - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Icon( - Icons - .history_sharp, - color: FlutterFlowTheme.of( - context) - .accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'csz6cjye' /* Histórico -de Liberação */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Nunito'), - ), - ), - ), - ], - ), - ), - ].divide( - const SizedBox(height: 0.0)), - ), - ), - ), - ), - ].divide(const SizedBox(width: 15.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_down_outlined, - color: FlutterFlowTheme.of(context) - .primary, - ), - onPressed: () { - print('IconButton pressed ...'); - }, - ), - ), - ], - ); - } else { - return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - Container( - width: double.infinity, - height: - MediaQuery.sizeOf(context).height * - 0.498, - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: MasonryGridView.builder( - physics: - const NeverScrollableScrollPhysics(), - gridDelegate: - const SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - ), - crossAxisSpacing: 10.0, - mainAxisSpacing: 10.0, - itemCount: 9, - padding: const EdgeInsets.fromLTRB( - 0, - 10.0, - 0, - 10.0, - ), - shrinkWrap: true, - itemBuilder: (context, index) { - return [ - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - FFIcons - .kvector1, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'lzag0674' /* Agendar -Visita */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - FFIcons - .kvector, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'mopkb1cs' /* Cadastrar - Visitante */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - FFIcons - .khome, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - '9n0bfmlf' /* Vincular -Condomínio */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - FFIcons - .kpets, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - '3hkp1x8r' /* Cadastrar -Pet */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - FFIcons - .kvector2, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'fi81uwmz' /* QR Code -de Acesso */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - Icons - .people, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - '1djx7nvm' /* Pessoas na -Propriedade */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - Icons - .history_sharp, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'ttj9zmi8' /* Histórico -de Acesso */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - Icons - .history_sharp, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'h989n5uy' /* Histórico -de Liberação */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - () => Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme - .of(context) - .primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme - .of(context) - .customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: - BorderRadius.circular( - 24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: - FlutterFlowTheme.of( - context) - .alternate, - width: 0.5, - ), - ), - child: Padding( - padding: - const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: - MainAxisSize.min, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .max, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional( - -1.0, - 0.0), - child: - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, - 0.0, - 0.0, - 0.0), - child: - Container( - width: - 30.0, - height: - 30.0, - decoration: - BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, - shape: - BoxShape.circle, - ), - alignment: const AlignmentDirectional( - 0.0, - 0.0), - child: - Icon( - Icons - .settings_rounded, - color: - FlutterFlowTheme.of(context).accent1, - size: - 24.0, - ), - ), - ), - ), - ), - ], - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize - .min, - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, - 0.0), - child: Text( - FFLocalizations.of( - context) - .getText( - 'fx7ci8gw' /* Preferencias -do Sistema */ - , - ), - style: FlutterFlowTheme.of( - context) - .titleLarge - .override( - fontFamily: - 'Nunito', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox( - height: 0.0)), - ), - ), - ), - ][index](); - }, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_up_sharp, - color: - FlutterFlowTheme.of(context) - .primary, - ), - onPressed: () { - print('IconButton pressed ...'); - }, - ), - ), - ), - ), - ], - ); - } - }, - ), + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget(), ), Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 40.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 167.0, - decoration: const BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - FFLocalizations.of(context).getText( - 'rgpcq2s6' /* Mural de Mensagens */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: 'Nunito Sans', - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Nunito Sans'), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 5.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: FFLocalizations.of(context).getText( - 'bdvbpuo8' /* Todos */, - ), - options: FFButtonOptions( - width: 260.0, - height: 20.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: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .customColor4, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Container( - width: 464.0, - height: 127.0, - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: ListView( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - children: const [], - ), - ), - ), - ), - ], - ), - ), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), ), ), ], 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 b7da1d61..3d37a4c5 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,9 +1,9 @@ +import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; import 'dart:async'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:barcode_widget/barcode_widget.dart'; diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index 62a92670..6f9e7722 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,4 +1,5 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -6,7 +7,6 @@ import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/upload_data.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; 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 230ce3c0..8643f7c6 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 @@ -1,14 +1,14 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import '/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/form_field_controller.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; -import '/modals/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '/modals/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/modals/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; import '/flutter_flow/custom_functions.dart' as functions; import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index bc791565..b8528fa3 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,10 +1,10 @@ import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/modals/throw_exception/throw_exception_widget.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index df0ba706..e8b945bd 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -1,3 +1,4 @@ +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'sign_in_page_widget.dart' show SignInPageWidget; import 'package:flutter/material.dart'; @@ -6,56 +7,18 @@ class SignInPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - final formKey = GlobalKey(); - // State field(s) for emailAddress widget. - FocusNode? emailAddressFocusNode; - TextEditingController? emailAddressTextController; - String? Function(BuildContext, String?)? emailAddressTextControllerValidator; - String? _emailAddressTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'aobfkrs0' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return FFLocalizations.of(context).getText( - 'axa3n3lr' /* E-mail Inv */, - ); - } - return null; - } - - // State field(s) for password widget. - FocusNode? passwordFocusNode; - TextEditingController? passwordTextController; - late bool passwordVisibility; - String? Function(BuildContext, String?)? passwordTextControllerValidator; - String? _passwordTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - '9h4qk3c9' /* Campo é necessário */, - ); - } - - return null; - } + // Model for signInTemplateComponent component. + late SignInTemplateComponentModel signInTemplateComponentModel; @override void initState(BuildContext context) { - emailAddressTextControllerValidator = _emailAddressTextControllerValidator; - passwordVisibility = false; - passwordTextControllerValidator = _passwordTextControllerValidator; + signInTemplateComponentModel = + createModel(context, () => SignInTemplateComponentModel()); } @override void dispose() { unfocusNode.dispose(); - emailAddressFocusNode?.dispose(); - emailAddressTextController?.dispose(); - - passwordFocusNode?.dispose(); - passwordTextController?.dispose(); + signInTemplateComponentModel.dispose(); } } diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index 7945a411..da1727c7 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -1,14 +1,8 @@ -import '/flutter_flow/flutter_flow_animations.dart'; +import '/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/modals/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/actions/actions.dart' as action_blocks; -import 'package:easy_debounce/easy_debounce.dart'; -import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'sign_in_page_model.dart'; export 'sign_in_page_model.dart'; @@ -19,61 +13,15 @@ class SignInPageWidget extends StatefulWidget { State createState() => _SignInPageWidgetState(); } -class _SignInPageWidgetState extends State - with TickerProviderStateMixin { +class _SignInPageWidgetState extends State { late SignInPageModel _model; final scaffoldKey = GlobalKey(); - final animationsMap = {}; - @override void initState() { super.initState(); _model = createModel(context, () => SignInPageModel()); - - _model.emailAddressTextController ??= TextEditingController(); - _model.emailAddressFocusNode ??= FocusNode(); - - _model.passwordTextController ??= TextEditingController(); - _model.passwordFocusNode ??= FocusNode(); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); } @override @@ -94,1035 +42,15 @@ class _SignInPageWidgetState extends State backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 35.0, 0.0, 35.0), - child: Container( - width: 548.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Text( - FFLocalizations.of(context).getText( - 'v9f4ae9n' /* VAMOS LA! ENTRE COM A SUA CONT... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 34.0, 0.0, 34.0, 0.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Form( - key: _model.formKey, - autovalidateMode: - AutovalidateMode.always, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailAddressTextController, - focusNode: _model - .emailAddressFocusNode, - onChanged: (_) => - EasyDebounce - .debounce( - '_model.emailAddressTextController', - const Duration( - milliseconds: - 500), - () => setState(() {}), - ), - autofocus: true, - autofillHints: const [ - AutofillHints.email - ], - textCapitalization: - TextCapitalization - .none, - textInputAction: - TextInputAction - .next, - obscureText: false, - decoration: - InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'i6dx9dz4' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme - .of(context) - .accent1, - size: 22.0, - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType - .emailAddress, - validator: _model - .emailAddressTextControllerValidator - .asValidator( - context), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordTextController, - 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, - decoration: - InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'kpsqzbuz' /* Senha */, - ), - labelStyle: - FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0xFF1AAB5F), - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - 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), - ), - filled: true, - fillColor: FlutterFlowTheme - .of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => - setState( - () => _model - .passwordVisibility = - !_model - .passwordVisibility, - ), - focusNode: FocusNode( - skipTraversal: - true), - child: Icon( - _model.passwordVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: FlutterFlowTheme - .of(context) - .accent1, - size: 24.0, - ), - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordTextControllerValidator - .asValidator( - context), - ), - ), - ), - ], - ), - ), - Builder( - builder: (context) { - 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), - child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && - (_model.passwordTextController - .text == - '')) - ? null - : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: - _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState( - () {}); - }, - text: FFLocalizations - .of(context) - .getText( - 'q4tx90yp' /* Entrar */, - ), - options: - FFButtonOptions( - width: - double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: FlutterFlowTheme - .of(context) - .primary, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .info, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: - const BorderSide( - color: Colors - .transparent, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - disabledColor: - FlutterFlowTheme.of( - context) - .customColor5, - disabledTextColor: - Colors.white, - ), - showLoadingIndicator: - false, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 16.0), - child: FFButtonWidget( - onPressed: () { - print( - 'signUpButtonLoginForm pressed ...'); - }, - text: FFLocalizations - .of(context) - .getText( - 'lzfmqkly' /* Cadastrar */, - ), - options: - FFButtonOptions( - width: - double.infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: FlutterFlowTheme - .of(context) - .customColor1, - 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, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - showLoadingIndicator: - false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 16.0), - child: FFButtonWidget( - onPressed: (((_model.emailAddressTextController.text == - '') || - ((_model.emailAddressFocusNode?.hasFocus ?? - false) != - null)) && - ((_model.emailAddressTextController.text == - '') || - ((_model.passwordTextController.text == '') || - ((_model.passwordFocusNode?.hasFocus ?? false) != - null)))) - ? null - : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState( - () {}); - }, - text: FFLocalizations - .of(context) - .getText( - '7niwis9z' /* Entrar */, - ), - options: - FFButtonOptions( - width: double - .infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: FlutterFlowTheme - .of(context) - .accent1, - textStyle: - FlutterFlowTheme.of( - context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .info, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: - const BorderSide( - color: Colors - .transparent, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - disabledColor: - const Color( - 0xE81AAB5F), - ), - showLoadingIndicator: - false, - ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 16.0), - child: FFButtonWidget( - onPressed: () { - print( - 'signUpButtonLoginForm pressed ...'); - }, - text: FFLocalizations - .of(context) - .getText( - 'bl377mgi' /* Cadastrar */, - ), - options: - FFButtonOptions( - width: double - .infinity, - height: 44.0, - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), - color: FlutterFlowTheme - .of(context) - .customColor1, - 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, - width: 1.0, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - showLoadingIndicator: - false, - ), - ), - ), - ].divide( - const SizedBox(width: 7.0)), - ); - } - }, - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: - Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of( - context) - .requestFocus(_model - .unfocusNode) - : FocusScope.of( - context) - .unfocus(), - child: Padding( - padding: MediaQuery - .viewInsetsOf( - context), - child: - const ForgotPasswordTemplateComponentWidget(), - ), - ); - }, - ).then((value) => - safeSetState(() {})); - }, - child: RichText( - textScaler: - MediaQuery.of(context) - .textScaler, - text: TextSpan( - children: [ - TextSpan( - text: - FFLocalizations.of( - context) - .getText( - '7dntd49d' /* Você esqueceu a sua senha? */, - ), - style: TextStyle( - color: FlutterFlowTheme - .of(context) - .primaryText, - ), - ), - TextSpan( - text: - FFLocalizations.of( - context) - .getText( - '31y04wkg' /* Recupere aqui */, - ), - style: - FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primary, - fontSize: - 14.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .normal, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - mouseCursor: - SystemMouseCursors - .click, - recognizer: - TapGestureRecognizer() - ..onTap = - () async { - await showModalBottomSheet( - isScrollControlled: - true, - backgroundColor: - Colors - .transparent, - context: - context, - builder: - (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of(context).requestFocus(_model - .unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: - Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - const ForgotPasswordTemplateComponentWidget(), - ), - ); - }, - ).then((value) => - safeSetState( - () {})); - }, - ) - ], - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - Text( - FFLocalizations.of(context) - .getText( - 'jou5axcb' /* Termo de Uso */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad(animationsMap[ - 'containerOnPageLoadAnimation']!), - ), - ), - ], - ), - ], - ), - ), - ), - ), - ), - ], + child: wrapWithModel( + model: _model.signInTemplateComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: SignInTemplateComponentWidget( + toggleSignUpPage: () async { + await action_blocks.toggleSignUpPage(context); + }, + ), ), ), ), diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index c2bbea7c..938a3b46 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -1,3 +1,4 @@ +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'sign_up_page_widget.dart' show SignUpPageWidget; import 'package:flutter/material.dart'; @@ -6,86 +7,18 @@ class SignUpPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); - final formKey = GlobalKey(); - // State field(s) for nameRegisterForm widget. - FocusNode? nameRegisterFormFocusNode; - TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? - nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'iv6d5xk3' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } - return null; - } - - // State field(s) for emailRegisterForm widget. - FocusNode? emailRegisterFormFocusNode; - TextEditingController? emailRegisterFormTextController; - String? Function(BuildContext, String?)? - emailRegisterFormTextControllerValidator; - String? _emailRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'w3nl41ps' /* Campo é necessário */, - ); - } - - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; - } - return null; - } - - // State field(s) for passwordRegisterForm widget. - FocusNode? passwordRegisterFormFocusNode; - TextEditingController? passwordRegisterFormTextController; - late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? - passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator( - BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'ql1bxvno' /* Campo é necessário */, - ); - } - - return null; - } - - // Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget. - bool? signUp; + // Model for signUpTemplateComponent component. + late SignUpTemplateComponentModel signUpTemplateComponentModel; @override void initState(BuildContext context) { - nameRegisterFormTextControllerValidator = - _nameRegisterFormTextControllerValidator; - emailRegisterFormTextControllerValidator = - _emailRegisterFormTextControllerValidator; - passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = - _passwordRegisterFormTextControllerValidator; + signUpTemplateComponentModel = + createModel(context, () => SignUpTemplateComponentModel()); } @override void dispose() { unfocusNode.dispose(); - nameRegisterFormFocusNode?.dispose(); - nameRegisterFormTextController?.dispose(); - - emailRegisterFormFocusNode?.dispose(); - emailRegisterFormTextController?.dispose(); - - passwordRegisterFormFocusNode?.dispose(); - passwordRegisterFormTextController?.dispose(); + signUpTemplateComponentModel.dispose(); } } diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index 3c087762..18c575ec 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -1,14 +1,8 @@ -import '/flutter_flow/flutter_flow_animations.dart'; +import '/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; import '/actions/actions.dart' as action_blocks; -import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:provider/provider.dart'; import 'sign_up_page_model.dart'; export 'sign_up_page_model.dart'; @@ -19,64 +13,15 @@ class SignUpPageWidget extends StatefulWidget { State createState() => _SignUpPageWidgetState(); } -class _SignUpPageWidgetState extends State - with TickerProviderStateMixin { +class _SignUpPageWidgetState extends State { late SignUpPageModel _model; final scaffoldKey = GlobalKey(); - final animationsMap = {}; - @override void initState() { super.initState(); _model = createModel(context, () => SignUpPageModel()); - - _model.nameRegisterFormTextController ??= TextEditingController(); - _model.nameRegisterFormFocusNode ??= FocusNode(); - _model.nameRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.emailRegisterFormTextController ??= TextEditingController(); - _model.emailRegisterFormFocusNode ??= FocusNode(); - _model.emailRegisterFormFocusNode!.addListener(() => setState(() {})); - _model.passwordRegisterFormTextController ??= TextEditingController(); - _model.passwordRegisterFormFocusNode ??= FocusNode(); - _model.passwordRegisterFormFocusNode!.addListener(() => setState(() {})); - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); } @override @@ -88,8 +33,6 @@ class _SignUpPageWidgetState extends State @override Widget build(BuildContext context) { - context.watch(); - return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) @@ -99,819 +42,16 @@ class _SignUpPageWidgetState extends State backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 669.0, - height: 112.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Align( - alignment: - const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Text( - FFLocalizations.of(context).getText( - 'bv7d4en2' /* INSIRA SEU EMAIL E SENHA, VAMO... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Form( - key: _model.formKey, - autovalidateMode: - AutovalidateMode.disabled, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .nameRegisterFormTextController, - focusNode: _model - .nameRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce - .debounce( - '_model.nameRegisterFormTextController', - const Duration( - milliseconds: - 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.name - ], - obscureText: false, - decoration: - InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'evcb30xo' /* Nome */, - ), - labelStyle: - FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - filled: true, - fillColor: FlutterFlowTheme - .of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme - .of(context) - .accent1, - size: 22.0, - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.name, - validator: _model - .nameRegisterFormTextControllerValidator - .asValidator( - context), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailRegisterFormTextController, - focusNode: _model - .emailRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce - .debounce( - '_model.emailRegisterFormTextController', - const Duration( - milliseconds: - 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.email - ], - obscureText: false, - decoration: - InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'p7snp67t' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .primaryText, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .success, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .error, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - filled: true, - fillColor: FlutterFlowTheme - .of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme - .of(context) - .accent1, - size: 22.0, - ), - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .customColor1, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType - .emailAddress, - validator: _model - .emailRegisterFormTextControllerValidator - .asValidator( - context), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordRegisterFormTextController, - focusNode: _model - .passwordRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce - .debounce( - '_model.passwordRegisterFormTextController', - const Duration( - milliseconds: - 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.password - ], - obscureText: !_model - .passwordRegisterFormVisibility, - decoration: - InputDecoration( - isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'u30lpbvg' /* Senha */, - ), - labelStyle: - FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: - OutlineInputBorder( - borderSide: - BorderSide( - color: FlutterFlowTheme - .of(context) - .customColor1, - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: - const BorderSide( - color: Color( - 0xFF1AAB5F), - width: 0.25, - ), - borderRadius: - BorderRadius - .circular( - 12.0), - ), - 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), - ), - filled: true, - fillColor: FlutterFlowTheme - .of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => - setState( - () => _model - .passwordRegisterFormVisibility = - !_model - .passwordRegisterFormVisibility, - ), - focusNode: FocusNode( - skipTraversal: - true), - child: Icon( - _model.passwordRegisterFormVisibility - ? 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: - 16.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - validator: _model - .passwordRegisterFormTextControllerValidator - .asValidator( - context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: (((_model.nameRegisterFormTextController - .text != - '') || - ((_model - .nameRegisterFormFocusNode?.hasFocus ?? - false) != - null)) && - ((_model.emailRegisterFormTextController - .text != - '') || - ((_model.emailRegisterFormFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.passwordRegisterFormTextController - .text != - '') || - ((_model.passwordRegisterFormFocusNode - ?.hasFocus ?? - false) != - null))) - ? null - : () async { - var shouldSetState = - false; - _model.signUp = - await action_blocks - .signUpRegisterAction( - context, - name: _model - .nameRegisterFormTextController - .text, - passwd: _model - .passwordRegisterFormTextController - .text, - email: _model - .emailRegisterFormTextController - .text, - device: FFAppState() - .device, - ); - shouldSetState = true; - if (_model.signUp != - true) { - if (shouldSetState) { - setState(() {}); - } - return; - } - if (shouldSetState) { - setState(() {}); - } - }, - text: - FFLocalizations.of(context) - .getText( - '2a4f1t3w' /* Cadastrar-se */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 0.0), - color: FlutterFlowTheme.of( - context) - .accent1, - textStyle: FlutterFlowTheme - .of(context) - .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, - width: 1.0, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - showLoadingIndicator: false, - ), - ), - - // You will have to add an action on this rich text to go to your login page. - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: RichText( - textScaler: - MediaQuery.of(context) - .textScaler, - text: TextSpan( - children: [ - TextSpan( - text: FFLocalizations.of( - context) - .getText( - 'uy41jbvn' /* Você já tem uma conta? */, - ), - style: TextStyle( - color: - FlutterFlowTheme.of( - context) - .primaryText, - ), - ), - TextSpan( - text: FFLocalizations.of( - context) - .getText( - 'ynungy80' /* Clique aqui */, - ), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - ) - ], - style: FlutterFlowTheme.of( - context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), - ), - ).animateOnPageLoad(animationsMap[ - 'containerOnPageLoadAnimation']!), - ), - ), - ], - ), - Text( - FFLocalizations.of(context).getText( - 'r5rm6pll' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ], - ), - ), - ), - ), - ), - ], + child: wrapWithModel( + model: _model.signUpTemplateComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: SignUpTemplateComponentWidget( + toggleSignInPage: () async { + await action_blocks.toggleSignInPage(context); + setState(() {}); + }, + ), ), ), ), diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index ae64ac31..b8a54a7e 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -1,3 +1,4 @@ +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'welcome_page_widget.dart' show WelcomePageWidget; import 'package:flutter/material.dart'; @@ -10,12 +11,18 @@ class WelcomePageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); + // Model for welcomeTemplateComponent component. + late WelcomeTemplateComponentModel welcomeTemplateComponentModel; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + welcomeTemplateComponentModel = + createModel(context, () => WelcomeTemplateComponentModel()); + } @override void dispose() { unfocusNode.dispose(); + welcomeTemplateComponentModel.dispose(); } } diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index 7c0bab8f..6089703a 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -1,12 +1,9 @@ -import '/flutter_flow/flutter_flow_animations.dart'; +import '/components/templates_components/welcome_template_component/welcome_template_component_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import '/actions/actions.dart' as action_blocks; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:flutter_animate/flutter_animate.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'welcome_page_model.dart'; export 'welcome_page_model.dart'; @@ -18,14 +15,11 @@ class WelcomePageWidget extends StatefulWidget { State createState() => _WelcomePageWidgetState(); } -class _WelcomePageWidgetState extends State - with TickerProviderStateMixin { +class _WelcomePageWidgetState extends State { late WelcomePageModel _model; final scaffoldKey = GlobalKey(); - final animationsMap = {}; - @override void initState() { super.initState(); @@ -44,43 +38,6 @@ class _WelcomePageWidgetState extends State setState(() {}); } }); - - animationsMap.addAll({ - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), - ), - ], - ), - }); } @override @@ -103,381 +60,17 @@ class _WelcomePageWidgetState extends State backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: SafeArea( top: true, - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SafeArea( - child: Container( - width: 648.0, - height: 208.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.0), - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(14.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - FFLocalizations.of(context).getText( - '77d2ypub' /* UMA EXPERIÊCIA COMPLETA */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .accent1, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Text( - FFLocalizations.of(context).getText( - 'avhdhlhw' /* COM CONFORTO ONDE VOCÊ ESTIVER... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), - ), - ), - ), - Container( - width: 284.0, - height: 200.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', - width: 603.0, - height: double.infinity, - fit: BoxFit.contain, - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(34.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - boxShadow: const [ - BoxShadow( - blurRadius: 0.0, - color: Colors.transparent, - offset: Offset( - 0.0, - 0.0, - ), - ) - ], - borderRadius: BorderRadius.circular(12.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Builder( - builder: (context) { - 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), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: FFLocalizations.of(context) - .getText( - 'iw9yx5fr' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: - FlutterFlowTheme.of(context) - .primary, - textStyle: - FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: FFLocalizations.of(context) - .getText( - 'bs5mbse6' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: - FlutterFlowTheme.of(context) - .customColor1, - textStyle: - FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme - .of(context) - .primaryBackground, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: - GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, - ), - ), - ], - ); - } else { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: - FFLocalizations.of(context) - .getText( - 'cq85bqnj' /* Entrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 0.0), - color: FlutterFlowTheme.of( - context) - .primary, - textStyle: FlutterFlowTheme - .of(context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - onPressed: () { - print('Button pressed ...'); - }, - text: - FFLocalizations.of(context) - .getText( - 'iupuq6xs' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0, - 0.0, 0.0), - color: FlutterFlowTheme.of( - context) - .primary, - textStyle: FlutterFlowTheme - .of(context) - .titleSmall - .override( - fontFamily: - 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of( - context) - .info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: - BorderRadius.circular( - 12.0), - ), - showLoadingIndicator: false, - ), - ), - ), - ].divide(const SizedBox(width: 7.0)), - ); - } - }, - ), - ], - ), - ), - ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), - ), - ], - ), + child: wrapWithModel( + model: _model.welcomeTemplateComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: WelcomeTemplateComponentWidget( + toggleSignUpPage: () async { + await action_blocks.toggleSignUpPage(context); + }, + toggleSignInPage: () async { + await action_blocks.toggleSignInPage(context); + }, ), ), ), From 61b5080810277fd09ba5c647cf0088bc6d65a079 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:05:19 +0000 Subject: [PATCH 16/34] rollback pt.4 --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 806c139f..cc761af2 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409D27A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409227A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409727A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409B27A31CDF00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409D27A31CDC00820AF7 /* pt */, - 6436409227A31CDD00820AF7 /* en */, + 6436409727A31CDB00820AF7 /* pt */, + 6436409B27A31CDF00820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; From f6bc7ecf6a0ec9c94699560bf4b44dd77fad3331 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 29 Jul 2024 08:26:01 -0300 Subject: [PATCH 17/34] fix --- .../bottom_arrow_linked_locals_component_widget.dart | 2 ++ .../visit_details_modal_template_component_widget.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 328cbf05..b1ece369 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 @@ -1,3 +1,5 @@ +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 3ae6ce62..8a9309f9 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart'; -import 'package:hub/components/view_visit_detail/view_visit_detail_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { From 6ed94fb1b5b6896157234f78bedfbddfaf59a7b6 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 29 Jul 2024 12:07:28 -0300 Subject: [PATCH 18/34] fix: Login Logic and misc --- ios/Podfile.lock | 2 +- ...ot_password_template_component_widget.dart | 482 +++++++++--------- .../sign_in_template_component_widget.dart | 54 +- lib/flutter_flow/internationalization.dart | 22 +- .../components/atoms/atom_terms_of_use.dart | 40 ++ 5 files changed, 314 insertions(+), 286 deletions(-) create mode 100644 lib/shared/components/atoms/atom_terms_of_use.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 20609413..dbd080c3 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -311,6 +311,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 -PODFILE CHECKSUM: f2b7abe080b8e8f49e642b85431f5117d22149fe +PODFILE CHECKSUM: d7f4d1b71f8c708247c1078c4aec33a28c763405 COCOAPODS: 1.15.2 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 156672de..85f2dcef 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 @@ -49,186 +49,140 @@ class _ForgotPasswordTemplateComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + return GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 300.0, + constraints: const BoxConstraints( + maxWidth: 570.0, ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], + ), + ), + ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), ), ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText( - 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, - ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'mtz8l7ft' /* Email */, + ), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).accent1, - width: 2.0, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + hintStyle: + FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -237,80 +191,128 @@ class _ForgotPasswordTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - 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), - color: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 2.0, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent3, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + contentPadding: + const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: const Color(0xFF6F61EF), + validator: _model.emailAddressTextControllerValidator + .asValidator(context), ), - showLoadingIndicator: false, ), ), - ), - ], + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); + + if (PhpGroup.forgotPasswordCall.error( + (_model.req?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.forgotPasswordCall.msg( + (_model.req?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + 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), + color: const Color(0xFF1AAB5F), + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + ), + showLoadingIndicator: false, + ), + ), + ), + ], + ), ), ), ); 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 ae8cc9df..b172f83a 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 @@ -1,3 +1,5 @@ +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; + import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -93,6 +95,18 @@ class _SignInTemplateComponentWidgetState super.dispose(); } + bool _isFormInvalid() { + if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') { + return true; + } + + if (!RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(_model.emailAddressTextController.text)) { + return true; + } + + return false; + } + @override Widget build(BuildContext context) { return Row( @@ -205,7 +219,7 @@ class _SignInTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.always, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -518,12 +532,7 @@ class _SignInTemplateComponentWidgetState .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && - (_model.passwordTextController - .text == - '')) + onPressed: _isFormInvalid() ? null : () async { await action_blocks @@ -874,6 +883,7 @@ class _SignInTemplateComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { + await showModalBottomSheet( isScrollControlled: true, backgroundColor: @@ -885,12 +895,10 @@ class _SignInTemplateComponentWidgetState padding: MediaQuery.viewInsetsOf( context), - child: - const ForgotPasswordTemplateComponentWidget(), + child: const ForgotPasswordTemplateComponentWidget(), ); }, - ).then( - (value) => safeSetState(() {})); + ).then((value) => safeSetState(() {})); }, child: RichText( textScaler: MediaQuery.of(context) @@ -981,29 +989,7 @@ class _SignInTemplateComponentWidgetState ), ), ), - Text( - FFLocalizations.of(context).getText( - 'olf967cj' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), + const AtomTermsOfUse(), ], ), ), diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 9123791e..926890dd 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -873,28 +873,28 @@ final kTranslationsMap = >>[ 'en': 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', }, '1ltg0ylb': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, '2x19ce8k': { 'pt': 'Senha', 'en': 'Password', }, 'xhnawzcb': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', }, 's3j1hjqx': { - 'pt': 'E-mail Inv', - 'en': '', + 'pt': 'E-mail Inválido', + 'en': 'Invalid E-mail', }, '2ib9bf67': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, '9cs5wlmc': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', }, 'rkxwb0sg': { 'pt': 'Please choose an option from the dropdown', @@ -922,7 +922,7 @@ final kTranslationsMap = >>[ }, 'p5c6d54y': { 'pt': ' Recupere aqui', - 'en': ' recover here', + 'en': ' Recover here', }, 'olf967cj': { 'pt': 'Termo de Uso', @@ -1032,8 +1032,8 @@ final kTranslationsMap = >>[ 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, 'mtz8l7ft': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, 'w7y5wlnv': { 'pt': 'digite o seu email.....', diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart b/lib/shared/components/atoms/atom_terms_of_use.dart new file mode 100644 index 00000000..e1f29b9b --- /dev/null +++ b/lib/shared/components/atoms/atom_terms_of_use.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +import '../../../flutter_flow/flutter_flow_theme.dart'; +import '../../../flutter_flow/flutter_flow_util.dart'; + +class AtomTermsOfUse extends StatelessWidget { + + const AtomTermsOfUse({super.key}); + + @override + Widget build(BuildContext context) { + return InkWell( + child: Text( + FFLocalizations.of(context).getText( + 'olf967cj' /* Termo de Uso */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + onTap: () => launchURL('https://freaccess.com.br/pp'), + ); + } +} \ No newline at end of file From 736f3080e162d8b76f4ce0b084ff3a2a6153c353 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:09:38 +0000 Subject: [PATCH 19/34] fix forgot password template --- ios/Runner.xcodeproj/project.pbxproj | 8 +- ...got_password_template_component_model.dart | 21 +- ...ot_password_template_component_widget.dart | 226 +++++++++--------- lib/flutter_flow/internationalization.dart | 20 +- 4 files changed, 153 insertions(+), 122 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index cc761af2..4ad69147 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409727A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409B27A31CDF00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409827A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409D27A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409727A31CDB00820AF7 /* pt */, - 6436409B27A31CDF00820AF7 /* en */, + 6436409827A31CD800820AF7 /* pt */, + 6436409D27A31CD300820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index 4178de7c..c7fe19a6 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -8,15 +8,34 @@ class ForgotPasswordTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. + final formKey = GlobalKey(); // State field(s) for emailAddress widget. FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3hqg8buh' /* E-mail é Obrigatório */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return FFLocalizations.of(context).getText( + 'jh5r2b1w' /* E-mail Inválido */, + ); + } + return null; + } + // Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget. ApiCallResponse? req; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; + } @override void dispose() { 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 39cce295..5e82ed3d 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 @@ -3,6 +3,7 @@ import '/components/molecular_components/throw_exception/throw_exception_widget. import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; @@ -148,95 +149,92 @@ class _ForgotPasswordTemplateComponentWidgetState ), ), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'mtz8l7ft' /* Email */, + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.disabled, + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + onChanged: (_) => EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), ), - labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getText( - 'w7y5wlnv' /* digite o seu email..... */, - ), - hintStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( + autofocus: true, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'mtz8l7ft' /* E-mail */, + ), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, color: FlutterFlowTheme.of(context).accent1, - width: 2.0, + size: 22.0, ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.emailAddressTextControllerValidator + .asValidator(context), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), ), ), ), @@ -245,37 +243,39 @@ class _ForgotPasswordTemplateComponentWidgetState child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), + onPressed: (_model.emailAddressTextController.text == '') + ? null + : () async { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, ); - }, - ).then((value) => safeSetState(() {})); - } - setState(() {}); - }, + if (PhpGroup.forgotPasswordCall.error( + (_model.req?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.forgotPasswordCall.msg( + (_model.req?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, text: FFLocalizations.of(context).getText( '74rnd5bu' /* Enviar */, ), diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 91cb14b0..fd3f7663 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -1002,12 +1002,24 @@ final kTranslationsMap = >>[ 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, 'mtz8l7ft': { - 'pt': 'Email', - 'en': 'Email', + 'pt': 'E-mail', + 'en': 'E-mail', }, 'w7y5wlnv': { - 'pt': 'digite o seu email.....', - 'en': 'enter your email.....', + 'pt': '', + 'en': '', + }, + '3hqg8buh': { + 'pt': 'E-mail é Obrigatório', + 'en': '', + }, + 'jh5r2b1w': { + 'pt': 'E-mail Inválido', + 'en': '', + }, + '1p76vmkn': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', }, '74rnd5bu': { 'pt': 'Enviar', From 8258e0dfcb367cb7ae9c6354d583c534c2c2eb95 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 29 Jul 2024 15:23:28 -0300 Subject: [PATCH 20/34] feat: add validator and fixs --- lib/shared/utils/ValidatorUtil.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/shared/utils/ValidatorUtil.dart diff --git a/lib/shared/utils/ValidatorUtil.dart b/lib/shared/utils/ValidatorUtil.dart new file mode 100644 index 00000000..e69de29b From 765cc90956fd2b5e7c891eef6d0dad894f2c5e26 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 29 Jul 2024 15:23:39 -0300 Subject: [PATCH 21/34] feat: some changes --- .../forgot_password_template_component_widget.dart | 2 +- .../sign_in_template_component_widget.dart | 11 ++++------- lib/shared/utils/ValidatorUtil.dart | 10 ++++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) 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 85f2dcef..e642ab8f 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 @@ -174,7 +174,7 @@ class _ForgotPasswordTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, 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 b172f83a..2d946b1a 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 @@ -1,4 +1,6 @@ +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/ValidatorUtil.dart'; import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; @@ -100,7 +102,7 @@ class _SignInTemplateComponentWidgetState return true; } - if (!RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(_model.emailAddressTextController.text)) { + if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) { return true; } @@ -180,12 +182,7 @@ class _SignInTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/sr43ucngg4a4/Vector.png', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, - ), + child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155), ), ), Column( diff --git a/lib/shared/utils/ValidatorUtil.dart b/lib/shared/utils/ValidatorUtil.dart index e69de29b..71e83154 100644 --- a/lib/shared/utils/ValidatorUtil.dart +++ b/lib/shared/utils/ValidatorUtil.dart @@ -0,0 +1,10 @@ +class ValidatorUtil { + + static bool isValidEmail(String email) { + if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) { + return true; + } else { + return false; + } + } +} \ No newline at end of file From 5ca3543f64f43f779fd76065a80accd1ae9292ca Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:42:19 +0000 Subject: [PATCH 22/34] fix: Validation Form Forgot --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- .../forgot_password_template_component_widget.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4ad69147..c7791f37 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409827A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409D27A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409827A31CD000820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409F27A31CD600820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409827A31CD800820AF7 /* pt */, - 6436409D27A31CD300820AF7 /* en */, + 6436409827A31CD000820AF7 /* pt */, + 6436409F27A31CD600820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; 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 5e82ed3d..cee2bd32 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 @@ -151,7 +151,7 @@ class _ForgotPasswordTemplateComponentWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.disabled, + autovalidateMode: AutovalidateMode.always, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( From fb738c4b235556c6d85849e91adaf9ddf9ec7244 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 29 Jul 2024 15:53:52 -0300 Subject: [PATCH 23/34] fix --- ...got_password_template_component_model.dart | 2 - ...ot_password_template_component_widget.dart | 405 ++++++------------ 2 files changed, 138 insertions(+), 269 deletions(-) diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index dfc5ab56..2cb2b7f3 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -4,8 +4,6 @@ import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget; import 'package:flutter/material.dart'; - - class ForgotPasswordTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. 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 ebe67f33..1ce56e1c 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 @@ -11,9 +11,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; export 'forgot_password_template_component_model.dart'; -// - - class ForgotPasswordTemplateComponentWidget extends StatefulWidget { const ForgotPasswordTemplateComponentWidget({super.key}); @@ -50,94 +47,74 @@ class _ForgotPasswordTemplateComponentWidgetState @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, + return Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: double.infinity, + height: 300.0, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - ), - ), - ], - ), - ), - ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), + ), + ], ), ), ), @@ -148,13 +125,13 @@ class _ForgotPasswordTemplateComponentWidgetState 'xxm3ajsy' /* ESQUECEU SUA SENHA? */, ), style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), + ), ), ), Padding( @@ -164,19 +141,19 @@ class _ForgotPasswordTemplateComponentWidgetState 'wu2f7yzo' /* Não se preucupe nós vamos te a... */, ), style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), ), ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( @@ -187,7 +164,7 @@ class _ForgotPasswordTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.emailAddressTextController', const Duration(milliseconds: 500), - () => setState(() {}), + () => setState(() {}), ), autofocus: true, autofillHints: const [AutofillHints.email], @@ -198,15 +175,15 @@ class _ForgotPasswordTemplateComponentWidgetState 'mtz8l7ft' /* E-mail */, ), labelStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).accent1, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).primary, @@ -246,14 +223,14 @@ class _ForgotPasswordTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), maxLines: null, keyboardType: TextInputType.emailAddress, cursorColor: FlutterFlowTheme.of(context).primary, @@ -271,36 +248,36 @@ class _ForgotPasswordTemplateComponentWidgetState onPressed: (_model.emailAddressTextController.text == '') ? null : () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); - if (PhpGroup.forgotPasswordCall.error( + if (PhpGroup.forgotPasswordCall.error( + (_model.req?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.forgotPasswordCall.msg( (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); + )!, + ), + ); }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, text: FFLocalizations.of(context).getText( '74rnd5bu' /* Enviar */, ), @@ -309,134 +286,28 @@ class _ForgotPasswordTemplateComponentWidgetState 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), + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), color: const Color(0xFF1AAB5F), textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + color: Colors.white, + fontSize: 16.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: const Color(0xFF6F61EF), - validator: _model.emailAddressTextControllerValidator - .asValidator(context), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), ), + showLoadingIndicator: false, ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - 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), - color: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - ), - showLoadingIndicator: false, - ), - ), - ), - ], - ), + ), + ], ), ), ); From cd708155fe94cf955657e1a9a7db984602bd178f Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:54:37 +0000 Subject: [PATCH 24/34] fix: Styles forgot --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- ...orgot_password_template_component_widget.dart | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c7791f37..4ab490b9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409827A31CD000820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409F27A31CD600820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409827A31CD000820AF7 /* pt */, - 6436409F27A31CD600820AF7 /* en */, + 6436409227A31CD800820AF7 /* pt */, + 6436409127A31CDB00820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; 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 cee2bd32..d271a8d3 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 @@ -175,7 +175,7 @@ class _ForgotPasswordTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -183,35 +183,33 @@ class _ForgotPasswordTemplateComponentWidgetState .containsKey('Plus Jakarta Sans'), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 2.0, + borderSide: const BorderSide( + color: Colors.black, + width: 0.25, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).primary, - width: 2.0, + width: 0.25, ), borderRadius: BorderRadius.circular(12.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, - width: 2.0, + width: 0.25, ), borderRadius: BorderRadius.circular(12.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, - width: 2.0, + width: 0.25, ), borderRadius: BorderRadius.circular(12.0), ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, contentPadding: const EdgeInsetsDirectional.fromSTEB( 24.0, 24.0, 20.0, 24.0), suffixIcon: Icon( From 3a977fd2422f51ac2a6c57f7acfb7baff3fbef7c Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Tue, 30 Jul 2024 10:57:13 -0300 Subject: [PATCH 25/34] =?UTF-8?q?fix:=20Corre=C3=A7=C3=A3o=20Tela=20de=20L?= =?UTF-8?q?ogin=20e=20Esqueci=20minha=20Senha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Podfile.lock | 44 +++++ lib/actions/actions.dart | 152 ++++++++--------- .../throw_exception_widget.dart | 161 ++++++++++-------- ...got_password_template_component_model.dart | 4 +- ...ot_password_template_component_widget.dart | 74 ++++---- .../sign_in_template_component_widget.dart | 99 +++++------ lib/flutter_flow/internationalization.dart | 8 +- lib/main.dart | 6 + .../schedule_complete_visit_page_widget.dart | 2 +- lib/shared/enums/enum_throw_exception.dart | 5 + lib/shared/utils/dialog_util.dart | 59 +++++++ lib/shared/utils/log_util.dart | 15 ++ ...ValidatorUtil.dart => validator_util.dart} | 0 pubspec.lock | 16 ++ pubspec.yaml | 1 + 15 files changed, 396 insertions(+), 250 deletions(-) create mode 100644 lib/shared/enums/enum_throw_exception.dart create mode 100644 lib/shared/utils/dialog_util.dart create mode 100644 lib/shared/utils/log_util.dart rename lib/shared/utils/{ValidatorUtil.dart => validator_util.dart} (100%) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index dbd080c3..0aa4fbd2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -42,6 +42,9 @@ PODS: - FirebaseAnalytics (~> 10.27.0) - Firebase/CoreOnly (10.27.0): - FirebaseCore (= 10.27.0) + - Firebase/Crashlytics (10.27.0): + - Firebase/CoreOnly + - FirebaseCrashlytics (~> 10.27.0) - Firebase/Messaging (10.27.0): - Firebase/CoreOnly - FirebaseMessaging (~> 10.27.0) @@ -52,6 +55,10 @@ PODS: - firebase_core (3.1.0): - Firebase/CoreOnly (= 10.27.0) - Flutter + - firebase_crashlytics (4.0.1): + - Firebase/Crashlytics (= 10.27.0) + - firebase_core + - Flutter - firebase_messaging (15.0.1): - Firebase/Messaging (= 10.27.0) - firebase_core @@ -78,8 +85,19 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreExtension (10.29.0): + - FirebaseCore (~> 10.0) - FirebaseCoreInternal (10.28.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseCrashlytics (10.27.0): + - FirebaseCore (~> 10.5) + - FirebaseInstallations (~> 10.0) + - FirebaseRemoteConfigInterop (~> 10.23) + - FirebaseSessions (~> 10.5) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (~> 2.1) - FirebaseInstallations (10.28.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) @@ -94,6 +112,16 @@ PODS: - GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) - nanopb (< 2.30911.0, >= 2.30908.0) + - FirebaseRemoteConfigInterop (10.29.0) + - FirebaseSessions (10.29.0): + - FirebaseCore (~> 10.5) + - FirebaseCoreExtension (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/Environment (~> 7.13) + - GoogleUtilities/UserDefaults (~> 7.13) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesSwift (~> 2.1) - Flutter (1.0.0) - flutter_inappwebview_ios (0.0.1): - Flutter @@ -174,6 +202,8 @@ PODS: - permission_handler_apple (9.3.0): - Flutter - PromisesObjC (2.4.0) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) - SDWebImage (5.19.2): - SDWebImage/Core (= 5.19.2) - SDWebImage/Core (5.19.2) @@ -199,6 +229,7 @@ DEPENDENCIES: - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`) @@ -222,15 +253,20 @@ SPEC REPOS: - Firebase - FirebaseAnalytics - FirebaseCore + - FirebaseCoreExtension - FirebaseCoreInternal + - FirebaseCrashlytics - FirebaseInstallations - FirebaseMessaging + - FirebaseRemoteConfigInterop + - FirebaseSessions - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities - nanopb - OrderedSet - PromisesObjC + - PromisesSwift - SDWebImage - SwiftyGif @@ -243,6 +279,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_analytics/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" + firebase_crashlytics: + :path: ".symlinks/plugins/firebase_crashlytics/ios" firebase_messaging: :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: @@ -282,12 +320,17 @@ SPEC CHECKSUMS: Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86 firebase_analytics: 0627e95b73eb9e04f59167687ed5bc3f6fb50f23 firebase_core: 483cfad66d24d8f3c233f31db4263830c625c909 + firebase_crashlytics: 8f04c663c8734f97c4ccbe81b8511ce7060e3b28 firebase_messaging: e60c0694699d8a2e56a319e043709583f6544123 FirebaseAnalytics: f9211b719db260cc91aebee8bb539cb367d0dfd1 FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808 + FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreInternal: 58d07f1362fddeb0feb6a857d1d1d1c5e558e698 + FirebaseCrashlytics: 81ea6ec96519388687f6061beb838a8eec482293 FirebaseInstallations: 60c1d3bc1beef809fd1ad1189a8057a040c59f2e FirebaseMessaging: 585984d0a1df120617eb10b44cad8968b859815e + FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d + FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 @@ -302,6 +345,7 @@ SPEC CHECKSUMS: path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 SDWebImage: dfe95b2466a9823cf9f0c6d01217c06550d7b29a share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 5d80d184..2a864382 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -14,6 +14,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/random_data_util.dart'; import 'package:hub/pages/home_page/home_page_model.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; import 'package:qr_flutter/qr_flutter.dart'; @@ -21,6 +22,8 @@ import 'package:qr_flutter/qr_flutter.dart'; import 'package:url_launcher/url_launcher.dart'; +import '../shared/utils/log_util.dart'; + Future openTermsOfUse(BuildContext context) async { log('openTermsOfUse'); final Uri url = Uri.parse('https://freaccess.com.br/pp/'); @@ -108,92 +111,89 @@ Future singInLoginAction( String? emailAdress, String? password, }) async { - String? devUUID; - ApiCallResponse? loginCall; - await Future.wait([ - Future(() async { - FFAppState().email = emailAdress!; - }), - Future(() async { - FFAppState().passwd = password!; - }), - ]); - if ((FFAppState().email != '') && (FFAppState().passwd != '')) { - devUUID = await getDevUUID(); - FFAppState().devUUID = devUUID!; - loginCall = await PhpGroup.loginCall.call( - email: FFAppState().email, - password: FFAppState().passwd, - uuid: FFAppState().devUUID, - type: FFAppState().device, - description: randomString( - 10, - 10, - true, - false, - false, - ), - ); + try { + String? devUUID; + ApiCallResponse? loginCall; - if (PhpGroup.loginCall.error( + await Future.wait([ + Future(() async { + FFAppState().email = emailAdress!; + }), + Future(() async { + FFAppState().passwd = password!; + }), + ]); + + if ((FFAppState().email != '') && (FFAppState().passwd != '')) { + devUUID = await getDevUUID(); + + FFAppState().devUUID = devUUID!; + + loginCall = await PhpGroup.loginCall.call( + email: FFAppState().email, + password: FFAppState().passwd, + uuid: FFAppState().devUUID, + type: FFAppState().device, + description: randomString( + 10, + 10, + true, + false, + false, + ), + ); + + if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { + + FFAppState().userUUID = PhpGroup.loginCall.userUUID( (loginCall.jsonBody ?? ''), - ) == - false) { - FFAppState().userUUID = PhpGroup.loginCall.userUUID( - (loginCall.jsonBody ?? ''), - )!; - // FFAppState().token = await FirebaseMessaging.instance.getToken(); - FFAppState().createdAt = dateTimeFormat( - 'd/M/y H:mm:ss', - getCurrentTimestamp, - locale: FFLocalizations.of(context).languageCode, - ); - FFAppState().updatedAt = '00/00/0000 00:00:00'; - FFAppState().status = PhpGroup.loginCall.userStatus( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().name = PhpGroup.loginCall.userName( - (loginCall.jsonBody ?? ''), - )!; - FFAppState().serialNumber = await getSerialNumber() ?? ''; - FFAppState().isLogged = true; - await toggleHomePage(context); - return; - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.loginCall.msg( - (loginCall?.jsonBody ?? ''), - )!, - ), - ); - }, - ); + )!; - FFAppState().deleteEmail(); - FFAppState().email = ''; + FFAppState().createdAt = dateTimeFormat( + 'd/M/y H:mm:ss', + getCurrentTimestamp, + locale: FFLocalizations.of(context).languageCode, + ); - FFAppState().deletePasswd(); - FFAppState().passwd = ''; + FFAppState().updatedAt = '00/00/0000 00:00:00'; - FFAppState().update(() {}); + FFAppState().status = PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; + + FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; + + FFAppState().name = PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; + + FFAppState().serialNumber = await getSerialNumber() ?? ''; + + FFAppState().isLogged = true; + + await toggleHomePage(context); + } else { + + if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { + DialogUtil.errorDefault(context); + } else { + DialogUtil.error(context, PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); + } + + FFAppState().deleteEmail(); + FFAppState().email = ''; + + FFAppState().deletePasswd(); + FFAppState().passwd = ''; + + FFAppState().update(() {}); + } } return; - } else { - return; + + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed('login.php', emailAdress.toString(), "Login", e, s); } + } Future signUpRegisterAction( 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 95333ddd..6026a836 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/shared/enums/enum_throw_exception.dart'; + import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -7,15 +9,16 @@ import 'package:google_fonts/google_fonts.dart'; import 'throw_exception_model.dart'; export 'throw_exception_model.dart'; -/// - class ThrowExceptionWidget extends StatefulWidget { - const ThrowExceptionWidget({ + + ThrowExceptionWidget({ super.key, required this.msg, + this.type = EnumThrowException.error }); final String? msg; + EnumThrowException type; @override State createState() => _ThrowExceptionWidgetState(); @@ -61,6 +64,39 @@ class _ThrowExceptionWidgetState extends State super.dispose(); } + Color _getColorByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FlutterFlowTheme.of(context).error; + case EnumThrowException.warning: + return FlutterFlowTheme.of(context).warning; + case EnumThrowException.success: + return FlutterFlowTheme.of(context).success; + } + } + + IconData _getIconByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return Icons.cancel_outlined; + case EnumThrowException.warning: + return Icons.warning_amber_outlined; + case EnumThrowException.success: + return Icons.check_circle_outline; + } + } + + String _getTitleByType(BuildContext context) { + switch (widget.type) { + case EnumThrowException.error: + return FFLocalizations.of(context).getVariableText(ptText: "Falha :(", enText: "Fail :("); + case EnumThrowException.warning: + return FFLocalizations.of(context).getVariableText(ptText: "Aviso :O", enText: "Warning :O"); + case EnumThrowException.success: + return FFLocalizations.of(context).getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");; + } + } + @override Widget build(BuildContext context) { return Column( @@ -77,85 +113,62 @@ class _ThrowExceptionWidgetState extends State onTap: () async { Navigator.pop(context); }, - child: Container( - height: 400.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(10.0), - bottomRight: Radius.circular(10.0), - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0), - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.circle_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, - ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Icon( + _getIconByType(context), + color: _getColorByType(context), + size: 150.0, ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.close_outlined, - color: FlutterFlowTheme.of(context).error, - size: 200.0, + ), + ], + ).animateOnPageLoad( + animationsMap['stackOnPageLoadAnimation']!), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + _getTitleByType(context), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 20.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Text( + valueOrDefault( + widget.msg, + 'Message Not Found', ), - ), - ], - ).animateOnPageLoad( - animationsMap['stackOnPageLoadAnimation']!), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - 'e58xxxiq' /* ERRO */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), ), ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Text( - valueOrDefault( - widget.msg, - 'Message Not Found', - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ].addToStart(const SizedBox(height: 50.0)), - ), - ], - ), + ), + ].addToStart(const SizedBox(height: 20.0)), + ), + ], ), ), ), diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index 2cb2b7f3..13c3c56a 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -1,3 +1,5 @@ +import 'package:hub/shared/utils/validator_util.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'forgot_password_template_component_widget.dart' @@ -21,7 +23,7 @@ class ForgotPasswordTemplateComponentModel ); } - if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + if (!ValidatorUtil.isValidEmail(val)) { return FFLocalizations.of(context).getText( 'jh5r2b1w' /* E-mail Inválido */, ); 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 22e1d193..1c7a7c0a 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -1,4 +1,9 @@ +import 'dart:developer'; + import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; @@ -187,28 +192,28 @@ class _ForgotPasswordTemplateComponentWidgetState enabledBorder: OutlineInputBorder( borderSide: const BorderSide( color: Colors.black, - width: 0.25, + width: 2.00, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).primary, - width: 0.25, + width: 2.00, ), borderRadius: BorderRadius.circular(12.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, - width: 0.25, + width: 2.00, ), borderRadius: BorderRadius.circular(12.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, - width: 0.25, + width: 2.00, ), borderRadius: BorderRadius.circular(12.0), ), @@ -216,7 +221,7 @@ class _ForgotPasswordTemplateComponentWidgetState 24.0, 24.0, 20.0, 24.0), suffixIcon: Icon( Icons.email, - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, size: 22.0, ), ), @@ -243,38 +248,31 @@ class _ForgotPasswordTemplateComponentWidgetState child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), child: FFButtonWidget( - onPressed: (_model.emailAddressTextController.text == '') + onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) ? null : () async { - _model.req = await PhpGroup.forgotPasswordCall.call( - email: _model.emailAddressTextController.text, - ); - if (PhpGroup.forgotPasswordCall.error( - (_model.req?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.forgotPasswordCall.msg( - (_model.req?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); + try { + _model.req = await PhpGroup.forgotPasswordCall.call( + email: _model.emailAddressTextController.text, + ); + + if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) { + await DialogUtil.success(context, FFLocalizations.of(context).getVariableText( + enText: "Send E-mail Successful!", + ptText: "E-mail Enviado com Sucesso!" + )); + Navigator.pop(context); + } else { + await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!); + } + + setState(() {}); + + } catch (error, stack) { + LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack); + await DialogUtil.errorDefault(context); } - - setState(() {}); }, text: FFLocalizations.of(context).getText( '74rnd5bu' /* Enviar */, @@ -285,7 +283,7 @@ class _ForgotPasswordTemplateComponentWidgetState 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: const Color(0xFF1AAB5F), + color: FlutterFlowTheme.of(context).primary, textStyle: FlutterFlowTheme.of(context).titleSmall.override( fontFamily: 'Plus Jakarta Sans', color: Colors.white, @@ -300,8 +298,14 @@ class _ForgotPasswordTemplateComponentWidgetState color: Colors.transparent, width: 1.0, ), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), - showLoadingIndicator: false, + showLoadingIndicator: true, ), ), ), 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 2d946b1a..572d14f9 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 @@ -1,6 +1,8 @@ import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; -import 'package:hub/shared/utils/ValidatorUtil.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; +import 'package:hub/shared/utils/validator_util.dart'; import '/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart'; import '/flutter_flow/flutter_flow_animations.dart'; @@ -695,34 +697,25 @@ class _SignInTemplateComponentWidgetState .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model.emailAddressTextController - .text == - '') || - ((_model.emailAddressFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.emailAddressTextController - .text == - '') || - ((_model.passwordTextController.text == - '') || - ((_model.passwordFocusNode?.hasFocus ?? - false) != - null)))) + onPressed: _isFormInvalid() ? null : () async { - await action_blocks - .singInLoginAction( - context, - emailAdress: _model - .emailAddressTextController - .text, - password: _model - .passwordTextController - .text, - ); - setState(() {}); + try { + await action_blocks + .singInLoginAction( + context, + 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) @@ -784,8 +777,7 @@ class _SignInTemplateComponentWidgetState disabledColor: const Color(0xE81AAB5F), ), - showLoadingIndicator: - false, + showLoadingIndicator: true, ), ), ), @@ -880,18 +872,13 @@ class _SignInTemplateComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await showModalBottomSheet( isScrollControlled: true, - backgroundColor: - Colors.transparent, - enableDrag: false, + backgroundColor: Colors.transparent, context: context, builder: (context) { return Padding( - padding: - MediaQuery.viewInsetsOf( - context), + padding: MediaQuery.viewInsetsOf(context), child: const ForgotPasswordTemplateComponentWidget(), ); }, @@ -941,29 +928,23 @@ class _SignInTemplateComponentWidgetState ), mouseCursor: SystemMouseCursors.click, - recognizer: - TapGestureRecognizer() - ..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( - () {})); - }, + // recognizer: TapGestureRecognizer() + // ..onTap = () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // context: context, + // useRootNavigator: true, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: const ForgotPasswordTemplateComponentWidget(), + // ); + // }, + // ).then((value) => + // safeSetState( + // () {})); + // }, ) ], style: diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index d00d8320..1a825db4 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -569,8 +569,8 @@ final kTranslationsMap = >>[ // throwException { 'e58xxxiq': { - 'pt': 'ERRO', - 'en': 'ERROR', + 'pt': 'Falha :(', + 'en': 'Fail :(', }, }, // regisiterVistorTemplateComponent @@ -1041,11 +1041,11 @@ final kTranslationsMap = >>[ }, '3hqg8buh': { 'pt': 'E-mail é Obrigatório', - 'en': '', + 'en': 'E-mail is Required', }, 'jh5r2b1w': { 'pt': 'E-mail Inválido', - 'en': '', + 'en': 'Invalid E-mail', }, '1p76vmkn': { 'pt': 'Please choose an option from the dropdown', diff --git a/lib/main.dart b/lib/main.dart index 3348f78f..2590c721 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:hub/app_state.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/internationalization.dart'; @@ -29,6 +30,8 @@ void main() async { Future initializeApp() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; + await FlutterFlowTheme.initialize(); await FFLocalizations.initialize(); final appState = FFAppState(); @@ -57,6 +60,9 @@ class _MyAppState extends State { @override void initState() { super.initState(); + + FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + _appStateNotifier = AppStateNotifier.instance; _router = createRouter(_appStateNotifier); Future.delayed(const Duration(milliseconds: 1000), 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 8b684610..e1fdf3b6 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 @@ -1773,7 +1773,7 @@ Widget scheduleVisit( : FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: const ThrowExceptionWidget( + child: ThrowExceptionWidget( msg: 'Campos obrigatórios imcompletos.', ), ), diff --git a/lib/shared/enums/enum_throw_exception.dart b/lib/shared/enums/enum_throw_exception.dart new file mode 100644 index 00000000..f1bf2a08 --- /dev/null +++ b/lib/shared/enums/enum_throw_exception.dart @@ -0,0 +1,5 @@ +enum EnumThrowException { + success, + error, + warning +} \ No newline at end of file diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart new file mode 100644 index 00000000..6db1ed89 --- /dev/null +++ b/lib/shared/utils/dialog_util.dart @@ -0,0 +1,59 @@ + +import 'package:flutter/material.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/enums/enum_throw_exception.dart'; + +class DialogUtil { + static const double _height = 350; + + static Future errorDefault(BuildContext context) { + return error(context, FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later." + )); + } + + static Future error(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error)) + ) + ); + } + ); + } + + static Future warning(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning)) + ) + ); + } + ); + } + + static Future success(BuildContext context, String message) async { + return await showDialog( + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success)) + ) + ); + } + ); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/log_util.dart b/lib/shared/utils/log_util.dart new file mode 100644 index 00000000..64a30e12 --- /dev/null +++ b/lib/shared/utils/log_util.dart @@ -0,0 +1,15 @@ +import 'dart:developer'; + +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +class LogUtil { + + static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { + FirebaseCrashlytics.instance.setCustomKey('URL', "${PhpGroup.getBaseUrl()}/$url"); + FirebaseCrashlytics.instance.setCustomKey('Body', body); + + await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); + } + +} \ No newline at end of file diff --git a/lib/shared/utils/ValidatorUtil.dart b/lib/shared/utils/validator_util.dart similarity index 100% rename from lib/shared/utils/ValidatorUtil.dart rename to lib/shared/utils/validator_util.dart diff --git a/pubspec.lock b/pubspec.lock index a64d3263..db941ddb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -345,6 +345,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.17.2" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + sha256: ad7510d9bcf1f40fc895944942f553a4c5603acb4715c0d6386dd587f82f6ae5 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + sha256: "318589f1da3bb858872002fa20170234566f0fb080669a8256c85a81513a802a" + url: "https://pub.dev" + source: hosted + version: "3.6.37" firebase_messaging: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 276cf9cc..8efce314 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,6 +107,7 @@ dependencies: flutter_riverpod: ^2.5.1 qr_flutter: ^4.1.0 permission_handler: ^11.3.1 + firebase_crashlytics: ^4.0.1 dependency_overrides: http: 1.2.1 From 0b57716abe737ae0ce6e3e445a9e7f2b5fd4cddd Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Mon, 29 Jul 2024 09:36:46 -0300 Subject: [PATCH 26/34] fix: add form validador --- lib/flutter_flow/upload_data.dart | 16 +- .../register_visitor_page_model.dart | 59 +- .../register_visitor_page_widget.dart | 1501 +++++++++-------- 3 files changed, 837 insertions(+), 739 deletions(-) diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 6b6baf2b..917034cd 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -52,8 +52,8 @@ Future?> selectMediaWithSourceBottomSheet({ required bool allowPhoto, bool allowVideo = false, String pickerFontFamily = 'Roboto', - Color textColor = const Color(0xFF111417), - Color backgroundColor = const Color(0xFFF5F5F5), + // Color textColor = const Color(0xFF111417), + // Color backgroundColor = const Color(0xFFF5F5F5), bool includeDimensions = false, bool includeBlurHash = false, }) async { @@ -63,12 +63,12 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor, + color: FlutterFlowTheme.of(context).primaryText, fontWeight: FontWeight.w600, fontSize: 20, ), ), - tileColor: backgroundColor, + tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: false, onTap: () => Navigator.pop( context, @@ -77,7 +77,7 @@ Future?> selectMediaWithSourceBottomSheet({ ); final mediaSource = await showModalBottomSheet( context: context, - backgroundColor: backgroundColor, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, builder: (context) { return Column( mainAxisSize: MainAxisSize.min, @@ -91,13 +91,13 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: textColor.withOpacity(0.65), + color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), ), - tileColor: backgroundColor, - dense: false, + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: true, ), ), const Divider(), diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 96b3252e..7c216c8d 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -17,10 +17,28 @@ class RegisterVisitorPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for DropDown widget. String? dropDownValue; FormFieldController? dropDownValueController; @@ -28,17 +46,56 @@ class RegisterVisitorPageModel FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // State field(s) for TextField widget. FocusNode? textFieldFocusNode4; TextEditingController? textController4; String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. String? imgBase64; // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. ApiCallResponse? scheduleVisitor; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } @override void dispose() { diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index c495da52..ea48ca5f 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -116,772 +116,813 @@ class _RegisterVisitorPageWidgetState extends State { ), ), child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Builder( + builder: (context) { + if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + setState(() { + _model.isDataUploading = false; + _model.uploadedLocalFile = FFUploadedFile( + bytes: Uint8List.fromList([])); + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.memory( + _model.uploadedLocalFile.bytes ?? + Uint8List.fromList([]), + width: 300.0, + height: 200.0, + fit: BoxFit.cover, + ), ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - 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(); - _model.isDataUploading = false; + ); + } else { + return Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: FFButtonWidget( + onPressed: () async { + final selectedMedia = + await selectMediaWithSourceBottomSheet( + context: context, + maxWidth: 300.00, + maxHeight: 300.00, + imageQuality: 0, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null && + selectedMedia.every((m) => + validateFileFormat( + m.storagePath, context))) { + setState( + () => _model.isDataUploading = true); + var selectedUploadedFiles = + []; + + try { + showUploadMessage( + context, + 'Uploading file...', + 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(); + _model.isDataUploading = false; + } + if (selectedUploadedFiles.length == + selectedMedia.length) { + setState(() { + _model.uploadedLocalFile = + selectedUploadedFiles.first; + }); + showUploadMessage(context, 'Success!'); + } else { + setState(() {}); + showUploadMessage( + context, 'Failed to upload data'); + return; + } } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, + }, + text: '', + icon: Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context).accent1, + size: 30.0, + ), + options: FFButtonOptions( + width: 300.0, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, + 0.0, 50.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy' /* Clique para adicionar a foto p... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), - borderRadius: BorderRadius.circular(8.0), ), ), + ], + ); + } + }, + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'zazj5d8b' /* Preencha o formulário com os d... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'v7g73yik' /* Nome */, + ), + 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), + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor6, + width: 0.5, ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), + 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.person, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + maxLines: null, + keyboardType: TextInputType.name, + validator: _model.textController1Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + 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), ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + 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.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ), + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: FlutterFlowTheme.of(context).error, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodySmallFamily), + )), ), ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - 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), - ), - 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), - ), - 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.person, - color: FlutterFlowTheme.of(context).accent1, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - 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), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'bqpucwh0' /* Contatos */, ), - 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.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - 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), - ), - 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), - ), - 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.phone, - color: FlutterFlowTheme.of(context).accent1, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - 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), - ), - 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), - ), - 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.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( + Padding( padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'h84ls2r6' /* Telefone */, + ), + 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), + ), + 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), + ), + 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.phone, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController3Validator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'fqp7qmka' /* Email */, + ), + 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), + ), + 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), + ), + 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.email, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + keyboardType: TextInputType.emailAddress, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + if (((_model.uploadedLocalFile.bytes + ?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: '7654553234232342', + nome: 'Test', + tipo: 'V', + foto: 'base64;jpeg,klajsalkjslkajslkajl', + ).onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context).getVariableText( + ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); }); + + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + }); + setState(() { + _model.dropDownValueController?.reset(); + }); + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg:FFLocalizations.of(context).getVariableText( + ptText: 'Erro ao cadastrar visitante. Tente novamente.', + enText: 'Error registering visitor. Try again.', + ), + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, + await showAdaptiveDialog( context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => Navigator.pop(context), child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.scheduleVisitor?.jsonBody ?? - ''), - )}', + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context).getVariableText( + ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), ), - ), + ), ); }, ).then((value) => safeSetState(() {})); } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, + + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.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, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), ), ), ), ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)), + ), ), ), ), From cb6a55cfd3f326114a045657d0021626f0a83840 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Tue, 30 Jul 2024 11:06:32 -0300 Subject: [PATCH 27/34] misc --- lib/actions/actions.dart | 409 ++++---- lib/app_state.dart | 58 +- .../throw_exception_widget.dart | 37 +- .../visitor_not_found_component_widget.dart | 33 +- ...ot_password_template_component_widget.dart | 2 +- ...siter_vistor_template_component_model.dart | 94 +- ...iter_vistor_template_component_widget.dart | 638 +++++++----- .../sign_in_template_component_model.dart | 1 + .../sign_in_template_component_widget.dart | 124 ++- ...earch_modal_template_component_widget.dart | 800 ++++++++------- lib/flutter_flow/flutter_flow_util.dart | 89 +- lib/pages/home_page/home_page_widget.dart | 908 ++++++++--------- .../preferences_settings_model.dart | 245 +++-- .../preferences_settings_widget.dart | 107 +- .../register_visitor_page_model.dart | 108 +- .../register_visitor_page_widget.dart | 933 +----------------- .../schedule_complete_visit_page_model.dart | 4 +- .../schedule_complete_visit_page_widget.dart | 250 ++--- 18 files changed, 2124 insertions(+), 2716 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 2a864382..987a4a53 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -17,9 +17,6 @@ import 'package:hub/pages/home_page/home_page_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:qr_flutter/qr_flutter.dart'; - - - import 'package:url_launcher/url_launcher.dart'; import '../shared/utils/log_util.dart'; @@ -111,7 +108,6 @@ Future singInLoginAction( String? emailAdress, String? password, }) async { - try { String? devUUID; ApiCallResponse? loginCall; @@ -144,8 +140,7 @@ Future singInLoginAction( ), ); - if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { - + if (PhpGroup.loginCall.error((loginCall.jsonBody ?? '')) == false) { FFAppState().userUUID = PhpGroup.loginCall.userUUID( (loginCall.jsonBody ?? ''), )!; @@ -158,11 +153,14 @@ Future singInLoginAction( FFAppState().updatedAt = '00/00/0000 00:00:00'; - FFAppState().status = PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; + FFAppState().status = + PhpGroup.loginCall.userStatus((loginCall.jsonBody ?? ''))!; - FFAppState().userDevUUID = PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; + FFAppState().userDevUUID = + PhpGroup.loginCall.userDeviceId((loginCall.jsonBody ?? ''))!; - FFAppState().name = PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; + FFAppState().name = + PhpGroup.loginCall.userName((loginCall.jsonBody ?? ''))!; FFAppState().serialNumber = await getSerialNumber() ?? ''; @@ -170,11 +168,11 @@ Future singInLoginAction( await toggleHomePage(context); } else { - if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { DialogUtil.errorDefault(context); } else { - DialogUtil.error(context, PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); + DialogUtil.error(context, + PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')).toString()); } FFAppState().deleteEmail(); @@ -188,12 +186,11 @@ Future singInLoginAction( } return; - } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('login.php', emailAdress.toString(), "Login", e, s); + LogUtil.requestAPIFailed( + 'login.php', emailAdress.toString(), "Login", e, s); } - } Future signUpRegisterAction( @@ -333,7 +330,6 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { - context.pushNamed( 'signUpPage', extra: { @@ -468,12 +464,12 @@ Future checkLocals({ ), ), ); - safeSetState(() {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. + safeSetState( + () {}); // Chamada otimizada fora do then para evitar encadeamentos desnecessários. return false; } } - Future changeStatusAction( BuildContext context, String status, @@ -523,13 +519,9 @@ Future changeStatusAction( default: break; } - - } - -/// QR Code - +/// QR Code Uint8List assembleQRPacket(int direction, String identifier, String password) { List packet = [direction]; @@ -569,13 +561,15 @@ Uint8List assembleQRPacket(int direction, String identifier, String password) { check ^= b; } - if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) { + if (check == int.parse('0D', radix: 16) || + check == int.parse('0A', radix: 16)) { packet.add(int.parse('FF', radix: 16)); } else { packet.add(check); } - var bytes = packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); + var bytes = + packet.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join((' ')); log("Pacote: $packet"); log("Bytes: $bytes"); @@ -586,22 +580,24 @@ Uint8List hexStringToByteArray(String s) { int len = s.length; Uint8List data = Uint8List(len ~/ 2); for (int i = 0; i < len; i += 2) { - data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); + data[i ~/ 2] = + ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); } return data; } String byteToHexa(Uint8List pDados) { - return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join(); + return pDados + .map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()) + .join(); } Future byteToString(Uint8List bytes) async { return String.fromCharCodes(bytes); } - Widget buildQrCode( -{ + { // required String data, // required String type, // required int version, @@ -610,204 +606,207 @@ Widget buildQrCode( required double dimension, required String identifier, required String pass, - required int direction - } - ) { + required int direction}) { try { log("pass: $pass"); const Color backgroundColor = Colors.white; const Color foregroundColor = Colors.black; - return QrImageView.withQr(qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, foregroundColor: foregroundColor); + return QrImageView.withQr( + qr: QrCode.fromUint8List( + data: assembleQRPacket(direction, identifier, pass), + errorCorrectLevel: errorCorrectLevel), + size: dimension, + padding: const EdgeInsets.all(10), + backgroundColor: backgroundColor, + foregroundColor: foregroundColor); } catch (e) { return Text("Erro ao gerar QR Code: ${e.toString()}"); } } +// // Retorna o conteúdo a ser codificado no QR Code. +// String getContents() { +// return data; +// } - // // Retorna o conteúdo a ser codificado no QR Code. - // String getContents() { - // return data; - // } +// // Retorna uma versão do conteúdo otimizada para exibição. +// String getDisplayContents() { +// return data.trim(); +// } - // // Retorna uma versão do conteúdo otimizada para exibição. - // String getDisplayContents() { - // return data.trim(); - // } +// // Retorna o título baseado no tipo de conteúdo. +// String getTitle() { +// return type; +// } - // // Retorna o título baseado no tipo de conteúdo. - // String getTitle() { - // return type; - // } +// // Codifica o conteúdo em uma string adequada para o QR Code. +// Future encodeContents() async { +// // Implementação específica para codificar o conteúdo. +// return data; // Exemplo simplificado. +// } - // // Codifica o conteúdo em uma string adequada para o QR Code. - // Future encodeContents() async { - // // Implementação específica para codificar o conteúdo. - // return data; // Exemplo simplificado. - // } +// // Codifica o conteúdo específico do QR Code. +// Future encodeQRCodeContents() async { +// return getQrCode(); +// } - // // Codifica o conteúdo específico do QR Code. - // Future encodeQRCodeContents() async { - // return getQrCode(); - // } +// // Gera o QR Code como um widget. - // // Gera o QR Code como um widget. - +// // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). +// // Future encodeAsBitmap() async { +// // // Implementação para codificar como bitmap. +// // return Image(image); // Exemplo simplificado. +// // } - // // Codifica o conteúdo como um bitmap (pode ser útil para operações de baixo nível). - // // Future encodeAsBitmap() async { - // // // Implementação para codificar como bitmap. - // // return Image(image); // Exemplo simplificado. - // // } +// // Adivinha a codificação apropriada para o conteúdo. +// String guessAppropriateEncoding(String content) { +// // Implementação para adivinhar a codificação. +// return "UTF-8"; // Exemplo simplificado. +// } - // // Adivinha a codificação apropriada para o conteúdo. - // String guessAppropriateEncoding(String content) { - // // Implementação para adivinhar a codificação. - // return "UTF-8"; // Exemplo simplificado. - // } +// // Remove espaços em branco do início e do fim do conteúdo. +// String trim(String content) { +// return content.trim(); +// } - // // Remove espaços em branco do início e do fim do conteúdo. - // String trim(String content) { - // return content.trim(); - // } +// // Escapa caracteres especiais para o formato MECARD. +// String escapeMECARD(String content) { +// // Implementação para escapar caracteres. +// return content.replaceAll(':', '\\:'); // Exemplo simplificado. +// } - // // Escapa caracteres especiais para o formato MECARD. - // String escapeMECARD(String content) { - // // Implementação para escapar caracteres. - // return content.replaceAll(':', '\\:'); // Exemplo simplificado. - // } +/// menu - /// menu - - Future scheduleVisitOptAction(BuildContext context) async { - await showAdaptiveDialog( - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'scheduleCompleteVisitPage', - 'scheduleProvisionalVisitPage', - 'fastPassPage', - ], - iconsListIcon: [ - Icons.date_range_rounded, - Icons.date_range_rounded, - Icons.date_range_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nCompleta', - enText: 'Complete\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nProvisória', - enText: 'Provisional\nSchedule', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Visita\nRápida', - enText: 'Fast\nSchedule', - ), - ], - ), - ); - }, - ); - } - - Future registerVisitorOptAction(BuildContext context) async { - context.pushNamed( - 'registerVisitorPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, +Future scheduleVisitOptAction(BuildContext context) async { + await showAdaptiveDialog( + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'scheduleCompleteVisitPage', + 'scheduleProvisionalVisitPage', + 'fastPassPage', + ], + iconsListIcon: [ + Icons.date_range_rounded, + Icons.date_range_rounded, + Icons.date_range_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nCompleta', + enText: 'Complete\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nProvisória', + enText: 'Provisional\nSchedule', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Visita\nRápida', + enText: 'Fast\nSchedule', + ), + ], ), - }, - ); - } + ); + }, + ); +} - Future peopleOnThePropertyAction(BuildContext context) async { - context.pushNamed( - 'peopleOnThePropertyPage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.fade, +Future registerVisitorOptAction(BuildContext context) async { + context.pushNamed( + 'registerVisitorPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future peopleOnThePropertyAction(BuildContext context) async { + context.pushNamed( + 'peopleOnThePropertyPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.fade, + ), + }, + ); +} + +Future preferencesSettings(BuildContext context) async { + context.pushNamed( + 'preferencesSettings', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} + +Future liberationHistoryOptAction(BuildContext context) async { + await showAdaptiveDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: OptionSelectionModalWidget( + routesListStr: [ + 'liberationHistory', + 'acessHistoryPage', + 'scheduleCompleteVisitPage', + // 'messageHistoryPage', + ], + iconsListIcon: [ + Icons.history_rounded, + Icons.history_rounded, + Icons.history_rounded, + // Icons.history_rounded, + ], + nameListStr: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Liberação', + enText: 'Liberation\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Acesso', + enText: 'Access\nHistory', + ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Visita', + enText: 'Visit\nHistory', + ), + // FFLocalizations.of(context).getVariableText( + // ptText: 'Histórico\nde Mensagens', + // enText: 'Message\nHistory', + // ), + ], ), - }, - ); - } + ); + }, + ); +} - Future preferencesSettings(BuildContext context) async { - context.pushNamed( - 'preferencesSettings', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - - Future liberationHistoryOptAction(BuildContext context) async { - await showAdaptiveDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: OptionSelectionModalWidget( - routesListStr: [ - 'liberationHistory', - 'acessHistoryPage', - 'scheduleCompleteVisitPage', - // 'messageHistoryPage', - ], - iconsListIcon: [ - Icons.history_rounded, - Icons.history_rounded, - Icons.history_rounded, - // Icons.history_rounded, - ], - nameListStr: [ - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Liberação', - enText: 'Liberation\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Acesso', - enText: 'Access\nHistory', - ), - FFLocalizations.of(context).getVariableText( - ptText: 'Histórico\nde Visita', - enText: 'Visit\nHistory', - ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), - ], - ), - ); - }, - ); - } - - Future accessQRCodeOptAction(BuildContext context) async { - context.pushNamed( - 'qrCodePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } \ No newline at end of file +Future accessQRCodeOptAction(BuildContext context) async { + context.pushNamed( + 'qrCodePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); +} diff --git a/lib/app_state.dart b/lib/app_state.dart index 917fb812..115951d0 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -17,7 +17,7 @@ class FFAppState extends ChangeNotifier { // Verifica suporte biométrico Future checkBiometrics() async { try { - return await auth.canCheckBiometrics; + return await auth.canCheckBiometrics; } catch (e) { clearBiometricAuthentication(); debugPrint('Error checking biometrics: $e'); @@ -30,14 +30,13 @@ class FFAppState extends ChangeNotifier { bool authenticated = false; try { authenticated = await auth.authenticate( - localizedReason: 'Scan your fingerprint to authenticate', - options: const AuthenticationOptions( - biometricOnly: true, - stickyAuth: true, - useErrorDialogs: true, - sensitiveTransaction: true, - ) - ); + localizedReason: 'Scan your fingerprint to authenticate', + options: const AuthenticationOptions( + biometricOnly: true, + stickyAuth: true, + useErrorDialogs: true, + sensitiveTransaction: true, + )); if (authenticated) { _isBiometricAuthenticated = true; notifyListeners(); @@ -50,7 +49,8 @@ class FFAppState extends ChangeNotifier { clearBiometricAuthentication(); return Future.error(e); } - return Future.error(''); // Add this line to ensure a value is always returned + return Future.error( + ''); // Add this line to ensure a value is always returned } // Função para limpar o estado de autenticação biométrica @@ -60,9 +60,6 @@ class FFAppState extends ChangeNotifier { // Limpar a informação salva, se necessário } - - - static FFAppState _instance = FFAppState._internal(); factory FFAppState() { @@ -123,13 +120,16 @@ class FFAppState extends ChangeNotifier { _tokenAPNS = await secureStorage.getString('ff_tokenAPNS') ?? _tokenAPNS; }); await _safeInitAsync(() async { - _userDevUUID = await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; + _userDevUUID = + await secureStorage.getString('ff_user_dev_id') ?? _userDevUUID; }); await _safeInitAsync(() async { - _serialNumber = await secureStorage.getString('ff_serialNumber') ?? _serialNumber; + _serialNumber = + await secureStorage.getString('ff_serialNumber') ?? _serialNumber; }); await _safeInitAsync(() async { - _fingerprintOPT = await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; + _fingerprintOPT = + await secureStorage.getBool('fingerprint') ?? _fingerprintOPT; }); await _safeInitAsync(() async { _personOPT = await secureStorage.getBool('person') ?? _personOPT; @@ -137,6 +137,9 @@ class FFAppState extends ChangeNotifier { await _safeInitAsync(() async { _passOPT = await secureStorage.getBool('pass') ?? _passOPT; }); + await _safeInitAsync(() async { + _panicOPT = await secureStorage.getBool('panic') ?? _panicOPT; + }); await _safeInitAsync(() async { _notifyOPT = await secureStorage.getBool('notify') ?? _notifyOPT; }); @@ -147,9 +150,9 @@ class FFAppState extends ChangeNotifier { _panicPass = await secureStorage.getString('panicPass') ?? _panicPass; }); await _safeInitAsync(() async { - _fingerprintPass = await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; + _fingerprintPass = + await secureStorage.getString('fingerprintPass') ?? _fingerprintPass; }); - } void update(VoidCallback callback) { @@ -159,6 +162,17 @@ class FFAppState extends ChangeNotifier { late FlutterSecureStorage secureStorage; + bool _panicOPT = false; + bool get panic => _panicOPT; + set panic(bool value) { + _panicOPT = value; + secureStorage.setBool('panic', value); + } + + void deletePanic() { + secureStorage.delete(key: 'panic'); + } + String _fingerprintPass = ''; String get fingerprintPass => _fingerprintPass; set fingerprintPass(String value) { @@ -185,8 +199,7 @@ class FFAppState extends ChangeNotifier { String get panicPass => _panicPass; set panicPass(String value) { _panicPass = value; - secureStorage.setString - ('panicPass', value); + secureStorage.setString('panicPass', value); } void deletePanicPass() { @@ -203,8 +216,7 @@ class FFAppState extends ChangeNotifier { bool _passOPT = false; bool get pass => _passOPT; set pass(bool value) { - _passOPT = - value; + _passOPT = value; secureStorage.setBool('pass', value); } @@ -486,4 +498,4 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage { Future setStringList(String key, List value) async => await writeSync( key: key, value: const ListToCsvConverter().convert([value])); -} \ No newline at end of file +} 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 6026a836..9f037c96 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -10,12 +10,8 @@ import 'throw_exception_model.dart'; export 'throw_exception_model.dart'; class ThrowExceptionWidget extends StatefulWidget { - - ThrowExceptionWidget({ - super.key, - required this.msg, - this.type = EnumThrowException.error - }); + ThrowExceptionWidget( + {super.key, required this.msg, this.type = EnumThrowException.error}); final String? msg; EnumThrowException type; @@ -89,11 +85,15 @@ class _ThrowExceptionWidgetState extends State String _getTitleByType(BuildContext context) { switch (widget.type) { case EnumThrowException.error: - return FFLocalizations.of(context).getVariableText(ptText: "Falha :(", enText: "Fail :("); + return FFLocalizations.of(context) + .getVariableText(ptText: "Falha :(", enText: "Fail :("); case EnumThrowException.warning: - return FFLocalizations.of(context).getVariableText(ptText: "Aviso :O", enText: "Warning :O"); + return FFLocalizations.of(context) + .getVariableText(ptText: "Aviso :O", enText: "Warning :O"); case EnumThrowException.success: - return FFLocalizations.of(context).getVariableText(ptText: "Sucesso ;)", enText: "Success ;)");; + return FFLocalizations.of(context) + .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); + ; } } @@ -128,8 +128,7 @@ class _ThrowExceptionWidgetState extends State ), ), ], - ).animateOnPageLoad( - animationsMap['stackOnPageLoadAnimation']!), + ).animateOnPageLoad(animationsMap['stackOnPageLoadAnimation']!), Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -143,22 +142,20 @@ class _ThrowExceptionWidgetState extends State letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), child: Text( valueOrDefault( widget.msg, 'Message Not Found', ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) @@ -175,4 +172,4 @@ class _ThrowExceptionWidgetState extends State ], ); } -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 421d595f..783d3801 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,16 +1,13 @@ - import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; - import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; - class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({super.key}); @@ -65,7 +62,8 @@ class _VisitorNotFoundComponentWidgetState Align( alignment: const AlignmentDirectional(1.0, -1.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -87,7 +85,8 @@ class _VisitorNotFoundComponentWidgetState size: 72.0, ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( '1p9mykbj' /* Usuário não encontrado */, @@ -102,7 +101,8 @@ class _VisitorNotFoundComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), child: Text( FFLocalizations.of(context).getText( 'kt937sp6' /* O documento inserido não corre... */, @@ -128,12 +128,19 @@ class _VisitorNotFoundComponentWidgetState await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, - enableDrag: false, + enableDrag: true, + useSafeArea: true, context: context, builder: (context) { return Padding( padding: MediaQuery.viewInsetsOf(context), - child: const RegisiterVistorTemplateComponentWidget(), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: + const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), ); }, ).then((value) => safeSetState(() {})); @@ -144,10 +151,10 @@ class _VisitorNotFoundComponentWidgetState options: FFButtonOptions( width: double.infinity, height: 30.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: @@ -177,4 +184,4 @@ class _VisitorNotFoundComponentWidgetState ), ); } -} \ No newline at end of file +} 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 1c7a7c0a..443b4b65 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 @@ -314,4 +314,4 @@ class _ForgotPasswordTemplateComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index e0f842b7..f0fffd4e 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,17 +1,15 @@ - -import 'dart:typed_data'; - +import '/backend/api_requests/api_calls.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/form_field_controller.dart'; import 'package:flutter/material.dart'; -import 'package:hub/backend/api_requests/api_manager.dart'; -import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/form_field_controller.dart'; -import 'package:hub/flutter_flow/uploaded_file.dart'; + +import 'regisiter_vistor_template_component_widget.dart'; class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { - /// State fields for stateful widgets in this component. + /// State fields for stateful widgets in this page. + final unfocusNode = FocusNode(); bool isDataUploading = false; FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); @@ -20,31 +18,98 @@ class RegisiterVistorTemplateComponentModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + + return null; + } + + // State field(s) for DropDown widget. + String? dropDownValue; + FormFieldController? dropDownValueController; // State field(s) for TextField widget. FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + return null; + } + // State field(s) for TextField widget. FocusNode? textFieldFocusNode4; TextEditingController? textController4; String? Function(BuildContext, String?)? textController4Validator; + String? _textController4Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', + ); + } + if (!val.contains('@') || !val.contains('.')) { + return FFLocalizations.of(context).getVariableText( + enText: 'Invalid email', + ptText: 'Email inválido', + ); + } + return null; + } + // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. String? imgBase64; // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? registerVisitor; + ApiCallResponse? scheduleVisitor; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + dropDownValue = ''; + // dropDownValueController = FormFieldController(initialValue: dropDownValue); + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + + textFieldFocusNode4 = FocusNode(); + textController4 = TextEditingController(); + textController4Validator = _textController4Validator; + } @override void dispose() { + unfocusNode.dispose(); textFieldFocusNode1?.dispose(); textController1?.dispose(); @@ -58,4 +123,3 @@ class RegisiterVistorTemplateComponentModel textController4?.dispose(); } } - diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 2ea62d9b..2b541bf5 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,28 +1,27 @@ +import 'dart:developer'; -import 'dart:typed_data'; +import 'package:flutter/services.dart'; +import '/backend/api_requests/api_calls.dart'; +import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import '/flutter_flow/flutter_flow_drop_down.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/flutter_flow_widgets.dart'; +import '/flutter_flow/form_field_controller.dart'; +import '/flutter_flow/upload_data.dart'; +import '/custom_code/actions/index.dart' as actions; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/app_state.dart'; -import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart'; -import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; -import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; -import 'package:hub/flutter_flow/form_field_controller.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; -import 'package:hub/flutter_flow/upload_data.dart'; -import 'package:hub/flutter_flow/uploaded_file.dart'; import 'package:provider/provider.dart'; - - +import 'regisiter_vistor_template_component_model.dart'; +export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { - const RegisiterVistorTemplateComponentWidget({super.key}); + final String source; + + const RegisiterVistorTemplateComponentWidget( + {super.key, required this.source}); @override State createState() => @@ -33,11 +32,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State { late RegisiterVistorTemplateComponentModel _model; - @override - void setState(VoidCallback callback) { - super.setState(callback); - _model.onUpdate(); - } + final scaffoldKey = GlobalKey(); @override void initState() { @@ -60,7 +55,7 @@ class _RegisiterVistorTemplateComponentWidgetState @override void dispose() { - _model.maybeDispose(); + _model.dispose(); super.dispose(); } @@ -68,10 +63,14 @@ class _RegisiterVistorTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - + log(context + .describeWidget('RegisiterVistorTemplateComponentWidget') + .toString()); return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( + width: double.infinity, + height: double.infinity, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( @@ -81,33 +80,14 @@ class _RegisiterVistorTemplateComponentWidgetState topRight: Radius.circular(25.0), ), ), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 30.0, 0.0, 0.0), - child: SingleChildScrollView( + child: SingleChildScrollView( + child: Form( + // key: UniqueKey(), + autovalidateMode: AutovalidateMode.disabled, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 20.0), - child: Text( - FFLocalizations.of(context).getText( - 'wnhkedzt' /* Cadastrar Visitante */, - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Nunito', - fontSize: 21.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w800, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ), Builder( builder: (context) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { @@ -129,7 +109,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.uploadedLocalFile.bytes ?? Uint8List.fromList([]), width: 300.0, - height: 100.0, + height: 200.0, fit: BoxFit.cover, ), ), @@ -171,7 +151,7 @@ class _RegisiterVistorTemplateComponentWidgetState bytes: m.bytes, height: m.dimensions?.height, width: m.dimensions?.width, - blurHash: m.blurHash, + // blurHash: m.blurHash, )) .toList(); } finally { @@ -205,8 +185,9 @@ class _RegisiterVistorTemplateComponentWidgetState height: 80.0, padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), color: FlutterFlowTheme.of(context) .primaryBackground, textStyle: FlutterFlowTheme.of(context) @@ -238,7 +219,7 @@ class _RegisiterVistorTemplateComponentWidgetState 0.0, 50.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'kpd31z4d' /* Clique para adicionar a foto p... */, + 'p4ftwxcy' /* Clique para adicionar a foto p... */, ), style: FlutterFlowTheme.of(context) .bodyMedium @@ -264,11 +245,11 @@ class _RegisiterVistorTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'q986vs4m' /* Preencha o formulário com os d... */, + 'zazj5d8b' /* Preencha o formulário com os d... */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -282,16 +263,19 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, focusNode: _model.textFieldFocusNode1, autofocus: false, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'llcw2tei' /* Nome */, + 'v7g73yik' /* Nome */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -315,7 +299,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -360,105 +344,23 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController1Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - decoration: const BoxDecoration(), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 20.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '67ykbznt' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 20.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'ugjkeiz7' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '8nlk5xlk' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 48.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'kw07i43y' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).accent1, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 4.0, 16.0, 4.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ], - ), - ), - ), - ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - '96ayre48' /* Documento */, + 'rl8tvwnr' /* Documento */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -481,7 +383,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -522,16 +424,135 @@ class _RegisiterVistorTemplateComponentWidgetState ), validator: _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + 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), + )), + ), + ], + ), ), ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( - 'j0g7ggs2' /* Contatos */, + 'bqpucwh0' /* Contatos */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( @@ -545,16 +566,24 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.next, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp('[0-9, +, -, (, )]')), + ], obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'ybdjabnd' /* Telefone */, + 'h84ls2r6' /* Telefone */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -578,7 +607,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -617,21 +646,24 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), - validator: - _model.textController3Validator.asValidator(context), + // validator: + // _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsets.all(24.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, + autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.done, obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( - 'tlr6uxo4' /* Email */, + 'fqp7qmka' /* Email */, ), labelStyle: FlutterFlowTheme.of(context) .labelMedium @@ -655,7 +687,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), @@ -695,135 +727,199 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), keyboardType: TextInputType.emailAddress, - validator: - _model.textController4Validator.asValidator(context), + // validator: + // _model.textController4Validator.asValidator(context), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.registerVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: (_model.dropDownValue == 'Visitante') || - (_model.dropDownValue == 'Visitor') - ? 'V' - : 'P', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.registerVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - '\\devUUID=${FFAppState().devUUID}\\userUUID=${FFAppState().userUUID}\\cliID=${FFAppState().cliUUID}\\Documento=${_model.textController2.text}\\Nome=${_model.textController1.text}\\dropdown${_model.dropDownValue}\\${PhpGroup.postScheduleVisitorCall.errorMsg( - (_model.registerVisitor?.jsonBody ?? ''), - )}', - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( context: context, builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento estão foram preenchidos corretamente.- devUUID=${FFAppState().devUUID}- userUUID=${FFAppState().userUUID}- cliID=${FFAppState().cliUUID}- Documento=${_model.textController2.text}- Nome=${_model.textController1.text}- Tipo=${_model.dropDownValue}', + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clearComposing(); + _model.textController2?.clearComposing(); + _model.textController3?.clearComposing(); + _model.textController4?.clearComposing(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context).info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + if (widget.source == 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitorCall + .errorMsg(_model + .scheduleVisitor?.jsonBody) + .toString()), + ), ), ); }, ).then((value) => safeSetState(() {})); } + } else { + await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () { + Form.of(context)?.validate(); + Navigator.pop(context); + }, + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - '65puvap9' /* Cadastrar */, + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'okbw0aiu' /* Cadastrar */, + ), + options: FFButtonOptions( + width: 250.0, + height: 36.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 80.0, 0.0, 80.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, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + borderSide: const BorderSide( + color: Colors.transparent, + width: 30.0, ), - options: FFButtonOptions( - width: double.infinity, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], + ] + .divide(const SizedBox(height: 10.0)) + .addToStart(const SizedBox(height: 30.0)) + .addToEnd(const SizedBox(height: 30.0)), ), ), ), ), ); } -} \ No newline at end of file +} 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 fd542965..e1010ec7 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 @@ -8,6 +8,7 @@ class SignInTemplateComponentModel /// State fields for stateful widgets in this component. final formKey = GlobalKey(); + final unfocusNode = FocusNode(); // State field(s) for emailAddress widget. FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; 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 572d14f9..94ee24dc 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 @@ -131,8 +131,8 @@ class _SignInTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 35.0, 0.0, 35.0), child: Container( width: 548.0, height: 112.0, @@ -148,7 +148,8 @@ class _SignInTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), + alignment: + const AlignmentDirectional(0.0, 1.0), child: Padding( padding: const EdgeInsets.all(3.0), child: Text( @@ -223,8 +224,9 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -236,7 +238,8 @@ class _SignInTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.emailAddressTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: true, @@ -364,8 +367,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -377,7 +381,8 @@ class _SignInTemplateComponentWidgetState onChanged: (_) => EasyDebounce.debounce( '_model.passwordTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: true, @@ -430,7 +435,8 @@ class _SignInTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -441,7 +447,8 @@ class _SignInTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -452,7 +459,8 @@ class _SignInTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -527,8 +535,9 @@ class _SignInTemplateComponentWidgetState mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: _isFormInvalid() @@ -556,18 +565,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -594,7 +597,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -613,8 +617,9 @@ class _SignInTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( onPressed: () async { @@ -632,18 +637,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -670,7 +669,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors.transparent, width: 1.0, @@ -695,7 +695,7 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: _isFormInvalid() ? null @@ -727,18 +727,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -766,7 +760,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -775,7 +770,8 @@ class _SignInTemplateComponentWidgetState BorderRadius .circular(12.0), disabledColor: - const Color(0xE81AAB5F), + const Color( + 0xE81AAB5F), ), showLoadingIndicator: true, ), @@ -786,7 +782,7 @@ class _SignInTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, - 0.0, 16.0), + 0.0, 16.0), child: FFButtonWidget( onPressed: () async { await widget @@ -803,18 +799,12 @@ class _SignInTemplateComponentWidgetState height: 44.0, padding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional - .fromSTEB( - 0.0, - 0.0, - 0.0, - 0.0), + .fromSTEB(0.0, + 0.0, 0.0, 0.0), color: FlutterFlowTheme.of( context) @@ -842,7 +832,8 @@ class _SignInTemplateComponentWidgetState 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Colors .transparent, width: 1.0, @@ -856,7 +847,8 @@ class _SignInTemplateComponentWidgetState ), ), ), - ].divide(const SizedBox(width: 7.0)), + ].divide( + const SizedBox(width: 7.0)), ); } }, @@ -864,8 +856,8 @@ class _SignInTemplateComponentWidgetState // You will have to add an action on this rich text to go to your login page. 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( splashColor: Colors.transparent, focusColor: Colors.transparent, diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 460ef502..6d8138cb 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,4 +1,3 @@ - import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; @@ -9,8 +8,6 @@ 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:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -69,171 +66,167 @@ class _VisitorSearchModalTemplateComponentWidgetState Widget build(BuildContext context) { context.watch(); - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 300.0, 0.0, 0.0), - child: Container( - width: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - onFieldSubmitted: (_) async { - setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); - _model.textController?.selection = - TextSelection.collapsed( - offset: _model.textController!.text.length); - }); - _model.getVisitorByDoc = - await PhpGroup.getVisitorByDocCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getVisitante', - documento: _model.textController.text, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 16.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + onFieldSubmitted: (_) async { + setState(() { + _model.textController?.text = valueOrDefault( + _model.textController.text, + '69696777', ); + _model.textController?.selection = TextSelection.collapsed( + offset: _model.textController!.text.length); + }); + _model.getVisitorByDoc = + await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: _model.textController.text, + ); - if (PhpGroup.getVisitorByDocCall.vistanteId( - (_model.getVisitorByDoc?.jsonBody ?? ''), - ) != - '0') { - _model - .addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + if (PhpGroup.getVisitorByDocCall.vistanteId( (_model.getVisitorByDoc?.jsonBody ?? ''), - )); - setState(() {}); - _model.addToDocs(_model.textController.text); - setState(() {}); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); - } - + ) != + '0') { + _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante( + (_model.getVisitorByDoc?.jsonBody ?? ''), + )); setState(() {}); - }, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 'cjlpru1m' /* Procure pelo documento do visi... */, - ), - 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), - ), - hintText: FFLocalizations.of(context).getText( - '8i1qszba' /* test */, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - prefixIcon: Icon( - Icons.search_outlined, - color: FlutterFlowTheme.of(context).accent1, - ), + _model.addToDocs(_model.textController.text); + setState(() {}); + } else { + await showModalBottomSheet( + isScrollControlled: true, + enableDrag: true, + isDismissible: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const VisitorNotFoundComponentWidget(), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + autofocus: false, + textInputAction: TextInputAction.done, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 'cjlpru1m' /* Procure pelo documento do visi... */, ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), + FlutterFlowTheme.of(context).labelMediumFamily), ), - keyboardType: TextInputType.number, - validator: - _model.textControllerValidator.asValidator(context), + hintText: FFLocalizations.of(context).getText( + '8i1qszba' /* test */, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).primaryBackground, + prefixIcon: Icon( + Icons.search_outlined, + color: FlutterFlowTheme.of(context).accent1, + ), ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + keyboardType: TextInputType.number, + validator: _model.textControllerValidator.asValidator(context), ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.length > 0) Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 12.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( '9coywebh' /* Visitantes encontrados */, @@ -249,12 +242,10 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ), Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 4.0, 12.0, 16.0, 0.0), child: Text( - FFLocalizations.of(context).getText( - '6f5p0fv6' /* 24 */, - ), + _model.visitors.length.toString(), style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, @@ -266,273 +257,270 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ], ), - Expanded( - child: Builder( - builder: (context) { - if (_model.visitors.isNotEmpty) { - return Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), - child: Builder( - builder: (context) { - final visitor = - _model.visitors.map((e) => e).toList(); + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = + _model.visitors.map((e) => e).toList(); - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: - BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 60.0, - height: 60.0, - fit: BoxFit.cover, + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: const SizedBox( + height: 610.0, + child: + VisitorDetailsModalTemplateComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 0.0, + color: FlutterFlowTheme.of(context) + .alternate, + offset: const Offset( + 0.0, + 1.0, + ), + ) + ], + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: + BorderRadius.circular(40.0), + child: CachedNetworkImage( + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), + width: 60.0, + height: 60.0, + fit: BoxFit.cover, ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(12.0, 0.0, - 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField( - visitorItem, - r'''$.VTE_NOME''', - )?.toString(), - 'NOT FOUND', - ), - style: - FlutterFlowTheme.of( - context) - .bodyLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyLargeFamily, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyLargeFamily), - ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField( + visitorItem, + r'''$.VTE_NOME''', + )?.toString(), + 'NOT FOUND', ), + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyLargeFamily), + ), ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB(4.0, 4.0, - 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 4.0, 4.0, 0.0, 0.0), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Align( + alignment: + const AlignmentDirectional( + 0.0, -1.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: Text( + getJsonField( + visitorItem, + r'''$.VTE_TELEFONE''', + ).toString(), + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .primary, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), - ], - ), + ), + ], ), - ], - ), + ), + ], ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.restore_from_trash, - color: - FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - _model.removeFromVisitors( - visitorItem); - setState(() {}); - }, + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.restore_from_trash, + color: + FlutterFlowTheme.of(context) + .primary, + size: 20.0, ), - ], - ), + onPressed: () async { + _model.removeFromVisitors( + visitorItem); + setState(() {}); + }, + ), + ], ), ), ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - ), - ); - } - }, - ), - ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.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, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), + ), + ); + }, + ); + }, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).secondaryBackground, + ), + ); + } + }, + ), + ), + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getText( + 'ug6qzyla' /* Adicionar */, + ), + options: FFButtonOptions( + width: double.infinity, + height: 30.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, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), ), ), - ], - ), + ), + ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index e66e26b7..8a3cc1be 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -13,7 +13,6 @@ import 'package:url_launcher/url_launcher.dart'; import '../main.dart'; - export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; export 'place.dart'; @@ -87,6 +86,46 @@ Theme wrapInMaterialDatePickerTheme( return Theme( data: baseTheme.copyWith( + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), colorScheme: baseTheme.colorScheme.copyWith( onSurface: pickerForegroundColor, ), @@ -149,9 +188,54 @@ Theme wrapInMaterialTimePickerTheme( final baseTheme = Theme.of(context); return Theme( data: baseTheme.copyWith( + focusColor: headerBackgroundColor, iconTheme: baseTheme.iconTheme.copyWith( size: iconSize, ), + textSelectionTheme: baseTheme.textSelectionTheme.copyWith( + cursorColor: headerBackgroundColor, + selectionColor: headerBackgroundColor.withOpacity(0.4), + selectionHandleColor: headerBackgroundColor, + ), + inputDecorationTheme: baseTheme.inputDecorationTheme.copyWith( + isDense: true, + focusColor: headerBackgroundColor, + hoverColor: headerBackgroundColor.withOpacity(0.04), + floatingLabelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + labelStyle: baseTheme.textTheme.labelMedium!.copyWith( + color: headerBackgroundColor, + ), + outlineBorder: BorderSide( + color: headerBackgroundColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor.withOpacity(0.6), + ), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: headerBackgroundColor, + ), + ), + ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( foregroundColor: WidgetStatePropertyAll( @@ -169,6 +253,7 @@ Theme wrapInMaterialTimePickerTheme( })), ), timePickerTheme: baseTheme.timePickerTheme.copyWith( + hourMinuteColor: selectedDateTimeBackgroundColor, backgroundColor: pickerBackgroundColor, hourMinuteTextColor: pickerForegroundColor, dialHandColor: selectedDateTimeBackgroundColor, @@ -574,4 +659,4 @@ double computeGradientAlignmentY(double evaluatedAngle) { y = sin(2 * rads); } return double.parse(roundTo(y, 2)); -} \ No newline at end of file +} diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 6955a811..6cf9f539 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -22,17 +22,11 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/home_page/home_page_model.dart'; - import 'package:provider/provider.dart'; - - class HomePageWidget extends StatefulWidget { const HomePageWidget({super.key}); - - - @override State createState() => _HomePageWidgetState(); } @@ -42,7 +36,6 @@ class _HomePageWidgetState extends State { bool localStatus = false; final scaffoldKey = GlobalKey(); - Future checkLocalStatus() async { localStatus = await checkLocals( context: context, @@ -57,9 +50,6 @@ class _HomePageWidgetState extends State { _model = createModel(context, () => HomePageModel()); SchedulerBinding.instance.addPostFrameCallback((_) async { await PushNotificationService().initialize(context); - - - @override void initState() { @@ -105,7 +95,6 @@ class _HomePageWidgetState extends State { @override Widget build(BuildContext context) { - context.watch(); return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus @@ -122,523 +111,485 @@ class _HomePageWidgetState extends State { Container buildPage(BuildContext context, bool localStatus) { return Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Wrap( + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + createHeader(context), + createLocal(localStatus), + createBody(), + ], + ), + ], ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - createHeader(context), - createLocal(localStatus), - createBody(), - ], - ), - ], - ), - ), - ); + ), + ); } Wrap createBody() { return Wrap( - spacing: 0.0, - runSpacing: 0.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, - direction: Axis.horizontal, - runAlignment: WrapAlignment.start, - verticalDirection: VerticalDirection.down, - clipBehavior: Clip.none, - children: [ - wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget( - expandable: true, - style: MenuView.list_grid, - item: MenuItem.button, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Provider( - create: (_) => MessageWellNotifier(), - child: wrapWithModel( - model: _model.messageWellComponentModel, - updateCallback: () => setState(() {}), - child: const MessageWellComponentWidget(), - ), - ), - ), - //footer - const SizedBox( - height: 100, - width: double.infinity, - ) - ], - ); + spacing: 0.0, + runSpacing: 0.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: [ + wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget( + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Provider( + create: (_) => MessageWellNotifier(), + child: wrapWithModel( + model: _model.messageWellComponentModel, + updateCallback: () => setState(() {}), + child: const MessageWellComponentWidget(), + ), + ), + ), + //footer + const SizedBox( + height: 100, + width: double.infinity, + ) + ], + ); } Widget createLocal(bool localStatus) { return wrapWithModel( - model: _model.localComponentModel, - updateCallback: () => setState(() {}), - child: LocalProfileComponentWidget( - localStatus: localStatus, - ), - ); + model: _model.localComponentModel, + updateCallback: () => setState(() {}), + child: LocalProfileComponentWidget( + localStatus: localStatus, + ), + ); } Row createHeader(BuildContext context) { return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 100.0, - decoration: const BoxDecoration( - color: Color(0xFF1AAB5F), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: - FlutterFlowTheme.of(context) - .primary, - icon: const Icon( - Icons.menu_rounded, - color: Colors.white, - size: 28.0, - ), - onPressed: () async { - scaffoldKey.currentState! - .openDrawer(); - }, - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - -1.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 60.0, 15.0, 0.0, 0.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', - width: 50.0, - height: 200.0, - fit: BoxFit.none, - ), - ), - ), - ), - Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 0.0, 15.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration( + color: Color(0xFF1AAB5F), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + fillColor: FlutterFlowTheme.of(context).primary, + icon: const Icon( + Icons.menu_rounded, + color: Colors.white, + size: 28.0, + ), + onPressed: () async { + scaffoldKey.currentState!.openDrawer(); + }, + ), + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 60.0, 15.0, 0.0, 0.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.network( + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + width: 50.0, + height: 200.0, + fit: BoxFit.none, ), ), ), - Align( - alignment: - const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: - FlutterFlowTheme.of(context).info, - size: 24.0, + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 15.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'rg9pzkpz' /* FRE ACCESS */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - onPressed: () { - log('IconButton pressed ...'); - }, - ), - ), ), ), - ], - ), + ), + ], ), ), - ], - ); + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Container( + width: 100.0, + height: 50.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(1.0, 1.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.notifications_sharp, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + }, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ); } SizedBox buildDrawer(BuildContext context) { return SizedBox( - width: 750.0, - child: Drawer( - elevation: 16.0, - child: Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - shape: BoxShape.rectangle, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: double.infinity, - decoration: const BoxDecoration( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - shape: BoxShape.rectangle, + width: 750.0, + child: Drawer( + elevation: 16.0, + child: Container( + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + topLeft: Radius.circular(0.0), + topRight: Radius.circular(0.0), ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - child: Container( - width: double.infinity, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), + shape: BoxShape.rectangle, + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(30, 30, 10, 0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + child: Container( + width: double.infinity, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), - Container( - width: 150.0, - child: Text( - valueOrDefault( - convertToUppercase( - FFAppState().local), - 'NOME DO LOCAL', - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: 'Nunito Sans', - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: - GoogleFonts.asMap() - .containsKey( - 'Nunito Sans'), - ), + child: Image.network( + valueOrDefault( + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), + fit: BoxFit.cover, ), - ].divide(const SizedBox(width: 20.0)), - ), + ), + Container( + width: 150.0, + child: Text( + valueOrDefault( + convertToUppercase(FFAppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: 'Nunito Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito Sans'), + ), + ), + ), + ].divide(const SizedBox(width: 20.0)), ), ), - Container( - width: 50.0, - child: Container( - height: 30.0, - decoration: const BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Flexible( - child: FlutterFlowIconButton( - borderRadius: 100.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close_sharp, - color: FlutterFlowTheme.of(context) - .primary, - size: 20.0, - ), - onPressed: () async { - if (scaffoldKey.currentState! - .isDrawerOpen || - scaffoldKey.currentState! - .isEndDrawerOpen) { - Navigator.pop(context); - } - }, + ), + Container( + width: 50.0, + child: Container( + height: 30.0, + decoration: const BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: FlutterFlowIconButton( + borderRadius: 100.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close_sharp, + color: FlutterFlowTheme.of(context) + .primary, + size: 20.0, ), + onPressed: () async { + if (scaffoldKey + .currentState!.isDrawerOpen || + scaffoldKey.currentState! + .isEndDrawerOpen) { + Navigator.pop(context); + } + }, ), - ], - ), + ), + ], ), ), - ] - .divide(const SizedBox(width: 0.0)) - .around(const SizedBox(width: 0.0)), - ), + ), + ] + .divide(const SizedBox(width: 0.0)) + .around(const SizedBox(width: 0.0)), ), - ].addToStart(const SizedBox(height: 30.0)), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - 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), - ), - alignLabelWithHint: false, - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .customColor1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - errorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - focusedErrorBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(2.0), - ), - prefixIcon: const Icon( - Icons.search_sharp, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), ), - validator: _model.textControllerValidator - .asValidator(context), + alignLabelWithHint: false, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).customColor1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(2.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textControllerValidator + .asValidator(context), ), ), - ] - .addToStart(const SizedBox(width: 30.0)) - .addToEnd(const SizedBox(width: 30.0)), - ), - ), - Expanded( - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: MenuComponentWidget( - expandable: false, - style: MenuView.list, - item: MenuItem.card, - ), - ), - ), - FFButtonWidget( - onPressed: () async { - FFAppState().isLogged = false; - setState(() {}); - - context.goNamed( - 'welcomePage', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - }, - text: FFLocalizations.of(context).getText( - 'xx0db4wi' /* Sair */, - ), - options: FFButtonOptions( - height: 40.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: const Color(0x00D70000), - textStyle: - FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 0.0, - borderSide: const BorderSide( - width: 0.0, ), - borderRadius: BorderRadius.circular(50.0), + ] + .addToStart(const SizedBox(width: 30.0)) + .addToEnd(const SizedBox(width: 30.0)), + ), + ), + Expanded( + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.card, ), ), - - ].addToEnd(const SizedBox(height: 64.0)), ), - ), + FFButtonWidget( + onPressed: () async { + FFAppState().isLogged = false; + setState(() {}); + + context.goNamed( + 'welcomePage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + }, + text: FFLocalizations.of(context).getText( + 'xx0db4wi' /* Sair */, + ), + options: FFButtonOptions( + height: 40.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: const Color(0x00D70000), + textStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 0.0, + borderSide: const BorderSide( + width: 0.0, + ), + borderRadius: BorderRadius.circular(50.0), + ), + ), + ].addToEnd(const SizedBox(height: 64.0)), ), - ); + ), + ), + ); // body: Container( // decoration: BoxDecoration( @@ -836,6 +787,5 @@ class _HomePageWidgetState extends State { // ), // ), // ); - } } diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 4668af2e..cac62056 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -1,94 +1,159 @@ - import 'dart:developer'; - - import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:flutter/material.dart'; import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:share_plus/share_plus.dart'; class PreferencesPageModel with ChangeNotifier { final unfocusNode = FocusNode(); - Future toggleFingerprint(BuildContext context) async { - // FFAppState().checkBiometrics() // .then((value) => FFAppState().authenticateBiometric() // .then( (value) { // FFAppState().fingerprint = !FFAppState().fingerprint; - + // }) // .whenComplete(() => notifyListeners())); - if(FFAppState().fingerprint) { + if (FFAppState().fingerprint) { FFAppState().fingerprint = false; FFAppState().deleteFingerprintPass(); notifyListeners(); } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - log(key); - FFAppState().fingerprintPass = key; - FFAppState().fingerprint = true; - }, - ), - ); - }, - ).whenComplete(() => notifyListeners()); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + log(key); + FFAppState().fingerprintPass = key; + FFAppState().fingerprint = true; + }, + ), + ); + }, + ).whenComplete(() => notifyListeners()); } - } void enablePerson(BuildContext context) { - notifyListeners(); ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(FFAppState().userDevUUID, style: TextStyle(color: FlutterFlowTheme.of(context).info) ), + SnackBar( + content: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(FFAppState().userDevUUID, + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.share, + color: FlutterFlowTheme.of(context).info, + size: 24.0, + ), + onPressed: () { + log('IconButton pressed ...'); + // Implement share functionality here + Share.share( + FFAppState().userDevUUID, + ); + }, + ), + ], + ), backgroundColor: FlutterFlowTheme.of(context).primary, duration: const Duration(seconds: 1), behavior: SnackBarBehavior.floating, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30), - ), + ), ), ); } - void toggleNotify() { + void toggleNotify(BuildContext context) { FFAppState().notify = !FFAppState().notify; - PhpGroup.changeNotifica.call( + PhpGroup.changeNotifica + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, atividade: 'updVisitado', notifica: FFAppState().notify ? 'S' : 'N', - ); + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error changing notification', + ptText: 'Erro ao alterar notificação', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }); notifyListeners(); } - void localLogout(){ - PhpGroup.resopndeVinculo.call( + void localUnlink(BuildContext context) { + PhpGroup.resopndeVinculo + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, tarefa: 'I', + ) + .catchError((err) { + log(err.toString()); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Error unlinking device', + ptText: 'Erro ao desvincular dispositivo', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).error, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ); + }).then( + (value) { + FFAppState().deleteCliUUID(); + FFAppState().deleteLocal(); + FFAppState().deleteOwnerUUID(); + Navigator.pop(context); + }, ); notifyListeners(); } @@ -108,57 +173,99 @@ class PreferencesPageModel with ChangeNotifier { ); } - - Future togglePass(BuildContext context) async { + Future togglePass(BuildContext context) async { debugPrint('pass: ${FFAppState().pass}'); - if(FFAppState().pass) { + if (FFAppState().pass) { FFAppState().pass = false; FFAppState().deleteAccessPass(); notifyListeners(); } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - PassKeyTemplateWidget( - toggleActionStatus: (key) async { - FFAppState().accessPass = key; + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().accessPass = key; notifyListeners(); debugPrint('key: $key'); - await PhpGroup.changePass.call( + await PhpGroup.changePass + .call( userUUID: FFAppState().userUUID, devUUID: FFAppState().devUUID, cliID: FFAppState().cliUUID, atividade: 'updVisitado', newSenha: FFAppState().accessPass, ) - .then((value) { + .then((value) { FFAppState().pass = true; // var error = jsonDecode(value.jsonBody['error'].toString()); // log('${jsonDecode(value.jsonBody['error'].toString())}'); - if(jsonDecode(value.jsonBody['error'].toString()) == false) { + if (jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; } else { FFAppState().pass = false; } - }) - .onError((error, StackTrace) { - FFAppState().pass = false; - log(error.toString()); - log(StackTrace.toString()); - }) - .whenComplete(() => notifyListeners()); - }, - ), - ); - }, - ); + }).onError((error, StackTrace) { + FFAppState().pass = false; + log(error.toString()); + log(StackTrace.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); + } + } + + Future togglePanic(BuildContext context) async { + if (FFAppState().panic) { + FFAppState().panic = false; + FFAppState().deletePanicPass(); + notifyListeners(); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + useSafeArea: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: PassKeyTemplateWidget( + toggleActionStatus: (key) async { + FFAppState().panicPass = key; + notifyListeners(); + await PhpGroup.changePass + .call( + userUUID: FFAppState().userUUID, + devUUID: FFAppState().devUUID, + cliID: FFAppState().cliUUID, + atividade: 'updVisitado', + newSenha: FFAppState().panicPass, + ) + .then((value) { + FFAppState().panic = true; + if (jsonDecode(value.jsonBody['error'].toString()) == false) { + FFAppState().panic = true; + } else { + FFAppState().panic = false; + } + }).onError((e, s) { + FFAppState().panic = false; + log(e.toString()); + log(s.toString()); + }).whenComplete(() => notifyListeners()); + }, + ), + ); + }, + ); } } @@ -167,4 +274,4 @@ class PreferencesPageModel with ChangeNotifier { unfocusNode.dispose(); super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index f2173bfd..8a036ed9 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -9,7 +9,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; - class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -46,7 +45,7 @@ class PreferencesPageWidget extends StatelessWidget { FFLocalizations.of(context).getVariableText( enText: 'Preferences', ptText: 'Preferências', - ), + ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -74,7 +73,7 @@ class PreferencesPageWidget extends StatelessWidget { // childAspectRatio: 1.0, // mainAxisExtent: 100.0, // ), - itemCount: 6, // Assuming 4 items for simplicity + itemCount: 7, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (BuildContext context, int index) { @@ -90,82 +89,110 @@ class PreferencesPageWidget extends StatelessWidget { ); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + Widget _buildIconButton( + BuildContext context, int index, PreferencesPageModel model) { IconData icon; - Function() onPressed =() => {}; + Function() onPressed = () => {}; bool isEnabled; String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + onPressed = () => + model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative a autenticação por impressão digital para login seguro.', + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Ative a autenticação por impressão digital para login seguro.', enText: 'Enable fingerprint authentication for secure login.', - ); + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Exibir código de identificação remota', enText: 'Display remote identification code', - ); + ); break; case 2: icon = Icons.notifications; - onPressed = model.toggleNotify; + onPressed = () => model.toggleNotify(context); isEnabled = FFAppState().notify; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para receber sua notificação de acesso', enText: 'Enable to receive your access notification', - ); + ); break; case 3: - icon = Icons.lock_clock_sharp; + icon = Icons.lock; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; - content = FFLocalizations.of(context).getVariableText( + content = FFLocalizations.of(context).getVariableText( ptText: 'Ative para inserir uma credencial de acesso para o QRCode', enText: 'Enable to enter an access credential for the QRCode', - ); + ); break; case 4: - icon = Icons.landscape; - onPressed = model.localLogout; - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Ative para se desvincular do local selecionado', - enText: 'Enable to unlink from the selected location', - ); + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().panic; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de pânico para o QRCode', + enText: 'Enable to enter an panic credential for the QRCode', + ); break; case 5: + icon = Icons.landscape; + onPressed = () => model.localUnlink(context); + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Desative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 6: icon = Icons.delete; onPressed = () => model.deleteAccount(context); - isEnabled = false; - content = FFLocalizations.of(context).getVariableText( - ptText: 'Delete sua conta e todos os dados associados permanentemente.', + isEnabled = true; + content = FFLocalizations.of(context).getVariableText( + ptText: + 'Delete sua conta e todos os dados associados permanentemente.', enText: 'Delete your account and all associated data permanently.', - ); + ); break; default: throw Exception('Invalid index: $index'); } - return Container( + return SizedBox( height: 100, child: GestureDetector( - onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + onTap: () { + switch (index) { + case 3: + model.togglePass(context); + break; + case 4: + model.togglePanic(context); + break; + default: + onPressed(); + } + }, child: Row( children: [ CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + backgroundColor: isEnabled + ? FlutterFlowTheme.of(context).primary + : FlutterFlowTheme.of(context).alternate, child: Icon( icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + color: isEnabled + ? FlutterFlowTheme.of(context).primaryBackground + : FlutterFlowTheme.of(context).primary, // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, // borderRadius: 20.0, @@ -181,13 +208,13 @@ class PreferencesPageWidget extends StatelessWidget { child: Text( content, style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), overflow: TextOverflow.clip, ), ), @@ -196,4 +223,4 @@ class PreferencesPageWidget extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 7c216c8d..85e15627 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -1,3 +1,5 @@ +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; @@ -8,108 +10,12 @@ class RegisterVisitorPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); - bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = - FFUploadedFile(bytes: Uint8List.fromList([])); - - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; - String? _textController1Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - String? _textController2Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for DropDown widget. - String? dropDownValue; - FormFieldController? dropDownValueController; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - String? _textController3Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode4; - TextEditingController? textController4; - String? Function(BuildContext, String?)? textController4Validator; - String? _textController4Validator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ); - } - return null; - } - // Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget. - String? imgBase64; - // Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget. - ApiCallResponse? scheduleVisitor; + late RegisiterVistorTemplateComponentModel + regisiterVistorTemplateComponentModel; @override - void initState(BuildContext context) { - - textFieldFocusNode1 = FocusNode(); - textController1 = TextEditingController(); - textController1Validator = _textController1Validator; - - textFieldFocusNode2 = FocusNode(); - textController2 = TextEditingController(); - textController2Validator = _textController2Validator; - - - dropDownValue = ''; - // dropDownValueController = FormFieldController(initialValue: dropDownValue); - - textFieldFocusNode3 = FocusNode(); - textController3 = TextEditingController(); - textController3Validator = _textController3Validator; - - textFieldFocusNode4 = FocusNode(); - textController4 = TextEditingController(); - textController4Validator = _textController4Validator; - } + void initState(BuildContext context) {} @override - void dispose() { - unfocusNode.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); - - textFieldFocusNode2?.dispose(); - textController2?.dispose(); - - textFieldFocusNode3?.dispose(); - textController3?.dispose(); - - textFieldFocusNode4?.dispose(); - textController4?.dispose(); - } -} \ No newline at end of file + void dispose() {} +} diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index ea48ca5f..67eae017 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,17 +1,10 @@ -import 'package:hub/flutter_flow/nav/nav.dart'; - -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; -import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'register_visitor_page_model.dart'; export 'register_visitor_page_model.dart'; @@ -33,18 +26,6 @@ class _RegisterVisitorPageWidgetState extends State { void initState() { super.initState(); _model = createModel(context, () => RegisterVisitorPageModel()); - - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); - - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); - - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); - - _model.textController4 ??= TextEditingController(); - _model.textFieldFocusNode4 ??= FocusNode(); } @override @@ -57,878 +38,46 @@ class _RegisterVisitorPageWidgetState extends State { @override Widget build(BuildContext context) { context.watch(); - - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + automaticallyImplyLeading: false, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'megskb6s' /* Cadastro Visitante */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - ), - child: SingleChildScrollView( - child: Form( - // key: UniqueKey(), - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Builder( - builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - _model.isDataUploading = false; - _model.uploadedLocalFile = FFUploadedFile( - bytes: Uint8List.fromList([])); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - _model.uploadedLocalFile.bytes ?? - Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - ), - ), - ); - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null && - selectedMedia.every((m) => - validateFileFormat( - m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - showUploadMessage( - context, - 'Uploading file...', - 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(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - }); - showUploadMessage(context, 'Success!'); - } else { - setState(() {}); - showUploadMessage( - context, 'Failed to upload data'); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: 300.0, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ); - } - }, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - 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), - ), - 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), - ), - 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.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - 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), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - 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.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Column( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - if (_model.dropDownValue == null || - _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text(FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', - ), - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context) - .bodySmallFamily, - color: FlutterFlowTheme.of(context).error, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodySmallFamily), - )), - ), - ], - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'bqpucwh0' /* Contatos */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'h84ls2r6' /* Telefone */, - ), - 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), - ), - 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), - ), - 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.phone, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - validator: _model.textController3Validator - .asValidator(context), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - textInputAction: TextInputAction.done, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'fqp7qmka' /* Email */, - ), - 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), - ), - 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), - ), - 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.email, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes - ?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: '7654553234232342', - nome: 'Test', - tipo: 'V', - foto: 'base64;jpeg,klajsalkjslkajslkajl', - ).onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context).getVariableText( - ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ); - }); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - _model.textController4?.clear(); - }); - setState(() { - _model.dropDownValueController?.reset(); - }); - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg:FFLocalizations.of(context).getVariableText( - ptText: 'Erro ao cadastrar visitante. Tente novamente.', - enText: 'Error registering visitor. Try again.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context).getVariableText( - ptText: 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'okbw0aiu' /* Cadastrar */, - ), - options: FFButtonOptions( - width: 250.0, - height: 36.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 80.0, 0.0, 80.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, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: const BorderSide( - color: Colors.transparent, - width: 30.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - ), - ), - ), - ), - ] - .divide(const SizedBox(height: 10.0)) - .addToStart(const SizedBox(height: 30.0)), - ), - ), - ), - ), + title: Text( + FFLocalizations.of(context).getText( + 'megskb6s' /* Cadastro Visitante */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), + ), ), + actions: const [], + centerTitle: true, + elevation: 0.0, ), + body: const SafeArea( + top: true, + child: RegisiterVistorTemplateComponentWidget( + source: 'RegisterVisitorPage', + )), ); } -} \ No newline at end of file +} 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 f5192ee5..1551cf20 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 @@ -4,7 +4,6 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/request_manager.dart'; - import 'package:flutter/material.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; @@ -51,6 +50,7 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + DateTime? datePicked1; // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; @@ -107,4 +107,4 @@ class ScheduleCompleteVisitPageModel return false; } -} \ No newline at end of file +} 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 e1fdf3b6..07a4c7ca 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 @@ -1,6 +1,5 @@ import 'dart:developer'; - import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -24,7 +23,6 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; - class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ super.key, @@ -111,7 +109,7 @@ class _ScheduleCompleteVisitPageWidgetState // Simulate fetching data from an API or database Future> fetchVisitHistory(int start, int limit) async { // Simulate network delay - await Future.delayed(Duration(seconds: 1)); + await Future.delayed(const Duration(seconds: 1)); // Generate a list of visit history items return List.generate(limit, (index) => "Item ${start + index}"); } @@ -163,7 +161,6 @@ class _ScheduleCompleteVisitPageWidgetState } } - PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -315,8 +312,8 @@ Widget scheduleVisit( padding: const EdgeInsets.fromLTRB( 0, 0, - 0, - 20.0, + 20, + 20, ), shrinkWrap: true, scrollDirection: Axis.vertical, @@ -362,14 +359,16 @@ Widget scheduleVisit( setState(() {}); }, child: Container( - width: 100.0, + width: MediaQuery.of(context).size.width, height: 70.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, + .primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Container( width: 50.0, @@ -393,57 +392,35 @@ Widget scheduleVisit( fit: BoxFit.cover, ), ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_TIPO''', - ).toString(), - style: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ], + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), ] .divide(const SizedBox(width: 30.0)) .addToStart( @@ -466,10 +443,11 @@ Widget scheduleVisit( onPressed: () async { await showModalBottomSheet( isScrollControlled: true, + isDismissible: true, backgroundColor: FlutterFlowTheme.of(context) .primaryBackground, - enableDrag: false, + enableDrag: true, context: context, builder: (context) { return GestureDetector( @@ -480,25 +458,34 @@ Widget scheduleVisit( _model.unfocusNode) : FocusScope.of(context) .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, + child: SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.9, + width: MediaQuery.of(context) + .size + .width, + child: Padding( + padding: MediaQuery.viewInsetsOf( + context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: + (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), ), ), ); @@ -801,7 +788,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -822,7 +809,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked1Time; if (datePicked1Date != null) { datePicked1Time = @@ -868,7 +855,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -890,7 +877,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { @@ -1125,7 +1112,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -1146,7 +1133,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked2Time; if (datePicked2Date != null) { datePicked2Time = @@ -1192,7 +1179,7 @@ Widget scheduleVisit( pickerBackgroundColor: FlutterFlowTheme.of( context) - .secondaryBackground, + .primaryBackground, pickerForegroundColor: FlutterFlowTheme.of( context) @@ -1214,7 +1201,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { @@ -1563,12 +1550,58 @@ Widget scheduleVisit( onChanged: (newValue) async { setState(() => _model.switchValue = newValue); }, + applyCupertinoTheme: false, + focusColor: + FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .alternate; + } + return FlutterFlowTheme.of(context) + .alternate; + }, + ), + hoverColor: FlutterFlowTheme.of(context) + .primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: + WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context) + .accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), activeColor: FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).customColor4, - inactiveTrackColor: - FlutterFlowTheme.of(context).customColor4, + activeTrackColor: FlutterFlowTheme.of(context) + .primaryBackground, + inactiveTrackColor: FlutterFlowTheme.of(context) + .primaryBackground, inactiveThumbColor: FlutterFlowTheme.of(context).error, ), @@ -1792,11 +1825,10 @@ Widget scheduleVisit( alignment: const AlignmentDirectional(0.0, 1.0), child: Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + )), ), ), ), @@ -1937,10 +1969,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -1972,8 +2004,8 @@ Widget visitHistory( }, child: Card( clipBehavior: Clip.antiAliasWithSaveLayer, - color: FlutterFlowTheme.of(context) - .secondaryBackground, + color: + FlutterFlowTheme.of(context).primaryBackground, elevation: 5.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), @@ -1983,7 +2015,7 @@ Widget visitHistory( height: 115.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, + .primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -2193,8 +2225,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if (( jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2220,9 +2252,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if ( - jsonToStr( - getJsonField( + } else if (jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2261,9 +2292,8 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if (( - jsonToStr( - getJsonField( + } else if ((jsonToStr( + getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == @@ -2360,6 +2390,4 @@ Widget visitHistory( ), ), ); - - -} \ No newline at end of file +} From 7c11b6d84b944a620fa51dc20f5410a4114bb6e9 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 31 Jul 2024 12:00:25 -0300 Subject: [PATCH 28/34] fix message well, visitor register and preferences pages --- .../schedule_visit_detail_widget.dart | 101 +- ...siter_vistor_template_component_model.dart | 24 + ...iter_vistor_template_component_widget.dart | 922 +++--- .../view_visit_detail_widget.dart | 38 +- ...tails_modal_template_component_widget.dart | 358 +-- ...earch_modal_template_component_widget.dart | 230 +- .../message_history_page_model.dart | 12 +- .../message_history_page_widget.dart | 134 +- .../preferences_settings_model.dart | 37 +- .../preferences_settings_widget.dart | 4 +- .../schedule_complete_visit_page_model.dart | 93 +- .../schedule_complete_visit_page_widget.dart | 2676 ++++++++--------- 12 files changed, 2264 insertions(+), 2365 deletions(-) diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 935379ad..ad430d41 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -15,7 +15,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; - class ScheduleVisitDetailWidget extends StatefulWidget { const ScheduleVisitDetailWidget({ super.key, @@ -59,24 +58,22 @@ class _ScheduleVisitDetailWidgetState extends State { super.initState(); _model = createModel(context, () => ScheduleVisitDetailModel()); - _model.textController1 ??= - TextEditingController(text: widget.visitTempStr); + _model.textController1 ??= TextEditingController(text: widget.visitTempStr); _model.textFieldFocusNode1 ??= FocusNode(); _model.textController2 ??= TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); - _model.textController4 ??= TextEditingController( - text: extractDescToStr(widget.visitResonStr!)); + _model.textController4 ??= + TextEditingController(text: extractDescToStr(widget.visitResonStr!)); _model.textFieldFocusNode4 ??= FocusNode(); - _model.textController5 ??= TextEditingController( - text: extractDescToStr(widget.visitLevelStr!)); + _model.textController5 ??= + TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -132,8 +129,8 @@ class _ScheduleVisitDetailWidgetState extends State { child: Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -192,41 +189,47 @@ class _ScheduleVisitDetailWidgetState extends State { BorderRadius.circular(100.0), ), child: Align( - alignment: - const AlignmentDirectional(1.0, -1.0), + alignment: const AlignmentDirectional( + 1.0, -1.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: - Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => - safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: + // Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf( + // context), + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => + // safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), + fadeInDuration: const Duration( + milliseconds: 500), + fadeOutDuration: const Duration( + milliseconds: 500), imageUrl: valueOrDefault( "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( @@ -352,8 +355,9 @@ class _ScheduleVisitDetailWidgetState extends State { children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -459,8 +463,9 @@ class _ScheduleVisitDetailWidgetState extends State { ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -576,8 +581,9 @@ class _ScheduleVisitDetailWidgetState extends State { children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -683,8 +689,9 @@ class _ScheduleVisitDetailWidgetState extends State { ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController5, focusNode: _model.textFieldFocusNode5, @@ -905,7 +912,8 @@ class _ScheduleVisitDetailWidgetState extends State { Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), child: Container( width: double.infinity, height: 35.0, @@ -934,8 +942,7 @@ class _ScheduleVisitDetailWidgetState extends State { dtInicio: widget.visitStartDate, dtFim: widget.visitEndDate, unica: widget.visitTempStr, - idMotivo: - extractIdToStr(widget.visitResonStr!), + idMotivo: extractIdToStr(widget.visitResonStr!), idNAC: extractIdToStr(widget.visitLevelStr!), obs: widget.visitObsStr, cliID: FFAppState().cliUUID, @@ -981,4 +988,4 @@ class _ScheduleVisitDetailWidgetState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index f0fffd4e..6e812792 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,3 +1,9 @@ +import 'dart:developer'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; @@ -25,6 +31,24 @@ class RegisiterVistorTemplateComponentModel ptText: 'Este campo é obrigatório', ); } + + return null; + } + + Future getVisitanteByDocument( + String document, BuildContext context) async { + final response = await PhpGroup.getVisitorByDocCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitante', + documento: document, + ); + log('${response.jsonBody}'); + if (response.jsonBody['visitante']['VTE_ID'] != '0' && + response.jsonBody['error'] != 'false') { + return true; + } return null; } diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 2b541bf5..b47c79ee 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,6 +1,9 @@ import 'dart:developer'; import 'package:flutter/services.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:json_path/fun_sdk.dart'; +import 'package:rxdart/rxdart.dart'; import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; @@ -15,6 +18,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'regisiter_vistor_template_component_model.dart'; + export 'regisiter_vistor_template_component_model.dart'; class RegisiterVistorTemplateComponentWidget extends StatefulWidget { @@ -45,6 +49,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController2 ??= TextEditingController(); _model.textFieldFocusNode2 ??= FocusNode(); + _model.textController2?.addListener(_onTextChanged); _model.textController3 ??= TextEditingController(); _model.textFieldFocusNode3 ??= FocusNode(); @@ -58,10 +63,17 @@ class _RegisiterVistorTemplateComponentWidgetState _model.dispose(); super.dispose(); + _model.textController2?.removeListener(_onTextChanged); + } + + void _onTextChanged() { + log('changed'); + setState(() {}); } @override Widget build(BuildContext context) { + BehaviorSubject visitorAlreadyRegistered = BehaviorSubject(); context.watch(); log(context .describeWidget('RegisiterVistorTemplateComponentWidget') @@ -83,11 +95,360 @@ class _RegisiterVistorTemplateComponentWidgetState child: SingleChildScrollView( child: Form( // key: UniqueKey(), - autovalidateMode: AutovalidateMode.disabled, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 15.0), + child: Text( + FFLocalizations.of(context).getText( + 'zazj5d8b' /* Preencha o formulário com os d... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: AutovalidateMode.onUserInteraction, + autofocus: false, + textCapitalization: TextCapitalization.none, + autofillHints: const [AutofillHints.password], + keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'rl8tvwnr' /* Documento */, + ), + 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), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + 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.document_scanner, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: + _model.textController2Validator.asValidator(context), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + ], + ), + ), + FutureBuilder( + future: _model.textController2.text.isNotEmpty + ? _model.getVisitanteByDocument( + _model.textController2.text, context) + : null, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const SizedBox(); + } else if (snapshot.hasError || + snapshot.data == null || + snapshot.data == '') { + visitorAlreadyRegistered.add(true); + return const SizedBox(); + } else { + visitorAlreadyRegistered.add(false); + return _model.textController2.text.isEmpty + ? const SizedBox() + : Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only( + right: MediaQuery.sizeOf(context).width * + 0.1), + child: Text( + FFLocalizations.of(context) + .getVariableText( + enText: 'Visitor already registered', + ptText: 'Visitante já cadastrado', + ), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context) + .error, + fontSize: 14.0, + letterSpacing: 0.0, + )), + ), + ], + ); + } + }, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + autovalidateMode: AutovalidateMode.onUserInteraction, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'v7g73yik' /* Nome */, + ), + 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), + ), + 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), + ), + 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.person, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + maxLines: null, + keyboardType: TextInputType.name, + validator: + _model.textController1Validator.asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.95, + decoration: const BoxDecoration(), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 7.0), + child: Text( + FFLocalizations.of(context).getText( + 'yp23q90m' /* Selecione o tipo: */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 5.0), + child: FlutterFlowDropDown( + controller: _model.dropDownValueController ??= + FormFieldController(null), + options: [ + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ), + FFLocalizations.of(context).getText( + '9luaa09e' /* Prestador de Serviço */, + ) + ], + onChanged: (val) => + setState(() => _model.dropDownValue = val), + width: 200.0, + height: 44.0, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'pmezihb4' /* Selecione... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: + FlutterFlowTheme.of(context).primaryText, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).customColor6, + borderWidth: 0.5, + borderRadius: 8.0, + margin: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ), + ), + ] + .divide(const SizedBox(width: 19.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + if (_model.dropDownValue == null || + _model.dropDownValue == '') + Align( + alignment: const AlignmentDirectional(0.4, 0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + 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), + )), + ), + ], + ), + ), + ), Builder( builder: (context) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { @@ -246,310 +607,7 @@ class _RegisiterVistorTemplateComponentWidgetState alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 15.0), - child: Text( - FFLocalizations.of(context).getText( - 'zazj5d8b' /* Preencha o formulário com os d... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - autovalidateMode: AutovalidateMode.onUserInteraction, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'v7g73yik' /* Nome */, - ), - 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), - ), - 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), - ), - 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.person, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - maxLines: null, - keyboardType: TextInputType.name, - validator: - _model.textController1Validator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autovalidateMode: AutovalidateMode.onUserInteraction, - autofocus: false, - textCapitalization: TextCapitalization.none, - autofillHints: const [AutofillHints.password], - keyboardType: TextInputType.number, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - 'rl8tvwnr' /* Documento */, - ), - 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), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - 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.document_scanner, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textController2Validator.asValidator(context), - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')), - ], - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.95, - decoration: const BoxDecoration(), - child: Column( - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 7.0), - child: Text( - FFLocalizations.of(context).getText( - 'yp23q90m' /* Selecione o tipo: */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 5.0), - child: FlutterFlowDropDown( - controller: _model.dropDownValueController ??= - FormFieldController(null), - options: [ - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ), - FFLocalizations.of(context).getText( - '9luaa09e' /* Prestador de Serviço */, - ) - ], - onChanged: (val) => - setState(() => _model.dropDownValue = val), - width: 200.0, - height: 44.0, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: - FlutterFlowTheme.of(context).primaryText, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).customColor6, - borderWidth: 0.5, - borderRadius: 8.0, - margin: const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ), - ), - ] - .divide(const SizedBox(width: 19.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - if (_model.dropDownValue == null || - _model.dropDownValue == '') - Align( - alignment: const AlignmentDirectional(0.4, 0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - 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), - )), - ), - ], - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), + 20.0, 10.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( 'bqpucwh0' /* Contatos */, @@ -735,155 +793,129 @@ class _RegisiterVistorTemplateComponentWidgetState padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), child: FFButtonWidget( - onPressed: () async { - if (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? - false)) && - (_model.textController1.text != '') && - (_model.dropDownValue != null && - _model.dropDownValue != '') && - (_model.textController2.text != '')) { - _model.imgBase64 = - await actions.convertImageFileToBase64( - _model.uploadedLocalFile, - ); - _model.scheduleVisitor = - await PhpGroup.postScheduleVisitorCall - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putVisitante', - documento: _model.textController2.text, - nome: _model.textController1.text, - tipo: _model.dropDownValue == - FFLocalizations.of(context).getText( - 'n8vddmcq' /* Visitante */, - ) - ? 'V' - : 'P', - foto: 'base64;jpeg,${_model.imgBase64}', - ) - .onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) && + (_model.textController1.text != '') && + (_model.dropDownValue != null && + _model.dropDownValue != '') && + (_model.textController2.text != '')) + ? () async { + log(visitorAlreadyRegistered.value.toString()); + if (visitorAlreadyRegistered.value == true) { + _model.imgBase64 = + await actions.convertImageFileToBase64( + _model.uploadedLocalFile, + ); + _model.scheduleVisitor = + await PhpGroup.postScheduleVisitorCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putVisitante', + documento: _model.textController2.text, + nome: _model.textController1.text, + tipo: _model.dropDownValue == + FFLocalizations.of(context).getText( + 'n8vddmcq' /* Visitante */, + ) + ? 'V' + : 'P', + foto: 'base64;jpeg,${_model.imgBase64}', + ) + .onError((e, s) async { + return await showAdaptiveDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.pop(context), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: Dialog( + backgroundColor: Colors.transparent, + child: ThrowExceptionWidget( + msg: FFLocalizations.of(context) + .getVariableText( + ptText: + 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', + enText: + 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', + ), + ), + ), + ), + ); + }, + ); + }); + if (PhpGroup.postScheduleVisitorCall.error( + (_model.scheduleVisitor?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.textController1?.clear(); + _model.textController2?.clear(); + _model.textController3?.clear(); + _model.textController4?.clear(); + _model.dropDownValueController?.reset(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante cadastrado com sucesso.', + enText: + 'Visitor successfully registered.'), + style: TextStyle( + color: + FlutterFlowTheme.of(context) + .info)), + backgroundColor: + FlutterFlowTheme.of(context).primary, + duration: const Duration(seconds: 3), + width: MediaQuery.of(context).size.width, + behavior: SnackBarBehavior.floating, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), ), ), - ), - ), - ); - }, - ); - }); - - if (PhpGroup.postScheduleVisitorCall.error( - (_model.scheduleVisitor?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clearComposing(); - _model.textController2?.clearComposing(); - _model.textController3?.clearComposing(); - _model.textController4?.clearComposing(); - _model.dropDownValueController?.reset(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Visitante cadastrado com sucesso.', - enText: - 'Visitor successfully registered.'), - style: TextStyle( - color: - FlutterFlowTheme.of(context).info)), - backgroundColor: - FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ); - if (widget.source == 'VisitorNotFoundComponent') { - Navigator.pop(context); + ); + if (widget.source == + 'VisitorNotFoundComponent') { + Navigator.pop(context); + } + }); + } else { + return DialogUtil.error( + context, + PhpGroup.postScheduleVisitorCall + .errorMsg( + _model.scheduleVisitor?.jsonBody) + .toString()); + } + } else { + DialogUtil.error( + context, + FFLocalizations.of(context).getVariableText( + ptText: + 'Visitante já cadastrado. Verifique se o documento foi preenchido corretamente.', + enText: + 'Visitor already registered. Check if the document was filled in correctly.', + )); } - }); - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitorCall - .errorMsg(_model - .scheduleVisitor?.jsonBody) - .toString()), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - } else { - await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () { - Form.of(context)?.validate(); - Navigator.pop(context); - }, - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } - - setState(() {}); - }, + } + : null, text: FFLocalizations.of(context).getText( 'okbw0aiu' /* Cadastrar */, ), options: FFButtonOptions( width: 250.0, height: 36.0, + disabledColor: FlutterFlowTheme.of(context).customColor6, padding: const EdgeInsetsDirectional.fromSTEB( 80.0, 0.0, 80.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index bea401b7..0b82c87a 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -101,8 +101,7 @@ class _ViewVisitDetailWidgetState extends State { TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); - _model.textController3 ??= - TextEditingController(text: widget.visitEndDate); + _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= @@ -212,20 +211,26 @@ class _ViewVisitDetailWidgetState extends State { hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ); - }, - ).then((value) => safeSetState(() {})); + // Navigator.pop(context); + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // useSafeArea: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: ClipRRect( borderRadius: BorderRadius.circular(100.0), @@ -870,7 +875,6 @@ class _ViewVisitDetailWidgetState extends State { Share.share( 'Visita agendada para ${widget.visitStartDate} com término previsto para ${widget.visitEndDate}. Motivo: ${widget.visitReasonStr}. Nível de acesso: ${widget.visitLevelStr}. Observações: ${widget.visitObsStr}.', ); - }, ), ], diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart index 5f29a6fe..307ba81b 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -6,7 +6,19 @@ import 'visitor_details_modal_template_component_model.dart'; export 'visitor_details_modal_template_component_model.dart'; class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { - const VisitorDetailsModalTemplateComponentWidget({super.key}); + const VisitorDetailsModalTemplateComponentWidget( + {super.key, + required this.visitorImageURL, + required this.visitorName, + required this.visitorType, + required this.visitorPhone, + required this.visitorEmail}); + + final String? visitorImageURL; + final String? visitorName; + final String? visitorType; + final String? visitorPhone; + final String? visitorEmail; @override State createState() => @@ -50,20 +62,40 @@ class _VisitorDetailsModalTemplateComponentWidgetState color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: BorderRadius.circular(25.0), ), - child: Stack( + child: Column( + mainAxisSize: MainAxisSize.max, children: [ - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), + Container( + width: double.infinity, + height: 34.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryText, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 5.0, 15.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + Navigator.pop(context); + }, + child: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).primaryBackground, + size: 24.0, + ), ), ), ), @@ -71,68 +103,99 @@ class _VisitorDetailsModalTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(0.0, -1.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(20.0, 40.0, 20.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 40.0, 20.0, 0.0), child: Container( decoration: const BoxDecoration( shape: BoxShape.rectangle, ), - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), - child: Column( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + if (widget.visitorImageURL != '' && + widget.visitorImageURL != null) + Container( + width: 100.0, + height: 100.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: Image.network( + widget.visitorImageURL!, + fit: BoxFit.cover, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + widget.visitorName ?? '', + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'hz7ivuqn' /* Tipo de Visitante */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, children: [ - Container( - width: 100.0, - height: 100.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), + Icon( + Icons.phone, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, ), Align( - alignment: const AlignmentDirectional(0.0, 0.0), + alignment: + const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( 20.0, 0.0, 20.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'kqzf7nx2' /* Nome do Visitante */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'hz7ivuqn' /* Tipo de Visitante */, + 'rwqn0det' /* (00) 0 0000-0000 */, ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) @@ -151,128 +214,67 @@ class _VisitorDetailsModalTemplateComponentWidgetState ), ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.phone, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'rwqn0det' /* (00) 0 0000-0000 */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Icon( - Icons.email, - color: FlutterFlowTheme.of(context).primary, - size: 24.0, - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 20.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '0wqbiekp' /* email@provider.etc */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), ], ), - ), - ], - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, -1.0), - child: Container( - width: double.infinity, - height: 34.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryText, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), - ), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 5.0, 15.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - Navigator.pop(context); - }, - child: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).primaryBackground, - size: 24.0, - ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 24.0, + ), + Align( + alignment: + const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '0wqbiekp' /* email@provider.etc */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ], + ), + ], ), ), ), ), ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: double.infinity, + // height: 34.0, + // decoration: BoxDecoration( + // color: FlutterFlowTheme.of(context).primaryText, + // borderRadius: const BorderRadius.only( + // bottomLeft: Radius.circular(0.0), + // bottomRight: Radius.circular(0.0), + // topLeft: Radius.circular(0.0), + // topRight: Radius.circular(0.0), + // ), + // ), + // ), + // ), ], ), ), diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 6d8138cb..35b21ac6 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -47,12 +47,6 @@ class _VisitorSearchModalTemplateComponentWidgetState _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); - - WidgetsBinding.instance.addPostFrameCallback((_) => setState(() { - _model.textController?.text = FFLocalizations.of(context).getText( - 'oj12tamm' /* test */, - ); - })); } @override @@ -91,10 +85,7 @@ class _VisitorSearchModalTemplateComponentWidgetState focusNode: _model.textFieldFocusNode, onFieldSubmitted: (_) async { setState(() { - _model.textController?.text = valueOrDefault( - _model.textController.text, - '69696777', - ); + _model.textController?.text = _model.textController.text; _model.textController?.selection = TextSelection.collapsed( offset: _model.textController!.text.length); }); @@ -268,7 +259,6 @@ class _VisitorSearchModalTemplateComponentWidgetState builder: (context) { final visitor = _model.visitors.map((e) => e).toList(); - return ListView.builder( padding: EdgeInsets.zero, scrollDirection: Axis.vertical, @@ -284,39 +274,42 @@ class _VisitorSearchModalTemplateComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: 610.0, - child: - VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); + // await showModalBottomSheet( + // isScrollControlled: true, + // enableDrag: true, + // isDismissible: true, + // context: context, + // builder: (context) { + // return Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: SizedBox( + // height: 610.0, + // child: + // VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: + // "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + // visitorItem, + // r'''$.VTE_DOCUMENTO''', + // ).toString()}&tipo=E", + // visitorEmail: '', + // visitorName: getJsonField( + // visitorItem, + // r'''$.VTE_NOME''', + // )?.toString(), + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); }, child: Container( width: 100.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) - .secondaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 0.0, - color: FlutterFlowTheme.of(context) - .alternate, - offset: const Offset( - 0.0, - 1.0, - ), - ) - ], + .primaryBackground, ), child: Padding( padding: const EdgeInsets.all(8.0), @@ -333,13 +326,11 @@ class _VisitorSearchModalTemplateComponentWidgetState milliseconds: 500), fadeOutDuration: const Duration( milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", width: 60.0, height: 60.0, fit: BoxFit.cover, @@ -348,6 +339,8 @@ class _VisitorSearchModalTemplateComponentWidgetState Expanded( child: Column( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -382,58 +375,6 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ), ), - Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 4.0, 4.0, 0.0, 0.0), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Align( - alignment: - const AlignmentDirectional( - 0.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, - 0.0, - 0.0, - 0.0), - child: Text( - getJsonField( - visitorItem, - r'''$.VTE_TELEFONE''', - ).toString(), - style: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme.of( - context) - .primary, - letterSpacing: - 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ), ], ), ), @@ -442,10 +383,10 @@ class _VisitorSearchModalTemplateComponentWidgetState borderWidth: 1.0, buttonSize: 40.0, icon: Icon( - Icons.restore_from_trash, + Icons.close, color: FlutterFlowTheme.of(context) - .primary, + .customColor6, size: 20.0, ), onPressed: () async { @@ -470,54 +411,65 @@ class _VisitorSearchModalTemplateComponentWidgetState width: 100.0, height: 100.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).secondaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, ), ); } }, ), ), - FFButtonWidget( - onPressed: () async { - await widget.getVisitors?.call( - _model.visitors, - ); - await widget.getDocs?.call( - _model.docs, - ); - Navigator.pop(context); - }, - text: FFLocalizations.of(context).getText( - 'ug6qzyla' /* Adicionar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 30.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, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: () async { + await widget.getVisitors?.call( + _model.visitors, + ); + await widget.getDocs?.call( + _model.docs, + ); + Navigator.pop(context); + }, + text: FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.width * 0.1, + 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, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), + ], ), + const SizedBox( + height: 10.0, + ) ], ), ), diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/message_history_page/message_history_page_model.dart index 9a40e0c4..8d11df7b 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,15 +1,16 @@ +import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/request_manager.dart'; - import 'package:flutter/material.dart'; import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -class MessageHistoryPageModel extends FlutterFlowModel { +class MessageHistoryPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. - /// - + /// + //copyWith final unfocusNode = FocusNode(); @@ -49,9 +50,8 @@ class MessageHistoryPageModel extends FlutterFlowModel textController?.dispose(); tabBarController?.dispose(); - /// Dispose query cache managers for this widget. clearGetLiberationsCache(); } -} \ No newline at end of file +} 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 18cffa18..8d9d7d5c 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -12,7 +12,6 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/message_history_page/message_history_page_model.dart'; - import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -26,7 +25,8 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -36,7 +36,7 @@ class _MessageHistoryPageWidgetState extends State wit super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); - _model.tabBarController = TabController( + _model.tabBarController = TabController( vsync: this, length: 3, initialIndex: 1, @@ -106,8 +106,7 @@ PreferredSizeWidget appBarMessage(BuildContext context) { ); } -Widget bodyMessage( - BuildContext context, MessageHistoryPageModel _model) { +Widget bodyMessage(BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, child: Column( @@ -155,33 +154,26 @@ Widget bodyMessage( }, ), ), - Expanded(child: TabBarView( - controller: _model.tabBarController, - children: [ - liberationDynamicListView(context, _model, 'P'), - liberationDynamicListView(context, _model, 'A'), - liberationDynamicListView(context, _model, 'T'), - ] - )), + Expanded( + child: TabBarView(controller: _model.tabBarController, children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ])), ].addToStart(const SizedBox(height: 0)), ), ); } - - - Widget liberationDynamicListView( - BuildContext context, - MessageHistoryPageModel _model, - String DestIndex -) { + BuildContext context, MessageHistoryPageModel _model, String DestIndex) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: FutureBuilder( - future: PhpGroup.getMessagesCall.call( + future: PhpGroup.getMessagesCall + .call( devUUID: FFAppState().devUUID.toString(), userUUID: FFAppState().userUUID.toString(), cliID: FFAppState().cliUUID.toString(), @@ -189,7 +181,8 @@ Widget liberationDynamicListView( pageSize: '100', pageNumber: '1', tipoDestino: DestIndex, - ).catchError((error) { + ) + .catchError((error) { log('Error: ${error.toString()}'); return Future.delayed(Duration(seconds: 1), () { return Center( @@ -217,8 +210,15 @@ Widget liberationDynamicListView( child: Text('Erro ao carregar mensagens'), ); } + final mensagens = snapshot.data!.jsonBody['mensagens']; + final totalRows = snapshot.data!.jsonBody['total_rows']; + if (totalRows == 0 || mensagens == null || mensagens.isEmpty) { + return const Center( + child: Text('Nenhuma mensagem encontrada'), + ); + } return ListView.builder( - itemCount: snapshot.data!.jsonBody['total_rows'], + itemCount: totalRows, addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, @@ -234,8 +234,7 @@ Widget liberationDynamicListView( ); } -Widget messageHistoryItem( - BuildContext context, dynamic jsonBody) { +Widget messageHistoryItem(BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), @@ -250,55 +249,60 @@ Widget messageHistoryItem( Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon( - jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, - color: FlutterFlowTheme.of(context).accent1, - ) - ], - ), - SizedBox(height: 8), - Row( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, + Row( + mainAxisAlignment: MainAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + color: FlutterFlowTheme.of(context).customColor6, + overflow: TextOverflow.ellipsis, + ), ), - overflow: TextOverflow.fade, ), - ), + ], + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 12, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).primary, + ), + ], ), ], ), SizedBox(height: 8), - Text(jsonBody['MSG_TEXTO'].toString(),), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + jsonBody['MSG_TEXTO'].toString(), + ), + ), + SizedBox(height: 8), ], ), ), ), ), ); - - -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index cac62056..d7c05015 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -51,41 +51,8 @@ class PreferencesPageModel with ChangeNotifier { void enablePerson(BuildContext context) { notifyListeners(); - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(FFAppState().userDevUUID, - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.share, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () { - log('IconButton pressed ...'); - // Implement share functionality here - Share.share( - FFAppState().userDevUUID, - ); - }, - ), - ], - ), - backgroundColor: FlutterFlowTheme.of(context).primary, - duration: const Duration(seconds: 1), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), + Share.share( + FFAppState().userDevUUID, ); } diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 8a036ed9..e0aa39c1 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -113,8 +113,8 @@ class PreferencesPageWidget extends StatelessWidget { onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; content = FFLocalizations.of(context).getVariableText( - ptText: 'Exibir código de identificação remota', - enText: 'Display remote identification code', + ptText: 'Compartilhe o código de identificação remota', + enText: 'Share the remote identification code', ); break; case 2: 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 1551cf20..d1ea6e19 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 @@ -1,11 +1,14 @@ +import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/request_manager.dart'; import 'package:flutter/material.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +import 'package:intl/intl.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { @@ -37,6 +40,18 @@ class ScheduleCompleteVisitPageModel visitorJsonList[index] = updateFn(visitorJsonList[index]); String visitorStrList = '0'; + bool? dropDownValidator1; + bool? dropDownValidator2; + + bool isValid() { + if ((textController1!.text != '') && + (textController2!.text != '') && + (dropDownValue1 != null && dropDownValue1 != '') && + (dropDownValue2 != null && dropDownValue2 != '')) { + return true; + } + return false; + } /// State fields for stateful widgets in this page. @@ -50,16 +65,66 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode1; TextEditingController? textController1; String? Function(BuildContext, String?)? textController1Validator; + String? _textController1Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime startDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime endDate = + DateFormat('d/M/y H:mm:ss').parse(textController2!.text); + if (startDate.isAfter(endDate)) { + return FFLocalizations.of(context).getVariableText( + ptText: 'A data de início deve ser anterior à data de término.', + enText: 'Start date must be before end date.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } DateTime? datePicked1; // State field(s) for TextField widget. FocusNode? textFieldFocusNode2; TextEditingController? textController2; String? Function(BuildContext, String?)? textController2Validator; + String? _textController2Validator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required.', + ptText: 'Este campo é obrigatório.', + ); + } + if (val != null) { + try { + DateTime endDate = DateFormat('d/M/y H:mm:ss').parse(val); + DateTime startDate = + DateFormat('d/M/y H:mm:ss').parse(textController1!.text); + if (endDate.isBefore(startDate)) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after start date.', + ptText: 'A data de término deve ser posterior à data de início.', + ); + } + } catch (e) { + return '$e'; + } + } + return null; + } + DateTime? datePicked2; // State field(s) for DropDown widget. String? dropDownValue1; FormFieldController? dropDownValueController1; + // State field(s) for DropDown widget. String? dropDownValue2; FormFieldController? dropDownValueController2; @@ -69,9 +134,35 @@ class ScheduleCompleteVisitPageModel FocusNode? textFieldFocusNode3; TextEditingController? textController3; String? Function(BuildContext, String?)? textController3Validator; + String? _textController3Validator(BuildContext context, String? val) { + // if (val == null || val.isEmpty) { + // return FFLocalizations.of(context).getVariableText( + // enText: 'This field is required.', + // ptText: 'Este campo é obrigatório.', + // ); + // } + return null; + } @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + tabBarController = TabController( + vsync: Navigator.of(context), + length: 2, + ); + + textFieldFocusNode1 = FocusNode(); + textController1 = TextEditingController(); + textController1Validator = _textController1Validator; + + textFieldFocusNode2 = FocusNode(); + textController2 = TextEditingController(); + textController2Validator = _textController2Validator; + + textFieldFocusNode3 = FocusNode(); + textController3 = TextEditingController(); + textController3Validator = _textController3Validator; + } @override void dispose() { 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 07a4c7ca..868ba7a8 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 @@ -7,7 +7,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; @@ -264,155 +263,151 @@ Widget scheduleVisit( child: Column( mainAxisSize: MainAxisSize.max, children: [ - Stack( - children: [ - Container( - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - const VisitorDetailsModalTemplateComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - _model.removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.end, children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), IconButton( onPressed: () async { _model @@ -421,1239 +416,440 @@ Widget scheduleVisit( setState(() {}); }, icon: const Icon(Icons.close)), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart( - const SizedBox(width: 30.0)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.9, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), ), ), ); }, - ); + ).then((value) => safeSetState(() {})); }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.9, - width: MediaQuery.of(context) - .size - .width, - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: - (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: - MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe' /* Qual o período de validade da ... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textController1, + readOnly: true, + focusNode: _model.textFieldFocusNode1, + 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), + ), + hintText: FFLocalizations.of(context).getText( + '53cbwqh9' /* Quando você inicia a visita? */, + ), + 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, + ), + enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent4, - width: 1.0, + width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + 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, + ), + textAlign: TextAlign.center, + validator: _model.textController1Validator + .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 datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + 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) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), + .headlineLargeFamily), ), - ), - ), - ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + 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, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - 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), - ), - hintText: - FFLocalizations.of(context) - .getText( - '53cbwqh9' /* Quando você inicia a visita? */, - ), - 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, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController1Validator - .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 datePicked1Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - 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: 32.0, - 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, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - 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 (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - _model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - setState(() { - _model.textController1?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked1, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController1 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController1! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 55.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: SizedBox( - height: double.infinity, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - 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), - ), - hintText: - FFLocalizations.of(context) - .getText( - 'xpgc5e8d' /* Quando a visita terminá? */, - ), - 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, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - lineHeight: 1.0, - ), - textAlign: TextAlign.center, - validator: _model - .textController2Validator - .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 datePicked2Date = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - 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: 32.0, - 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, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = - await showTimePicker( - context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - 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 (datePicked2Date != null && - datePicked2Time != null) { - safeSetState(() { - _model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - setState(() { - _model.textController2?.text = - dateTimeFormat( - 'd/M/y H:mm:ss', - _model.datePicked2, - locale: - FFLocalizations.of(context) - .languageCode, - ); - _model.textController2 - ?.selection = - TextSelection.collapsed( - offset: _model - .textController2! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 39.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u' /* Quais são os motivos da visita... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController1 ??= - FormFieldController( - _model.dropDownValue1 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .reasonsJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .reasonsMotDescStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of( context) - .bodyMediumFamily), + .headlineLargeFamily), ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr' /* Escolha um motivo aqui */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: + pickerBackgroundColor: FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, + .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 (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + _model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + setState(() { + _model.textController1?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController1?.selection = + TextSelection.collapsed( + offset: _model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), ), ), ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliUUID: FFAppState().cliUUID, - atividade: 'getDados', - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: - FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - final dropDownGetDadosResponse = - snapshot.data!; - return FlutterFlowDropDown( - controller: - _model.dropDownValueController2 ??= - FormFieldController( - _model.dropDownValue2 ??= '', - ), - options: List.from( - PhpGroup.getDadosCall - .levelJsonList( - dropDownGetDadosResponse - .jsonBody, - )! - .map((e) => e.toString()) - .toList()), - optionLabels: PhpGroup.getDadosCall - .levelNACDescricaoStrList( - dropDownGetDadosResponse.jsonBody, - )!, - onChanged: (val) => setState( - () => _model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c' /* Escolha um nível de acesso aqu... */, - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context) - .accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: const EdgeInsetsDirectional - .fromSTEB(16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), + ), + ], + ), ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + // decoration: const BoxDecoration(), + child: Stack( + children: [ + Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1' /* Visita se encerra após o prime... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht' /* Visita única */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch.adaptive( - value: _model.switchValue!, - onChanged: (newValue) async { - setState(() => _model.switchValue = newValue); - }, - applyCupertinoTheme: false, - focusColor: - FlutterFlowTheme.of(context).primary, - trackColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .alternate; - } - return FlutterFlowTheme.of(context) - .alternate; - }, - ), - hoverColor: FlutterFlowTheme.of(context) - .primaryBackground, - // thumbColor: WidgetStateColor.resolveWith( - // (states) { - // if (states.contains(WidgetState.disabled)) { - // return FlutterFlowTheme.of(context) - // .alternate; - // } - // return FlutterFlowTheme.of(context) - // .alternate; - // }, - // ), - overlayColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - trackOutlineColor: - WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context) - .accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - activeColor: - FlutterFlowTheme.of(context).success, - activeTrackColor: FlutterFlowTheme.of(context) - .primaryBackground, - inactiveTrackColor: FlutterFlowTheme.of(context) - .primaryBackground, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'eftcs67c' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, + 24.0, 0.0, 24.0, 0.0), child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, + readOnly: true, + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autovalidateMode: + AutovalidateMode.onUserInteraction, autofocus: false, - textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup' /* Observações da Visita */, - ), labelStyle: FlutterFlowTheme.of(context) .labelMedium .override( @@ -1668,7 +864,7 @@ Widget scheduleVisit( .labelMediumFamily), ), hintText: FFLocalizations.of(context).getText( - 'w18iztdm' /* Escreva as suas observações aq... */, + 'xpgc5e8d' /* Quando a visita terminá? */, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -1682,37 +878,38 @@ Widget scheduleVisit( .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + lineHeight: 1.0, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent4, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).primary, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: BorderRadius.circular(8.0), ), suffixIcon: Icon( - Icons.text_fields, + Icons.date_range, color: FlutterFlowTheme.of(context).accent1, ), ), @@ -1721,117 +918,736 @@ Widget scheduleVisit( .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .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 datePicked2Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + 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: 32.0, + 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, + ); + }, + ); + + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + 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 (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + _model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + setState(() { + _model.textController2?.text = dateTimeFormat( + 'd/M/y H:mm:ss', + _model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + _model.textController2?.selection = + TextSelection.collapsed( + offset: _model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ] + // .divide(const SizedBox(height: 0.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u' /* Quais são os motivos da visita... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final reasonsJsonList = + PhpGroup.getDadosCall.reasonsJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= '', + ), + options: reasonsJsonList != null && + reasonsJsonList != [] + ? List.from( + PhpGroup.getDadosCall + .reasonsJsonList( + dropDownGetDadosResponse + .jsonBody, + )! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .reasonsMotDescStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr' /* Escolha um motivo aqui */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliUUID: FFAppState().cliUUID, + atividade: 'getDados', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final dropDownGetDadosResponse = + snapshot.data!; + final lavelList = + PhpGroup.getDadosCall.levelJsonList( + dropDownGetDadosResponse.jsonBody, + ); + return FlutterFlowDropDown( + controller: + _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= '', + ), + options: + lavelList != null && lavelList != [] + ? List.from(lavelList! + .map((e) => e.toString()) + .toList()) + : [], + optionLabels: PhpGroup.getDadosCall + .levelNACDescricaoStrList( + dropDownGetDadosResponse.jsonBody, + ), + onChanged: (val) => setState( + () => _model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c' /* Escolha um nível de acesso aqu... */, + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context).accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: + const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (_model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1' /* Visita se encerra após o prime... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht' /* Visita única */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: _model.textController3Validator - .asValidator(context), ), ), ), + Switch.adaptive( + value: _model.switchValue!, + onChanged: (newValue) async { + setState(() => _model.switchValue = newValue); + }, + applyCupertinoTheme: false, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } + return FlutterFlowTheme.of(context).alternate; + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + // thumbColor: WidgetStateColor.resolveWith( + // (states) { + // if (states.contains(WidgetState.disabled)) { + // return FlutterFlowTheme.of(context) + // .alternate; + // } + // return FlutterFlowTheme.of(context) + // .alternate; + // }, + // ), + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, + ), ], ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], - ), + ), + ], ), - ), - ], - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - if ((_model.textController1.text != '') && - (_model.textController2.text != '') && - (_model.dropDownValue1 != null && - _model.dropDownValue1 != '') && - (_model.dropDownValue2 != null && - _model.dropDownValue2 != '')) { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: VisitDetailsModalTemplateComponentWidget( - visitStartDateStr: _model.textController1.text, - visitEndDateStr: _model.textController2.text, - visitReasonStr: _model.dropDownValue1, - visitLevelStr: _model.dropDownValue2, - visitTempStr: - _model.switchValue == true ? 'Sim' : 'Não', - visitObsStr: _model.textController3.text, - visitorStrList: _model.visitorStrList, - visitorJsonList: _model.visitorJsonList, - updateToggleIdx: () async {}, - repeatVisitSchedule: () async {}, + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c' /* Você tem alguma observação sob... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), - ); - }, - ).then((value) => safeSetState(() {})); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: 'Campos obrigatórios imcompletos.', + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup' /* Observações da Visita */, + ), + 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), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm' /* Escreva as suas observações aq... */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + 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.text_fields, + color: FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: _model.textController3Validator + .asValidator(context), ), ), - ); - }, - ).then((value) => safeSetState(() {})); - } - }, - child: Container( - width: MediaQuery.sizeOf(context).width * 0.5, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: BorderRadius.circular(10.0), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text(FFLocalizations.of(context).getVariableText( - enText: 'Schedule', - ptText: 'Agendar', - )), - ), + ), + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], ), ), + FFButtonWidget( + text: 'Schedule', + onPressed: _model.isValid() + ? () async { + await showDialog( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.5, + child: VisitDetailsModalTemplateComponentWidget( + visitStartDateStr: _model.textController1.text, + visitEndDateStr: _model.textController2.text, + visitReasonStr: _model.dropDownValue1, + visitLevelStr: _model.dropDownValue2, + visitTempStr: + _model.switchValue == true ? 'Sim' : 'Não', + visitObsStr: _model.textController3.text, + visitorStrList: _model.visitorStrList, + visitorJsonList: _model.visitorJsonList, + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), ].addToEnd(const SizedBox(height: 30.0)), ), ); @@ -2367,10 +2183,10 @@ Widget visitHistory( fadeOutDuration: const Duration(milliseconds: 500), imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), fit: BoxFit.cover, From d6a67e54f58d55309e6fce98ba4d5477a8e63034 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 31 Jul 2024 17:43:51 -0300 Subject: [PATCH 29/34] fix: ScheduleCompleteVisitPageModel => ScheduleCompleteVisit --- .../visitor_not_found_component_widget.dart | 256 ++- .../schedule_visit_detail_model.dart | 36 +- .../schedule_visit_detail_widget.dart | 1504 ++++++++--------- ...iter_vistor_template_component_widget.dart | 10 +- ...tails_modal_template_component_widget.dart | 90 +- ...earch_modal_template_component_widget.dart | 20 +- lib/flutter_flow/upload_data.dart | 54 +- .../schedule_complete_visit_page_model.dart | 12 + .../schedule_complete_visit_page_widget.dart | 600 +++---- 9 files changed, 1245 insertions(+), 1337 deletions(-) diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 783d3801..9ffcdc37 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -41,146 +41,138 @@ class _VisitorNotFoundComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - width: 350.0, - height: 350.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + return Container( + width: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.4, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Align( + alignment: const AlignmentDirectional(1.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), + child: FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon( + Icons.close, + color: FlutterFlowTheme.of(context).accent1, + size: 24.0, + ), + onPressed: () async { + Navigator.pop(context); + }, + ), + ), ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Align( - alignment: const AlignmentDirectional(1.0, -1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 5.0, 5.0, 0.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.close, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, + Icon( + Icons.notifications_none, + color: FlutterFlowTheme.of(context).accent1, + size: 72.0, + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + '1p9mykbj' /* Usuário não encontrado */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: + FlutterFlowTheme.of(context).headlineMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), ), - onPressed: () async { - Navigator.pop(context); - }, - ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 4.0, 20.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'kt937sp6' /* O documento inserido não corre... */, ), - ), - Icon( - Icons.notifications_none, - color: FlutterFlowTheme.of(context).accent1, - size: 72.0, - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '1p9mykbj' /* Usuário não encontrado */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: - FlutterFlowTheme.of(context).headlineMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).headlineMediumFamily), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(10.0, 4.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'kt937sp6' /* O documento inserido não corre... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontStyle: FontStyle.italic, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - ), - ), - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: FFButtonWidget( - onPressed: () async { - Navigator.pop(context); - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: true, - useSafeArea: true, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: SizedBox( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.9, - child: - const RegisiterVistorTemplateComponentWidget( - source: 'VisitorNotFoundComponent', - )), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFLocalizations.of(context).getText( - 'y2x4nfcn' /* Adicionar */, + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontStyle: FontStyle.italic, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - options: FFButtonOptions( - width: double.infinity, - height: 30.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, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), + ), + ), + Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: FFButtonWidget( + onPressed: () async { + Navigator.pop(context); + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: true, + useSafeArea: true, + isDismissible: true, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: SizedBox( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.9, + child: const RegisiterVistorTemplateComponentWidget( + source: 'VisitorNotFoundComponent', + )), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), + options: FFButtonOptions( + width: double.infinity, + height: 30.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, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), ), ), ), ), - ], - ), + ), + ], ), ); } diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index 39705ca6..d4df4084 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,9 +1,11 @@ -import 'package:hub/backend/api_requests/api_manager.dart'; +import 'dart:developer'; +import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:intl/intl.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -36,6 +38,36 @@ class ScheduleVisitDetailModel // Stores action output result for [Backend Call - API (postScheduleVisit)] action in Icon widget. ApiCallResponse? postScheduleVisit; + String convertDateFormat(String dateStr) { + try { + log('Received date string: $dateStr'); + + // Formato original + DateFormat originalFormat = DateFormat('d/M/y H:mm:ss'); + // Novo formato + DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); + + // Validate the input string format + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { + log('Invalid date format: $dateStr'); + return 'Invalid date format'; + } + + // Converte a string para DateTime + DateTime dateTime = originalFormat.parse(dateStr); + + // Converte DateTime para a nova string formatada + String formattedDate = newFormat.format(dateTime); + log('Formatted date: $formattedDate'); + return formattedDate; + } catch (e) { + // Handle the exception by returning an error message or a default value + log('Error parsing date: $e'); + return 'Invalid date format'; + } + } + @override void initState(BuildContext context) {} @@ -59,4 +91,4 @@ class ScheduleVisitDetailModel textFieldFocusNode6?.dispose(); textController6?.dispose(); } -} \ No newline at end of file +} diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index ad430d41..150dd715 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -13,6 +13,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_model.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:provider/provider.dart'; class ScheduleVisitDetailWidget extends StatefulWidget { @@ -46,6 +47,7 @@ class ScheduleVisitDetailWidget extends StatefulWidget { class _ScheduleVisitDetailWidgetState extends State { late ScheduleVisitDetailModel _model; + late FocusNode _focusNode; @override void setState(VoidCallback callback) { @@ -56,6 +58,7 @@ class _ScheduleVisitDetailWidgetState extends State { @override void initState() { super.initState(); + _focusNode = FocusNode(); _model = createModel(context, () => ScheduleVisitDetailModel()); _model.textController1 ??= TextEditingController(text: widget.visitTempStr); @@ -83,39 +86,51 @@ class _ScheduleVisitDetailWidgetState extends State { @override void dispose() { _model.maybeDispose(); + _focusNode.dispose(); super.dispose(); } + void _requestFocus() { + if (mounted) { + _focusNode.requestFocus(); + } + } + @override Widget build(BuildContext context) { context.watch(); + final visitorsData = widget.visitorJsonList!.toList().take(2).toList(); + final visitorsDataItem = visitorsData[0]; return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(25.0), - topRight: Radius.circular(25.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + child: GestureDetector( + onTap: () { + _requestFocus(); + }, + child: Container( + // color: FlutterFlowTheme.of(context).primaryBackground, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.6, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(25.0), + bottomRight: Radius.circular(25.0), + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( width: double.infinity, height: 35.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(0.0), bottomRight: Radius.circular(0.0), @@ -137,7 +152,7 @@ class _ScheduleVisitDetailWidgetState extends State { buttonSize: 40.0, icon: Icon( Icons.keyboard_return, - color: FlutterFlowTheme.of(context).primaryBackground, + color: FlutterFlowTheme.of(context).accent1, size: 24.0, ), onPressed: () async { @@ -148,842 +163,681 @@ class _ScheduleVisitDetailWidgetState extends State { ), ), ), - ), - Container( - decoration: const BoxDecoration( - shape: BoxShape.rectangle, - ), - child: Stack( + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 20.0), + child: SizedBox( + width: 100.0, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorsDataItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + width: 100.0, + height: 100.0, + fit: BoxFit.cover, + ), + ), + ), + ), Column( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, children: [ - Align( - alignment: const AlignmentDirectional(0.0, -1.0), + Container( + decoration: const BoxDecoration(), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 5.0, 0.0, 5.0, 20.0), - child: Container( - width: 100.0, - decoration: const BoxDecoration(), - child: Builder( - builder: (context) { - final visitorsData = widget.visitorJsonList! - .toList() - .take(1) - .toList(); - - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(visitorsData.length, - (visitorsDataIndex) { - final visitorsDataItem = - visitorsData[visitorsDataIndex]; - return Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(100.0), - ), - child: Align( - alignment: const AlignmentDirectional( - 1.0, -1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - // Navigator.pop(context); - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: - // Colors.transparent, - // useSafeArea: true, - // context: context, - // builder: (context) { - // return Padding( - // padding: - // MediaQuery.viewInsetsOf( - // context), - // child: - // VisitorDetailsModalTemplateComponentWidget( - // visitorImageURL: '', - // visitorEmail: '', - // visitorName: '', - // visitorPhone: '', - // visitorType: '', - // ), - // ); - // }, - // ).then((value) => - // safeSetState(() {})); - }, - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 500), - fadeOutDuration: const Duration( - milliseconds: 500), - imageUrl: - valueOrDefault( - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorsDataItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - width: 100.0, - height: 100.0, - fit: BoxFit.cover, - ), - ), - ), - ), - ); - }), + 8.0, 0.0, 8.0, 10.0), + child: TextFormField( + controller: _model.textController1, + focusNode: _model.textFieldFocusNode1, + autofocus: false, + readOnly: true, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '7w4fohoa' /* Encerramento da Visita */, + ), + 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), ), - ); - }, + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController1Validator + .asValidator(context), ), ), ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 10.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context).getText( - '7w4fohoa' /* Encerramento da Visita */, - ), - 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), - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController2, + focusNode: _model.textFieldFocusNode2, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context) + .getVariableText( + enText: 'Start', + ptText: 'Início', ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '0cp1e31d' /* dd/mm/yyyy */, ), - validator: _model.textController1Validator - .asValidator(context), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController2Validator + .asValidator(context), + ), ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'snah4iet' /* Início */, - ), - 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), - ), - hintText: - FFLocalizations.of(context).getText( - '0cp1e31d' /* dd/mm/yyyy */, - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController2Validator - .asValidator(context), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController3, + focusNode: _model.textFieldFocusNode3, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'abppdgz3' /* Término */, ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'abppdgz3' /* Término */, - ), - 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), - ), - hintText: - FFLocalizations.of(context).getText( - 'kqralft4' /* dd/mm/yyyy */, - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController3Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 10.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController4, - focusNode: _model.textFieldFocusNode4, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'xjxhzqqm' /* Motivo da Visita */, - ), - 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), - ), - hintText: - FFLocalizations.of(context).getText( - '47oezdm6' /* Motivo */, - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController4Validator - .asValidator(context), - ), - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController5, - focusNode: _model.textFieldFocusNode5, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - '2ujg7u18' /* Nível de Acesso */, - ), - 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), - ), - hintText: - FFLocalizations.of(context).getText( - '3emmbbfv' /* Nível de Acesso */, - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController5Validator - .asValidator(context), - ), - ), - ), - ], - ), - ), - Container( - decoration: const BoxDecoration(), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController6, - focusNode: _model.textFieldFocusNode6, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context).getText( - 'ritce5uw' /* Observações da Visita */, - ), - 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), - ), - 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), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent1, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily), + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + 'kqralft4' /* dd/mm/yyyy */, ), - validator: _model.textController6Validator - .asValidator(context), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontSize: 12, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController3Validator + .asValidator(context), + ), ), ), - ), - ], + ], + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController4, + focusNode: _model.textFieldFocusNode4, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + 'xjxhzqqm' /* Motivo da Visita */, + ), + 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), + ), + hintText: + FFLocalizations.of(context).getText( + '47oezdm6' /* Motivo */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController4Validator + .asValidator(context), + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController5, + focusNode: _model.textFieldFocusNode5, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of(context).getText( + '2ujg7u18' /* Nível de Acesso */, + ), + 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), + ), + hintText: + FFLocalizations.of(context).getText( + '3emmbbfv' /* Nível de Acesso */, + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model.textController5Validator + .asValidator(context), + ), + ), + ), + ], + ), ), Container( - width: double.infinity, - height: 22.0, - decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).secondaryBackground, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(25.0), - bottomRight: Radius.circular(25.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), + decoration: const BoxDecoration(), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController6, + focusNode: _model.textFieldFocusNode6, + autofocus: false, + obscureText: false, + readOnly: true, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + 'ritce5uw' /* Observações da Visita */, + ), + 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), + ), + 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), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + validator: _model.textController6Validator + .asValidator(context), ), ), ), - ] - .divide(const SizedBox(height: 30.0)) - .addToStart(const SizedBox(height: 100.0)), + ], ), - ], + ].divide(const SizedBox(height: 0.0)), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 6.0, 0.0, 0.0), - child: Container( - width: double.infinity, - height: 35.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(0.0), - bottomRight: Radius.circular(0.0), - topLeft: Radius.circular(0.0), - topRight: Radius.circular(0.0), - ), - ), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.postScheduleVisit = - await PhpGroup.postScheduleVisitCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - atividade: 'putVisita', - devDesc: widget.visitObsStr, - idVisitante: widget.visitorStrList, - dtInicio: widget.visitStartDate, - dtFim: widget.visitEndDate, - unica: widget.visitTempStr, - idMotivo: extractIdToStr(widget.visitResonStr!), - idNAC: extractIdToStr(widget.visitLevelStr!), - obs: widget.visitObsStr, - cliID: FFAppState().cliUUID, - ); + IconButton( + onPressed: () async { + _model.postScheduleVisit = + await PhpGroup.postScheduleVisitCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + atividade: 'putVisita', + devDesc: widget.visitObsStr, + idVisitante: widget.visitorStrList, + dtInicio: + _model.convertDateFormat(widget.visitStartDate ?? ''), + dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''), + unica: widget.visitTempStr, + idMotivo: extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), + obs: widget.visitObsStr, + cliID: FFAppState().cliUUID, + ); - if (PhpGroup.postScheduleVisitCall.error( - (_model.postScheduleVisit?.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.postScheduleVisitCall.errorMsg( - (_model.postScheduleVisit?.jsonBody ?? ''), - )!, - ), - ); - }, - ).then((value) => safeSetState(() {})); - } + if (PhpGroup.postScheduleVisitCall.error( + (_model.postScheduleVisit?.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup.postScheduleVisitCall.errorMsg( + (_model.postScheduleVisit?.jsonBody ?? ''), + )!, + ), + ); + }, + ).then((value) => safeSetState(() {})); + } - setState(() {}); - }, - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).secondaryText, - size: 24.0, - ), - ), + setState(() {}); + }, + icon: Icon( + Icons.check, + color: FlutterFlowTheme.of(context).primary, + size: 15.0, ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index b47c79ee..9e187e31 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -485,9 +485,9 @@ class _RegisiterVistorTemplateComponentWidgetState final selectedMedia = await selectMediaWithSourceBottomSheet( context: context, - maxWidth: 300.00, - maxHeight: 300.00, - imageQuality: 0, + // maxWidth: 300.00, + // maxHeight: 300.00, + imageQuality: 100, allowPhoto: true, includeDimensions: true, ); @@ -567,7 +567,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent1, - width: 0.5, + width: 0.2, ), borderRadius: BorderRadius.circular(8.0), ), @@ -915,7 +915,7 @@ class _RegisiterVistorTemplateComponentWidgetState options: FFButtonOptions( width: 250.0, height: 36.0, - disabledColor: FlutterFlowTheme.of(context).customColor6, + disabledColor: FlutterFlowTheme.of(context).customColor5, padding: const EdgeInsetsDirectional.fromSTEB( 80.0, 0.0, 80.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index 8a9309f9..a5e922e8 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,6 +1,3 @@ - - - import 'package:flutter/material.dart'; import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; import 'package:hub/components/templates_components/view_visit_detail/view_visit_detail_widget.dart'; @@ -74,50 +71,47 @@ class _VisitDetailsModalTemplateComponentWidgetState @override Widget build(BuildContext context) { - return Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Builder( - builder: (context) { - if (widget.visitStatusStr != null && widget.visitStatusStr != '') { - return wrapWithModel( - model: _model.viewVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ViewVisitDetailWidget( - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitReasonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitStatusStr: widget.visitStatusStr!, - visitorStrList: widget.visitorStrList!, - visitorJsonList: widget.visitorJsonList, - visitIdStr: widget.visitIdStr!, - visitStatusColor: widget.visitStatusColor!, - ), - ); - } else { - return wrapWithModel( - model: _model.scheduleVisitDetailModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: ScheduleVisitDetailWidget( - visitorStrList: widget.visitorStrList!, - visitorImgPath: widget.visitorImgPath, - visitStartDate: widget.visitStartDateStr!, - visitEndDate: widget.visitEndDateStr!, - visitResonStr: widget.visitReasonStr!, - visitLevelStr: widget.visitLevelStr!, - visitTempStr: widget.visitTempStr!, - visitObsStr: widget.visitObsStr!, - visitorJsonList: widget.visitorJsonList!, - ), - ); - } - }, - ), + return Builder( + builder: (context) { + if (widget.visitStatusStr != null && widget.visitStatusStr != '') { + return wrapWithModel( + model: _model.viewVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ViewVisitDetailWidget( + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitReasonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitStatusStr: widget.visitStatusStr!, + visitorStrList: widget.visitorStrList!, + visitorJsonList: widget.visitorJsonList, + visitIdStr: widget.visitIdStr!, + visitStatusColor: widget.visitStatusColor!, + ), + ); + } else { + return wrapWithModel( + model: _model.scheduleVisitDetailModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: ScheduleVisitDetailWidget( + visitorStrList: widget.visitorStrList!, + visitorImgPath: widget.visitorImgPath, + visitStartDate: widget.visitStartDateStr!, + visitEndDate: widget.visitEndDateStr!, + visitResonStr: widget.visitReasonStr!, + visitLevelStr: widget.visitLevelStr!, + visitTempStr: widget.visitTempStr!, + visitObsStr: widget.visitObsStr!, + visitorJsonList: widget.visitorJsonList!, + ), + ); + } + }, ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 35b21ac6..963676a9 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -109,16 +109,20 @@ class _VisitorSearchModalTemplateComponentWidgetState _model.addToDocs(_model.textController.text); setState(() {}); } else { - await showModalBottomSheet( - isScrollControlled: true, - enableDrag: true, - isDismissible: true, - backgroundColor: Colors.transparent, + await showAdaptiveDialog( + useSafeArea: true, context: context, builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const VisitorNotFoundComponentWidget(), + return Dialog( + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: Container( + color: Colors.transparent, + // width: MediaQuery.of(context).size.height * 0.1, + // height: + // MediaQuery.of(context).size.height * 0.4, + child: const VisitorNotFoundComponentWidget()), + ), ); }, ).then((value) => safeSetState(() {})); diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 917034cd..c7c4c597 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -58,23 +58,23 @@ Future?> selectMediaWithSourceBottomSheet({ bool includeBlurHash = false, }) async { createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontWeight: FontWeight.w600, - fontSize: 20, - ), - ), - tileColor: FlutterFlowTheme.of(context).primaryBackground, - dense: false, - onTap: () => Navigator.pop( - context, - mediaSource, - ), - ); + title: Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 20, + ), + ), + tileColor: FlutterFlowTheme.of(context).primaryBackground, + dense: false, + onTap: () => Navigator.pop( + context, + mediaSource, + ), + ); final mediaSource = await showModalBottomSheet( context: context, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -91,7 +91,9 @@ Future?> selectMediaWithSourceBottomSheet({ textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 20, ), @@ -360,18 +362,26 @@ void showUploadMessage( child: CircularProgressIndicator( valueColor: Theme.of(context).brightness == Brightness.dark ? AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).accent4) + FlutterFlowTheme.of(context).info) : null, ), ), - Text(message), + Text(message, style: FlutterFlowTheme.of(context).bodyMedium), ], ), - duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4), + backgroundColor: FlutterFlowTheme.of(context).primary, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + ), + duration: + showLoading ? const Duration(days: 1) : const Duration(seconds: 4), ), ); } String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/') ? path.substring(0, path.length - 1) - : path; \ No newline at end of file + : path; 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 d1ea6e19..23a7f0d0 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 @@ -83,6 +83,12 @@ class ScheduleCompleteVisitPageModel enText: 'Start date must be before end date.', ); } + if (startDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'Start date must be after current date.', + ptText: 'A data de início deve ser posterior à data atual.', + ); + } } catch (e) { return '$e'; } @@ -113,6 +119,12 @@ class ScheduleCompleteVisitPageModel ptText: 'A data de término deve ser posterior à data de início.', ); } + if (endDate.isBefore(DateTime.now())) { + return FFLocalizations.of(context).getVariableText( + enText: 'End date must be after current date.', + ptText: 'A data de término deve ser posterior à data atual.', + ); + } } catch (e) { return '$e'; } 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 868ba7a8..20874759 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 @@ -269,300 +269,12 @@ Widget scheduleVisit( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (_model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - _model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - // await showModalBottomSheet( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, - // context: context, - // builder: (context) { - // return GestureDetector( - // onTap: () => _model - // .unfocusNode.canRequestFocus - // ? FocusScope.of(context) - // .requestFocus(_model.unfocusNode) - // : FocusScope.of(context).unfocus(), - // child: Padding( - // padding: - // MediaQuery.viewInsetsOf(context), - // child: - // const VisitorDetailsModalTemplateComponentWidget( - // visitorImageURL: '', - // visitorEmail: '', - // visitorName: '', - // visitorPhone: '', - // visitorType: '', - // ), - // ), - // ); - // }, - // ).then((value) => safeSetState(() {})); - }, - onLongPress: () async { - // _model.removeFromVisitorJsonList( - // visitorListViewItem); - // setState(() {}); - }, - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorListViewItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - fit: BoxFit.cover, - ), - ), - Text( - getJsonField( - visitorListViewItem, - r'''$.VTE_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - Expanded( - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - IconButton( - onPressed: () async { - _model - .removeFromVisitorJsonList( - visitorListViewItem); - setState(() {}); - }, - icon: const Icon(Icons.close)), - ], - ), - ), - ] - .divide(const SizedBox(width: 30.0)) - .addToStart(const SizedBox(width: 30.0)), - ), - ), - ); - }, - ); - }, - ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.9, - width: MediaQuery.of(context).size.width, - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - _model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - setState(() {}); - }, - getDocs: (docsParam) async { - _model.visitorStrList = - strListToStr( - docsParam!.toList()); - setState(() {}); - }, - ), - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 1.0, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz' /* Clique para adicionar um visit... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), - ), - ], - ), - ], - ), Column(mainAxisSize: MainAxisSize.max, children: [ Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), + 20.0, 30.0, 0.0, 24.0), child: Text( FFLocalizations.of(context).getText( '98evnbbe' /* Qual o período de validade da ... */, @@ -1079,6 +791,294 @@ Widget scheduleVisit( ] // .divide(const SizedBox(height: 0.0)), ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e' /* Quais visitantes você deseja c... */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + if (_model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + _model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + // await showModalBottomSheet( + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // enableDrag: false, + // context: context, + // builder: (context) { + // return GestureDetector( + // onTap: () => _model + // .unfocusNode.canRequestFocus + // ? FocusScope.of(context) + // .requestFocus(_model.unfocusNode) + // : FocusScope.of(context).unfocus(), + // child: Padding( + // padding: + // MediaQuery.viewInsetsOf(context), + // child: + // const VisitorDetailsModalTemplateComponentWidget( + // visitorImageURL: '', + // visitorEmail: '', + // visitorName: '', + // visitorPhone: '', + // visitorType: '', + // ), + // ), + // ); + // }, + // ).then((value) => safeSetState(() {})); + }, + onLongPress: () async { + // _model.removeFromVisitorJsonList( + // visitorListViewItem); + // setState(() {}); + }, + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorListViewItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + fit: BoxFit.cover, + ), + ), + Text( + getJsonField( + visitorListViewItem, + r'''$.VTE_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + Expanded( + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + IconButton( + onPressed: () async { + _model + .removeFromVisitorJsonList( + visitorListViewItem); + setState(() {}); + }, + icon: const Icon(Icons.close)), + ], + ), + ), + ] + .divide(const SizedBox(width: 30.0)) + .addToStart(const SizedBox(width: 30.0)), + ), + ), + ); + }, + ); + }, + ), + Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.01, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), + child: FFButtonWidget( + onPressed: () async { + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model + .unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: + MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + _model.visitorJsonList = + visitorsParam! + .toList() + .cast(); + setState(() {}); + }, + getDocs: (docsParam) async { + _model.visitorStrList = + strListToStr( + docsParam!.toList()); + setState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + text: '', + icon: Icon( + Icons.add, + color: FlutterFlowTheme.of(context).primary, + size: 30.0, + ), + options: FFButtonOptions( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 80.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context) + .primaryBackground, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 50.0, 0.0, 0.0), + child: Container( + width: MediaQuery.sizeOf(context).width * 0.8, + height: 20.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: AutoSizeText( + FFLocalizations.of(context).getText( + 'r8soavtz' /* Clique para adicionar um visit... */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), Column( mainAxisSize: MainAxisSize.max, children: [ @@ -1146,6 +1146,8 @@ Widget scheduleVisit( dropDownGetDadosResponse.jsonBody, ); return FlutterFlowDropDown( + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, controller: _model.dropDownValueController1 ??= FormFieldController( @@ -1326,6 +1328,8 @@ Widget scheduleVisit( const EdgeInsetsDirectional.fromSTEB( 16.0, 0.0, 16.0, 0.0), hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, isOverButton: true, isSearchable: false, isMultiSelect: false, @@ -1602,13 +1606,13 @@ Widget scheduleVisit( ), ), FFButtonWidget( - text: 'Schedule', + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), onPressed: _model.isValid() ? () async { await showDialog( - // isScrollControlled: true, - // backgroundColor: Colors.transparent, - // enableDrag: false, context: context, builder: (context) { return GestureDetector( @@ -1619,8 +1623,8 @@ Widget scheduleVisit( child: Dialog( alignment: Alignment.topCenter, child: SizedBox( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.5, + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height * 0.7, child: VisitDetailsModalTemplateComponentWidget( visitStartDateStr: _model.textController1.text, visitEndDateStr: _model.textController2.text, @@ -1645,6 +1649,12 @@ Widget scheduleVisit( height: MediaQuery.of(context).size.height * 0.05, width: MediaQuery.of(context).size.height * 0.2, color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), disabledColor: FlutterFlowTheme.of(context).customColor5), showLoadingIndicator: true, ), From 0acf60b23bfeccfd8f8c301bcc8a3452448520a4 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 2 Aug 2024 08:18:31 -0300 Subject: [PATCH 30/34] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20Atomo=20de=20Imag?= =?UTF-8?q?em=20e=20corre=C3=A7=C3=A3o=20de=20tradu=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/dark/register.svg | 29 +++++++ assets/images/light/register.svg | 35 +++++++++ .../sign_up_template_component_widget.dart | 75 +++++++++++-------- lib/flutter_flow/internationalization.dart | 2 +- 4 files changed, 107 insertions(+), 34 deletions(-) create mode 100644 assets/images/dark/register.svg create mode 100644 assets/images/light/register.svg diff --git a/assets/images/dark/register.svg b/assets/images/dark/register.svg new file mode 100644 index 00000000..5e7071f7 --- /dev/null +++ b/assets/images/dark/register.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/register.svg b/assets/images/light/register.svg new file mode 100644 index 00000000..2fecef14 --- /dev/null +++ b/assets/images/light/register.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index 0d5327b0..c009341f 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; + import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -17,7 +19,6 @@ class SignUpTemplateComponentWidget extends StatefulWidget { super.key, required this.toggleSignInPage, }); - final Future Function()? toggleSignInPage; @override @@ -98,6 +99,8 @@ class _SignUpTemplateComponentWidgetState @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; context.watch(); return Row( @@ -135,7 +138,8 @@ class _SignUpTemplateComponentWidgetState children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), + alignment: + const AlignmentDirectional(0.0, -1.0), child: Padding( padding: const EdgeInsets.all(4.0), child: Text( @@ -149,7 +153,7 @@ class _SignUpTemplateComponentWidgetState fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context) .primaryText, - fontSize: 24.0, + fontSize: screenWidth * 0.06, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -171,11 +175,10 @@ class _SignUpTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/ug2zlyhca2sh/Frame_5.svg', - width: 603.0, - height: 155.0, - fit: BoxFit.contain, + child: const AtomImageSvgTheme( + filename: 'register', + width: 600, + height: 155, ), ), ), @@ -208,13 +211,14 @@ class _SignUpTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.disabled, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -356,8 +360,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -499,8 +504,9 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( + padding: + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, @@ -564,7 +570,8 @@ class _SignUpTemplateComponentWidgetState ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFF1AAB5F), width: 0.25, @@ -575,7 +582,8 @@ class _SignUpTemplateComponentWidgetState ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -586,7 +594,8 @@ class _SignUpTemplateComponentWidgetState ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( + borderSide: + const BorderSide( color: Color(0xFFFF5963), width: 0.25, @@ -652,25 +661,25 @@ class _SignUpTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model.nameRegisterFormTextController - .text != - '') || + onPressed: (((_model + .nameRegisterFormTextController.text != + '') || ((_model.nameRegisterFormFocusNode?.hasFocus ?? false) != null)) && ((_model.emailRegisterFormTextController - .text != - '') || + .text != + '') || ((_model.emailRegisterFormFocusNode ?.hasFocus ?? false) != null)) && ((_model.passwordRegisterFormTextController - .text != - '') || + .text != + '') || ((_model.passwordRegisterFormFocusNode ?.hasFocus ?? false) != @@ -716,11 +725,11 @@ class _SignUpTemplateComponentWidgetState 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( + const EdgeInsetsDirectional + .fromSTEB( 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context) .accent1, @@ -755,8 +764,8 @@ class _SignUpTemplateComponentWidgetState // You will have to add an action on this rich text to go to your login page. 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( splashColor: Colors.transparent, focusColor: Colors.transparent, diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 9123791e..3540b759 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -1286,4 +1286,4 @@ final kTranslationsMap = >>[ 'en': 'Block completed', }, }, -].reduce((a, b) => a..addAll(b)); \ No newline at end of file +].reduce((a, b) => a..addAll(b)); From 08a8538be56a78ef67afc360753e1ec34d61989e Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:22:05 +0000 Subject: [PATCH 31/34] =?UTF-8?q?Ajuste=20na=20tradu=C3=A7=C3=A3o=20da=20T?= =?UTF-8?q?ela=20de=20Registro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 8 +- .../sign_up_template_component_model.dart | 13 ++- .../sign_up_template_component_widget.dart | 2 - lib/flutter_flow/flutter_flow_drop_down.dart | 98 +++++++++---------- lib/flutter_flow/internationalization.dart | 8 ++ 5 files changed, 68 insertions(+), 61 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 4ab490b9..e089766f 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409727A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409027A31CD400820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409227A31CD800820AF7 /* pt */, - 6436409127A31CDB00820AF7 /* en */, + 6436409727A31CDC00820AF7 /* pt */, + 6436409027A31CD400820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart index bbcd4725..370ff262 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart @@ -21,9 +21,6 @@ class SignUpTemplateComponentModel ); } - if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { - return 'Must start with a letter and can only contain letters, digits and - or _.'; - } return null; } @@ -41,7 +38,9 @@ class SignUpTemplateComponentModel } if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { - return 'Has to be a valid email address.'; + return FFLocalizations.of(context).getText( + 'vobnktrz' /* Insira um email valido. */, + ); } return null; } @@ -60,6 +59,12 @@ class SignUpTemplateComponentModel ); } + if (val.length < 8) { + return FFLocalizations.of(context).getText( + 'duq5gpp6' /* A senha deve ter pelo menos 8 ... */, + ); + } + return null; } diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index 0d5327b0..7be3e6f7 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -347,8 +347,6 @@ class _SignUpTemplateComponentWidgetState .containsKey( 'Plus Jakarta Sans'), ), - keyboardType: - TextInputType.name, validator: _model .nameRegisterFormTextControllerValidator .asValidator(context), diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart index 0e7bc61c..9a784270 100644 --- a/lib/flutter_flow/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -212,12 +212,11 @@ class _FlutterFlowDropDownState extends State> { List> _createMenuItems() => widget.options .map( (option) => DropdownMenuItem( - value: option, - child: Padding( - padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, - child: Text(optionLabels[option] ?? '', style: widget.textStyle), - ), - ), + value: option, + child: Padding( + padding: _useDropdown2() ? horizontalMargin : EdgeInsets.zero, + child: Text(optionLabels[option] ?? '', style: widget.textStyle), + )), ) .toList(); @@ -232,37 +231,36 @@ class _FlutterFlowDropDownState extends State> { final isSelected = multiSelectController.value?.contains(item) ?? false; return InkWell( - onTap: () { - multiSelectController.value ??= []; - isSelected - ? multiSelectController.value!.remove(item) - : multiSelectController.value!.add(item); - multiSelectController.update(); - // This rebuilds the StatefulWidget to update the button's text. - setState(() {}); - // This rebuilds the dropdownMenu Widget to update the check mark. - menuSetState(() {}); - }, - child: Container( - height: double.infinity, - padding: horizontalMargin, - child: Row( - children: [ - if (isSelected) - const Icon(Icons.check_box_outlined) - else - const Icon(Icons.check_box_outline_blank), - const SizedBox(width: 16), - Expanded( - child: Text( - optionLabels[item]!, - style: widget.textStyle, + onTap: () { + multiSelectController.value ??= []; + isSelected + ? multiSelectController.value!.remove(item) + : multiSelectController.value!.add(item); + multiSelectController.update(); + // This rebuilds the StatefulWidget to update the button's text. + setState(() {}); + // This rebuilds the dropdownMenu Widget to update the check mark. + menuSetState(() {}); + }, + child: Container( + height: double.infinity, + padding: horizontalMargin, + child: Row( + children: [ + if (isSelected) + const Icon(Icons.check_box_outlined) + else + const Icon(Icons.check_box_outline_blank), + const SizedBox(width: 16), + Expanded( + child: Text( + optionLabels[item]!, + style: widget.textStyle, + ), ), - ), - ], - ), - ), - ); + ], + ), + )); }, ), ), @@ -305,21 +303,19 @@ class _FlutterFlowDropDownState extends State> { : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val), isExpanded: true, selectedItemBuilder: (context) => widget.options - .map( - (item) => Align( - alignment: AlignmentDirectional.centerStart, - child: Text( - isMultiSelect - ? currentValues - .where((v) => optionLabels.containsKey(v)) - .map((v) => optionLabels[v]) - .join(', ') - : optionLabels[item]!, - style: widget.textStyle, - maxLines: 1, - ), - ), - ) + .map((item) => Align( + alignment: AlignmentDirectional.centerStart, + child: Text( + isMultiSelect + ? currentValues + .where((v) => optionLabels.containsKey(v)) + .map((v) => optionLabels[v]) + .join(', ') + : optionLabels[item]!, + style: widget.textStyle, + maxLines: 1, + ), + )) .toList(), dropdownSearchData: widget.isSearchable ? DropdownSearchData( diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index fd3f7663..f27adf85 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -933,6 +933,10 @@ final kTranslationsMap = >>[ 'pt': 'Campo é necessário', 'en': 'Field is required', }, + 'vobnktrz': { + 'pt': 'Insira um email valido.', + 'en': '', + }, 'z0bv6wi2': { 'pt': 'Please choose an option from the dropdown', 'en': '', @@ -941,6 +945,10 @@ final kTranslationsMap = >>[ 'pt': 'Campo é necessário', 'en': 'Field is required', }, + 'duq5gpp6': { + 'pt': 'A senha deve ter pelo menos 8 caracteres.', + 'en': '', + }, 'rcikqhf1': { 'pt': 'Please choose an option from the dropdown', 'en': '', From 2f7544193902e0a71617999da83cf9b200a36f23 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 2 Aug 2024 11:21:34 -0300 Subject: [PATCH 32/34] =?UTF-8?q?Corre=C3=A7=C3=A3o=20do=20modal=20de=20er?= =?UTF-8?q?ro;=20Corre=C3=A7=C3=A3o=20no=20validator;=20Adi=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20Tradu=C3=A7=C3=A3o=20nos=20Modais;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/actions/actions.dart | 15 +++-- .../sign_up_template_component_widget.dart | 62 +++++++++---------- lib/flutter_flow/internationalization.dart | 12 ++-- lib/shared/utils/validator_util.dart | 11 +++- 4 files changed, 53 insertions(+), 47 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 987a4a53..eaa81103 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -203,7 +203,7 @@ Future signUpRegisterAction( ApiCallResponse? registerCall; if ((email != null && email != '') && - (passwd != null && passwd != '') && + (passwd != null && passwd != '' && passwd.length > 7) && (name != null && name != '')) { registerCall = await PhpGroup.registerCall.call( name: name, @@ -239,17 +239,22 @@ Future signUpRegisterAction( false) { return true; } - await showDialog( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('Error'), - content: Text('${registerCall?.jsonBody}'), + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'An error occurred:', ptText: 'Ocorreu um erro:'), + ), + content: Text(registerCall?.jsonBody['error_msg']), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR2 '), + child: Text( + FFLocalizations.of(context) + .getVariableText(enText: 'Close', ptText: 'Fechar'), + ), ), ], ); diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index f5b3c1d3..a7ac2727 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -1,4 +1,6 @@ import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/validator_util.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -101,6 +103,26 @@ class _SignUpTemplateComponentWidgetState Widget build(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; double screenHeight = MediaQuery.of(context).size.height; + bool _isFormInvalid() { + if (_model.nameRegisterFormTextController.text == '' || + _model.emailRegisterFormTextController.text == '' || + _model.passwordRegisterFormTextController.text == '') { + return true; + } + + if (!ValidatorUtil.isValidEmail( + _model.emailRegisterFormTextController.text)) { + return true; + } + + if (!ValidatorUtil.isValidPassword( + _model.passwordRegisterFormTextController.text)) { + return true; + } + + return false; + } + context.watch(); return Row( @@ -662,26 +684,7 @@ class _SignUpTemplateComponentWidgetState padding: const EdgeInsetsDirectional .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: (((_model - .nameRegisterFormTextController.text != - '') || - ((_model.nameRegisterFormFocusNode?.hasFocus ?? - false) != - null)) && - ((_model.emailRegisterFormTextController - .text != - '') || - ((_model.emailRegisterFormFocusNode - ?.hasFocus ?? - false) != - null)) && - ((_model.passwordRegisterFormTextController - .text != - '') || - ((_model.passwordRegisterFormFocusNode - ?.hasFocus ?? - false) != - null))) + onPressed: _isFormInvalid() ? null : () async { var shouldSetState = false; @@ -755,6 +758,10 @@ class _SignUpTemplateComponentWidgetState ), borderRadius: BorderRadius.circular(12.0), + disabledColor: + FlutterFlowTheme.of(context) + .customColor5, + disabledTextColor: Colors.white, ), showLoadingIndicator: false, ), @@ -837,6 +844,7 @@ class _SignUpTemplateComponentWidgetState ), ), ), + const AtomTermsOfUse(), ], ), ), @@ -847,20 +855,6 @@ class _SignUpTemplateComponentWidgetState ), ], ), - Text( - FFLocalizations.of(context).getText( - 'huygnka2' /* Termo de Uso */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), ], ), ), diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 39f338a9..21aa8aed 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -952,16 +952,16 @@ final kTranslationsMap = >>[ 'en': 'Password', }, '3bs10dfq': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Nome é Obrigatório', + 'en': 'Name is required', }, 'ph22karc': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, 'mlvw63yj': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'E-mail é Obrigatório', + 'en': 'E-mail is required', }, 'vobnktrz': { 'pt': 'Insira um email valido.', @@ -972,8 +972,8 @@ final kTranslationsMap = >>[ 'en': '', }, '6nn79lmh': { - 'pt': 'Campo é necessário', - 'en': 'Field is required', + 'pt': 'Senha é Obrigatório', + 'en': 'Password is required', }, 'duq5gpp6': { 'pt': 'A senha deve ter pelo menos 8 caracteres.', diff --git a/lib/shared/utils/validator_util.dart b/lib/shared/utils/validator_util.dart index 71e83154..a06591e9 100644 --- a/lib/shared/utils/validator_util.dart +++ b/lib/shared/utils/validator_util.dart @@ -1,5 +1,4 @@ class ValidatorUtil { - static bool isValidEmail(String email) { if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) { return true; @@ -7,4 +6,12 @@ class ValidatorUtil { return false; } } -} \ No newline at end of file + + static bool isValidPassword(String password) { + if (password.length > 7) { + return true; + } else { + return false; + } + } +} From 9f18ed1de98dd112e7630d805a994af84c8c4fd8 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 2 Aug 2024 12:09:29 -0300 Subject: [PATCH 33/34] Trocado os ShowDialog para utilizar o Componente de DialogUtil --- lib/actions/actions.dart | 132 +++++++----------- .../sign_up_template_component_widget.dart | 2 +- 2 files changed, 49 insertions(+), 85 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index eaa81103..d7a4ae22 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -200,92 +200,56 @@ Future signUpRegisterAction( required String? email, String? device, }) async { - ApiCallResponse? registerCall; + try { + ApiCallResponse? registerCall; + if ((email != null && email != '') && + (passwd != null && passwd != '' && passwd.length > 7) && + (name != null && name != '')) { + registerCall = await PhpGroup.registerCall.call( + name: name, + password: passwd, + email: email, + token: randomString( + 36, + 36, + false, + false, + true, + ), + uuid: randomString( + 36, + 36, + false, + false, + true, + ), + tipo: device, + descricao: randomString( + 36, + 36, + true, + false, + false, + ), + ); - if ((email != null && email != '') && - (passwd != null && passwd != '' && passwd.length > 7) && - (name != null && name != '')) { - registerCall = await PhpGroup.registerCall.call( - name: name, - password: passwd, - email: email, - token: randomString( - 36, - 36, - false, - false, - true, - ), - uuid: randomString( - 36, - 36, - false, - false, - true, - ), - tipo: device, - descricao: randomString( - 36, - 36, - true, - false, - false, - ), - ); - - if (PhpGroup.registerCall.error( - (registerCall.jsonBody ?? ''), - ) == - false) { - return true; + if (PhpGroup.registerCall.error( + (registerCall.jsonBody ?? ''), + ) == + false) { + return true; + } + final errorMessage = registerCall?.jsonBody['error_msg']; + DialogUtil.error(context, errorMessage); + return false; + } else { + DialogUtil.errorDefault(context); + return false; } - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: Text( - FFLocalizations.of(context).getVariableText( - enText: 'An error occurred:', ptText: 'Ocorreu um erro:'), - ), - content: Text(registerCall?.jsonBody['error_msg']), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: Text( - FFLocalizations.of(context) - .getVariableText(enText: 'Close', ptText: 'Fechar'), - ), - ), - ], - ); - }, - ); - return false; - } else { - await showDialog( - context: context, - builder: (alertDialogContext) { - return AlertDialog( - title: Text(FFLocalizations.of(context).getVariableText( - enText: 'Error', - ptText: 'Erro', - )), - content: Text(FFLocalizations.of(context).getVariableText( - enText: 'Please fill in all fields', - ptText: 'Por favor, preencha todos os campos', - )), - actions: [ - TextButton( - onPressed: () => Navigator.pop(alertDialogContext), - child: Text(FFLocalizations.of(context).getVariableText( - ptText: 'Fechar', - enText: 'Close', - )), - ), - ], - ); - }, - ); + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed( + 'registro.php', email.toString(), "Register", e, s); return false; } } diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index a7ac2727..8b0eac27 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -763,7 +763,7 @@ class _SignUpTemplateComponentWidgetState .customColor5, disabledTextColor: Colors.white, ), - showLoadingIndicator: false, + showLoadingIndicator: true, ), ), From ae4684ed75c1659953fd3714de2b4248e3245c3a Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 2 Aug 2024 12:26:24 -0300 Subject: [PATCH 34/34] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20Tradu=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/flutter_flow/internationalization.dart | 8 ++++---- lib/shared/utils/validator_util.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 21aa8aed..ca57ae4a 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -964,8 +964,8 @@ final kTranslationsMap = >>[ 'en': 'E-mail is required', }, 'vobnktrz': { - 'pt': 'Insira um email valido.', - 'en': '', + 'pt': 'E-mail Inválido.', + 'en': 'Invalid E-mail', }, 'z0bv6wi2': { 'pt': 'Please choose an option from the dropdown', @@ -976,8 +976,8 @@ final kTranslationsMap = >>[ 'en': 'Password is required', }, 'duq5gpp6': { - 'pt': 'A senha deve ter pelo menos 8 caracteres.', - 'en': '', + 'pt': 'Mínimo 8 caracteres.', + 'en': 'Minimum 8 characters.', }, 'rcikqhf1': { 'pt': 'Please choose an option from the dropdown', diff --git a/lib/shared/utils/validator_util.dart b/lib/shared/utils/validator_util.dart index a06591e9..3188c18e 100644 --- a/lib/shared/utils/validator_util.dart +++ b/lib/shared/utils/validator_util.dart @@ -8,7 +8,7 @@ class ValidatorUtil { } static bool isValidPassword(String password) { - if (password.length > 7) { + if (password.length >= 8) { return true; } else { return false;