From aea9b851c0173f54146f7f2a19ac5ea1dfde0ba5 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 26 Jul 2024 14:41:21 -0300 Subject: [PATCH] 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';