This commit is contained in:
jantunesmesias 2024-08-28 16:45:21 -03:00
parent 6702017e07
commit 2742d7d9f6
16 changed files with 370 additions and 334 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -1,10 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_model.dart'; import 'package:hub/components/molecular_components/order_filter_modal/order_filter_modal_model.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart';
class OrderFilterModalWidget extends StatefulWidget { class OrderFilterModalWidget extends StatefulWidget {
final String defaultAdresseeType; final String defaultAdresseeType;
@ -25,12 +23,28 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
late Map<String, dynamic> selected; late Map<String, dynamic> selected;
final List<Map<String, String>> adresseeTypeOptions = [ final List<Map<String, String>> adresseeTypeOptions = [
{'title': 'Morador', 'value': 'MOR'}, {
{'title': 'Propriedade', 'value': 'PRO'}, 'title': FFLocalizations.of(AppState().context!)
.getVariableText(enText: 'Resident', ptText: 'Morador'),
'value': 'MOR'
},
{
'title': FFLocalizations.of(AppState().context!)
.getVariableText(enText: 'Property', ptText: 'Propriedade'),
'value': 'PRO'
},
]; ];
final List<Map<String, String>> statusOptions = [ final List<Map<String, String>> statusOptions = [
{'title': 'Aguardando Retirada', 'value': 'notPickedUp'}, {
{'title': 'Retirado', 'value': 'pickedUp'}, 'title': FFLocalizations.of(AppState().context!).getVariableText(
ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'),
'value': 'notPickedUp'
},
{
'title': FFLocalizations.of(AppState().context!)
.getVariableText(ptText: 'Retirado', enText: 'Picked Up'),
'value': 'pickedUp'
},
]; ];
@override @override
@ -46,8 +60,12 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
_model = createModel(context, () => OrderFilterModalModel()); _model = createModel(context, () => OrderFilterModalModel());
selected = { selected = {
'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType], 'adresseeType': widget.defaultAdresseeType == '.*'
'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus], ? ['MOR', 'PRO']
: [widget.defaultAdresseeType],
'status': widget.defaultStatus == '.*'
? ['notPickedUp', 'pickedUp']
: [widget.defaultStatus],
}; };
} }
@ -76,7 +94,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
Navigator.pop(context, filterResult); Navigator.pop(context, filterResult);
} }
Widget _buildCheckboxListTile(String key, List<Map<String, String>> options, double fontsize) { Widget _buildCheckboxListTile(
String key, List<Map<String, String>> options, double fontsize) {
return Column( return Column(
children: [ children: [
Row( Row(
@ -89,13 +108,13 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
key == 'status' ? 'Status' : 'Destinátario', key == 'status' ? 'Status' : 'Destinátario',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: fontsize, fontSize: fontsize,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
), ),
), ),
), ),
], ],
@ -110,12 +129,13 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
title: Text( title: Text(
option['title']!, option['title']!,
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0, letterSpacing: 0.0,
fontSize: fontsize, fontSize: fontsize,
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), useGoogleFonts: GoogleFonts.asMap().containsKey(
color: FlutterFlowTheme.of(context).primaryText, FlutterFlowTheme.of(context).bodyMediumFamily),
), color: FlutterFlowTheme.of(context).primaryText,
),
), ),
dense: true, dense: true,
value: selected[key]!.contains(option['value']), value: selected[key]!.contains(option['value']),
@ -141,7 +161,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
width: 5, width: 5,
color: FlutterFlowTheme.of(context).secondaryText, color: FlutterFlowTheme.of(context).secondaryText,
), ),
controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha controlAffinity:
ListTileControlAffinity.leading, // Adiciona esta linha
); );
}, },
), ),
@ -177,17 +198,17 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
FFLocalizations.of(context) FFLocalizations.of(context)
.getText('yfj9pd6k'), // Filtros .getText('yfj9pd6k'), // Filtros
style: style:
FlutterFlowTheme.of(context).headlineMedium.override( FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: FlutterFlowTheme.of(context) fontFamily: FlutterFlowTheme.of(context)
.headlineMediumFamily, .headlineMediumFamily,
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 18.0, fontSize: 18.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.headlineMediumFamily), .headlineMediumFamily),
), ),
), ),
), ),
], ],
@ -199,7 +220,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
_buildCheckboxListTile('adresseeType', adresseeTypeOptions, 14), _buildCheckboxListTile(
'adresseeType', adresseeTypeOptions, 14),
_buildCheckboxListTile('status', statusOptions, 14), _buildCheckboxListTile('status', statusOptions, 14),
], ],
), ),
@ -220,4 +242,4 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
), ),
); );
} }
} }

View File

@ -4,7 +4,6 @@ import 'package:hub/components/atomic_components/menu_button_item/menu_button_it
import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.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/components/molecular_components/menu_item/menu_item.dart';
import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:material_symbols_icons/symbols.dart';
import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart';
import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart';
@ -128,14 +127,36 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
else else
return <MenuEntry>[ return <MenuEntry>[
MenuButtonWidget( MenuButtonWidget(
icon: Icons.share_location_outlined, icon: Icons.engineering_outlined,
action: () async {
await _model.provisionalSchedule(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Schedule\nProviders',
ptText: 'Agendar\nPrestadores',
),
),
MenuButtonWidget(
icon: Icons.sports_motorsports_outlined,
action: () async {
await _model.deliverySchedule(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Schedule\nDeliveries',
ptText: 'Agendar\nEntregas',
),
),
MenuButtonWidget(
icon: Icons.attach_email_outlined,
action: () async { action: () async {
await _model.fastPassAction(context); await _model.fastPassAction(context);
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Fast\nVisit', ptText: 'Convidar\nVisitantes',
ptText: 'Agenda\nRápida', enText: 'Invite\nVisitors',
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
@ -160,17 +181,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
enText: 'My\nOrders', enText: 'My\nOrders',
), ),
), ),
MenuButtonWidget(
icon: Icons.engineering_outlined,
action: () async {
await _model.provisionalSchedule(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Register\nProviders',
ptText: 'Cadastrar\nPrestadores',
),
),
MenuButtonWidget( MenuButtonWidget(
icon: Icons.event_available, icon: Icons.event_available,
action: () async { action: () async {
@ -178,19 +188,8 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
ptText: 'Reserva\nde Itens', ptText: 'Reservas',
enText: 'Item\nReservation', enText: 'Reservations',
),
),
MenuButtonWidget(
icon: Icons.sports_motorsports_outlined,
action: () async {
await _model.deliverySchedule(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Register\nDeliveries',
ptText: 'Cadastrar\nEntregas',
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
@ -216,14 +215,14 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
icon: Icons.groups, icon: Icons.transfer_within_a_station_outlined,
action: () async { action: () async {
await _model.peopleOnThePropertyAction(context); await _model.accessHistoryAction(context);
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'People on\nthe Property', enText: 'Access\nHistory',
ptText: 'Pessoas na\nPropriedade', ptText: 'Consultar\nAcessos',
), ),
), ),
MenuButtonWidget( MenuButtonWidget(
@ -237,28 +236,6 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Consultar\nLiberações', ptText: 'Consultar\nLiberações',
), ),
), ),
MenuButtonWidget(
icon: Icons.transfer_within_a_station_outlined,
action: () async {
await _model.accessHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Access\nHistory',
ptText: 'Consultar\nAcessos',
),
),
MenuButtonWidget(
icon: Symbols.location_away,
action: () async {
await _model.visitHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Visit\nHistory',
ptText: 'Consultar\nVisitas',
),
),
MenuButtonWidget( MenuButtonWidget(
icon: Icons.chat_outlined, icon: Icons.chat_outlined,
action: () async { action: () async {
@ -270,6 +247,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Consultar\nMensagens', ptText: 'Consultar\nMensagens',
), ),
), ),
MenuButtonWidget(
icon: Icons.groups,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'People on\nthe Property',
ptText: 'Pessoas na\nPropriedade',
),
),
MenuButtonWidget( MenuButtonWidget(
icon: Icons.settings, icon: Icons.settings,
action: () async { action: () async {
@ -384,7 +372,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Provisional Schedule', enText: 'Schedule Providers',
ptText: 'Agendar Prestadores', ptText: 'Agendar Prestadores',
), ),
), ),
@ -395,19 +383,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Delivery Schedule', enText: 'Schedule Deliveries',
ptText: 'Agendar Entregas', ptText: 'Agendar Entregas',
), ),
), ),
MenuCardItem( MenuCardItem(
icon: Icons.share_location_outlined, icon: Icons.attach_email_outlined,
action: () async { action: () async {
await _model.fastPassAction(context); await _model.fastPassAction(context);
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Fast Visit', ptText: 'Convidar Visitantes',
ptText: 'Agenda Rápida', enText: 'Invite Visitors',
), ),
), ),
MenuCardItem( MenuCardItem(
@ -439,19 +427,19 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
ptText: 'Reserva de Itens', ptText: 'Reservas',
enText: 'Item Reservation', enText: 'Reservations',
), ),
), ),
MenuCardItem( MenuCardItem(
icon: FFIcons.khome, icon: Icons.person_add_alt_1_outlined,
action: () async { action: () async {
await _model.registerVisitorOptAction(context); await _model.registerVisitorOptAction(context);
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Register Visitor', enText: 'Register Visitor',
ptText: 'Cadastro de Visitante', ptText: 'Cadastrar Visitante',
), ),
), ),
MenuCardItem( MenuCardItem(
@ -466,29 +454,7 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
), ),
), ),
MenuCardItem( MenuCardItem(
icon: Icons.groups, icon: Icons.transfer_within_a_station_outlined,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'People on the Property',
ptText: 'Pessoas na Propriedade',
),
),
MenuCardItem(
icon: Icons.group_add_outlined,
action: () async {
await _model.liberationHistoryAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'Liberations History',
ptText: 'Consultar Liberações',
),
),
MenuCardItem(
icon: Icons.key_outlined,
action: () async { action: () async {
await _model.accessHistoryAction(context); await _model.accessHistoryAction(context);
setState(() {}); setState(() {});
@ -499,14 +465,14 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
), ),
), ),
MenuCardItem( MenuCardItem(
icon: Icons.people_outline_sharp, icon: Icons.how_to_reg_outlined,
action: () async { action: () async {
await _model.visitHistoryAction(context); await _model.liberationHistoryAction(context);
setState(() {}); setState(() {});
}, },
title: FFLocalizations.of(context).getVariableText( title: FFLocalizations.of(context).getVariableText(
enText: 'Visit History', enText: 'Liberations History',
ptText: 'Consultar Visitas', ptText: 'Consultar Liberações',
), ),
), ),
MenuCardItem( MenuCardItem(
@ -520,6 +486,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
ptText: 'Consultar Mensagens', ptText: 'Consultar Mensagens',
), ),
), ),
MenuCardItem(
icon: Icons.groups,
action: () async {
await _model.peopleOnThePropertyAction(context);
setState(() {});
},
title: FFLocalizations.of(context).getVariableText(
enText: 'People on the Property',
ptText: 'Pessoas na Propriedade',
),
),
MenuCardItem( MenuCardItem(
icon: Icons.settings, icon: Icons.settings,
action: () async { action: () async {
@ -546,57 +523,17 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
]; ];
}(); }();
return Padding( return Builder(
padding: const EdgeInsetsDirectional.only( builder: (context) {
top: 10, if (widget.style == MenuView.list_grid &&
), widget.expandable == true &&
child: Builder( widget.item == MenuItem.button) {
builder: (context) { if (_model.isGrid == true) {
if (widget.style == MenuView.list_grid &&
widget.expandable == true &&
widget.item == MenuItem.button) {
if (_model.isGrid == true) {
return wrapWithModel(
model: _model.menuStaggeredViewComponentModel,
updateCallback: () => setState(() {}),
updateOnChange: true,
child: MenuStaggeredViewComponentWidget(
options: options,
expandable: widget.expandable,
item: widget.item,
changeMenuStyle: () async {
await _model.changeMenuStyle(context);
setState(() {});
},
isGrid: _model.isGrid,
),
);
} else {
return wrapWithModel(
model: _model.menuStaggeredViewComponentModel,
updateCallback: () => setState(() {}),
updateOnChange: true,
child: MenuStaggeredViewComponentWidget(
options: options,
expandable: widget.expandable,
item: widget.item,
changeMenuStyle: () async {
await _model.changeMenuStyle(context);
setState(() {});
},
isGrid: _model.isGrid,
),
);
}
}
if (widget.style == MenuView.list &&
widget.expandable == false &&
widget.item == MenuItem.tile) {
return wrapWithModel( return wrapWithModel(
model: _model.menuListViewComponentModel, model: _model.menuStaggeredViewComponentModel,
updateCallback: () => setState(() {}), updateCallback: () => setState(() {}),
updateOnChange: true, updateOnChange: true,
child: MenuListViewComponentWidget( child: MenuStaggeredViewComponentWidget(
options: options, options: options,
expandable: widget.expandable, expandable: widget.expandable,
item: widget.item, item: widget.item,
@ -604,12 +541,47 @@ class _MenuComponentWidgetState extends State<MenuComponentWidget> {
await _model.changeMenuStyle(context); await _model.changeMenuStyle(context);
setState(() {}); setState(() {});
}, },
isGrid: _model.isGrid,
),
);
} else {
return wrapWithModel(
model: _model.menuStaggeredViewComponentModel,
updateCallback: () => setState(() {}),
updateOnChange: true,
child: MenuStaggeredViewComponentWidget(
options: options,
expandable: widget.expandable,
item: widget.item,
changeMenuStyle: () async {
await _model.changeMenuStyle(context);
setState(() {});
},
isGrid: _model.isGrid,
), ),
); );
} }
return const SizedBox(); }
}, if (widget.style == MenuView.list &&
), widget.expandable == false &&
widget.item == MenuItem.tile) {
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();
},
); );
} }

View File

@ -107,9 +107,9 @@ class _MenuListViewComponentWidgetState
} }
Widget buildMenuList(BuildContext context) { Widget buildMenuList(BuildContext context) {
return SizedBox( return Expanded(
width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, // height: MediaQuery.of(context).size.height,
child: ListView.separated( child: ListView.separated(
padding: const EdgeInsets.symmetric(horizontal: 15), padding: const EdgeInsets.symmetric(horizontal: 15),
shrinkWrap: true, shrinkWrap: true,

View File

@ -87,7 +87,9 @@ class _MenuStaggeredViewComponentWidgetState
); );
}, },
), ),
], ]
.addToStart(const SizedBox(height: 30))
.addToEnd(const SizedBox(height: 30)),
); );
} }

View File

@ -27,8 +27,8 @@ Widget buildDetails(
showAlertDialog( showAlertDialog(
context, context,
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Bloquear Visita', ptText: 'Cancelar Visita',
enText: 'Block Visit', enText: 'Cancel Visit',
), ),
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Você tem certeza que deseja bloquear essa visita?', ptText: 'Você tem certeza que deseja bloquear essa visita?',

View File

@ -1,8 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart'; import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/internationalization.dart';
class ScheduleProvisionalVisitPageModel class ScheduleProvisionalVisitPageModel
extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> { extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
@ -62,6 +61,26 @@ class ScheduleProvisionalVisitPageModel
); );
} }
DateTime selectedDateTime;
DateTime currentDateTime = DateTime.now();
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
try {
selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val);
} catch (e) {
return FFLocalizations.of(context).getVariableText(
ptText: 'Formato de data/hora inválido',
enText: 'Invalid date/time format',
);
}
if (selectedDateTime.isBefore(currentDateTime)) {
return FFLocalizations.of(context).getVariableText(
ptText: 'A data/hora selecionada é inválida',
enText: 'The selected date/time is invalid',
);
}
return null; return null;
} }

View File

@ -942,8 +942,9 @@ class _ScheduleProvisionalVisitPageWidgetState
"Agendamento Provisório Realizado com Sucesso!", "Agendamento Provisório Realizado com Sucesso!",
enText: enText:
"Provisional Scheduling Successfully Completed")); "Provisional Scheduling Successfully Completed"));
setState(() { safeSetState(() {
_model.dateTimeTextController?.clear(); _model.dateTimeTextController?.clear();
_model.personNameTextController _model.personNameTextController
?.clear(); ?.clear();
_model.notesTextController?.clear(); _model.notesTextController?.clear();

View File

@ -1,25 +1,22 @@
import 'dart:async'; import 'dart:async';
import 'dart:developer';
import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:flutter/material.dart';
import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/shared/utils/validator_util.dart'; import 'package:hub/shared/utils/validator_util.dart';
import '/backend/api_requests/api_calls.dart'; import '/backend/api_requests/api_calls.dart';
import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/form_field_controller.dart';
import 'package:flutter/material.dart';
import 'regisiter_vistor_template_component_widget.dart'; import 'regisiter_vistor_template_component_widget.dart';
class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> { class RegisiterVistorTemplateComponentModel
extends FlutterFlowModel<RegisiterVistorTemplateComponentWidget> {
/// State fields for stateful widgets in this page. /// State fields for stateful widgets in this page.
Timer? _debounceTimer; Timer? _debounceTimer;
final unfocusNode = FocusNode(); final unfocusNode = FocusNode();
bool isDataUploading = false; bool isDataUploading = false;
FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); FFUploadedFile uploadedLocalFile =
FFUploadedFile(bytes: Uint8List.fromList([]));
void debounce(Function() fn, Duration time) { void debounce(Function() fn, Duration time) {
if (_debounceTimer != null) { if (_debounceTimer != null) {
@ -28,6 +25,8 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
_debounceTimer = Timer(time, fn); _debounceTimer = Timer(time, fn);
} }
// State field(s) for TextField widget. // State field(s) for TextField widget.
FocusNode? textFieldFocusNode1; FocusNode? textFieldFocusNode1;
TextEditingController? textController1; TextEditingController? textController1;
@ -97,7 +96,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel<RegisiterVi
TextEditingController? textController4; TextEditingController? textController4;
String? Function(BuildContext, String?)? textController4Validator; String? Function(BuildContext, String?)? textController4Validator;
String? _textController4Validator(BuildContext context, String? val) { String? _textController4Validator(BuildContext context, String? val) {
if (val != null && val.isNotEmpty && ValidatorUtil.isValidEmail(val) == false) { if (val != null &&
val.isNotEmpty &&
ValidatorUtil.isValidEmail(val) == false) {
return FFLocalizations.of(context).getVariableText( return FFLocalizations.of(context).getVariableText(
enText: 'Invalid email', enText: 'Invalid email',
ptText: 'Email inválido', ptText: 'Email inválido',

View File

@ -1,24 +1,20 @@
import 'dart:developer';
import 'package:easy_debounce/easy_debounce.dart'; import 'package:easy_debounce/easy_debounce.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/validator_util.dart'; import 'package:hub/shared/utils/validator_util.dart';
import 'package:json_path/fun_sdk.dart'; import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
import '/backend/api_requests/api_calls.dart'; import '/backend/api_requests/api_calls.dart';
import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/custom_code/actions/index.dart' as actions;
import '/flutter_flow/flutter_flow_drop_down.dart'; import '/flutter_flow/flutter_flow_drop_down.dart';
import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/flutter_flow_widgets.dart'; import '/flutter_flow/flutter_flow_widgets.dart';
import '/flutter_flow/form_field_controller.dart'; import '/flutter_flow/form_field_controller.dart';
import '/flutter_flow/upload_data.dart'; import '/flutter_flow/upload_data.dart';
import '/custom_code/actions/index.dart' as actions;
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'regisiter_vistor_template_component_model.dart'; import 'regisiter_vistor_template_component_model.dart';
export 'regisiter_vistor_template_component_model.dart'; export 'regisiter_vistor_template_component_model.dart';
@ -44,13 +40,20 @@ class _RegisiterVistorTemplateComponentWidgetState
bool _isVisitorRegistered = false; bool _isVisitorRegistered = false;
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>(); BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
final _formKey = GlobalKey<FormState>();
void _resetForm() {
_formKey.currentState?.reset();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false); visitorAlreadyRegistered = BehaviorSubject<bool>.seeded(false);
_model = createModel(context, () => RegisiterVistorTemplateComponentModel()); _model =
createModel(context, () => RegisiterVistorTemplateComponentModel());
_model.textController1 ??= TextEditingController(); _model.textController1 ??= TextEditingController();
_model.textFieldFocusNode1 ??= FocusNode(); _model.textFieldFocusNode1 ??= FocusNode();
@ -87,15 +90,19 @@ class _RegisiterVistorTemplateComponentWidgetState
return false; return false;
} }
if (_model.textController1.text.isEmpty || _model.textController1.text == '') { if (_model.textController1.text.isEmpty ||
_model.textController1.text == '') {
return false; return false;
} }
if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') { if (_model.dropDownValue == null ||
_model.dropDownValue!.isEmpty ||
_model.dropDownValue == '') {
return false; return false;
} }
if (_model.textController2.text.isEmpty || _model.textController2.text == '') { if (_model.textController2.text.isEmpty ||
_model.textController2.text == '') {
return false; return false;
} }
@ -103,7 +110,9 @@ class _RegisiterVistorTemplateComponentWidgetState
return false; return false;
} }
if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) { if (_model.textController4.text.isNotEmpty &&
_model.textController4.text != '' &&
ValidatorUtil.isValidEmail(_model.textController4.text) == false) {
return false; return false;
} }
@ -129,6 +138,7 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Form( child: Form(
key: _formKey,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -137,7 +147,8 @@ class _RegisiterVistorTemplateComponentWidgetState
Align( Align(
alignment: const AlignmentDirectional(-1.0, 0.0), alignment: const AlignmentDirectional(-1.0, 0.0),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 15.0), padding: const EdgeInsetsDirectional.fromSTEB(
20.0, 0.0, 0.0, 15.0),
child: Text( child: Text(
FFLocalizations.of(context).getText( FFLocalizations.of(context).getText(
'zazj5d8b' /* Preencha o formulário com os d... */, 'zazj5d8b' /* Preencha o formulário com os d... */,
@ -167,6 +178,7 @@ class _RegisiterVistorTemplateComponentWidgetState
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
obscureText: false, obscureText: false,
maxLength: 20,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
@ -246,6 +258,7 @@ class _RegisiterVistorTemplateComponentWidgetState
_model.textController2Validator.asValidator(context), _model.textController2Validator.asValidator(context),
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp('[0-9]')), FilteringTextInputFormatter.allow(RegExp('[0-9]')),
LengthLimitingTextInputFormatter(20)
], ],
), ),
_model.textController2.text.isEmpty _model.textController2.text.isEmpty
@ -295,13 +308,11 @@ class _RegisiterVistorTemplateComponentWidgetState
controller: _model.textController1, controller: _model.textController1,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
focusNode: _model.textFieldFocusNode1, focusNode: _model.textFieldFocusNode1,
onChanged: (_) => onChanged: (_) => EasyDebounce.debounce(
EasyDebounce.debounce( '_model.textFieldFocusNode1',
'_model.textFieldFocusNode1', const Duration(milliseconds: 500),
const Duration( () => setState(() {}),
milliseconds: 500), ),
() => setState(() {}),
),
autofocus: true, autofocus: true,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
obscureText: false, obscureText: false,
@ -372,8 +383,11 @@ class _RegisiterVistorTemplateComponentWidgetState
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
maxLines: null, maxLines: null,
maxLength: 80,
keyboardType: TextInputType.name, keyboardType: TextInputType.name,
validator: _model.textController1Validator.asValidator(context), inputFormatters: [LengthLimitingTextInputFormatter(80)],
validator:
_model.textController1Validator.asValidator(context),
), ),
), ),
Padding( Padding(
@ -460,10 +474,12 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: Builder( child: Builder(
builder: (context) { builder: (context) {
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ??
false)) {
return InkWell( return InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
focusColor: Colors.transparent, focusColor: Colors.transparent,
@ -495,7 +511,7 @@ class _RegisiterVistorTemplateComponentWidgetState
child: FFButtonWidget( child: FFButtonWidget(
onPressed: () async { onPressed: () async {
final selectedMedia = final selectedMedia =
await selectMediaWithSourceBottomSheet( await selectMediaWithSourceBottomSheet(
context: context, context: context,
// maxWidth: 300.00, // maxWidth: 300.00,
// maxHeight: 300.00, // maxHeight: 300.00,
@ -508,9 +524,10 @@ class _RegisiterVistorTemplateComponentWidgetState
// selectedMedia.every((m) => // selectedMedia.every((m) =>
// validateFileFormat( // validateFileFormat(
// m.storagePath, context))) { // m.storagePath, context))) {
setState(() => _model.isDataUploading = true); setState(
() => _model.isDataUploading = true);
var selectedUploadedFiles = var selectedUploadedFiles =
<FFUploadedFile>[]; <FFUploadedFile>[];
try { try {
showUploadMessage( showUploadMessage(
@ -520,13 +537,14 @@ class _RegisiterVistorTemplateComponentWidgetState
); );
selectedUploadedFiles = selectedMedia selectedUploadedFiles = selectedMedia
.map((m) => FFUploadedFile( .map((m) => FFUploadedFile(
name: name: m.storagePath
m.storagePath.split('/').last, .split('/')
bytes: m.bytes, .last,
height: m.dimensions?.height, bytes: m.bytes,
width: m.dimensions?.width, height: m.dimensions?.height,
// blurHash: m.blurHash, width: m.dimensions?.width,
)) // blurHash: m.blurHash,
))
.toList(); .toList();
} finally { } finally {
ScaffoldMessenger.of(context) ScaffoldMessenger.of(context)
@ -557,26 +575,27 @@ class _RegisiterVistorTemplateComponentWidgetState
options: FFButtonOptions( options: FFButtonOptions(
width: double.infinity, width: double.infinity,
height: 120.0, height: 120.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 20.0),
iconPadding: iconPadding:
const EdgeInsetsDirectional.fromSTEB( const EdgeInsetsDirectional.fromSTEB(
14.0, 0.0, 0.0, 20.0), 14.0, 0.0, 0.0, 20.0),
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.primaryBackground, .primaryBackground,
textStyle: FlutterFlowTheme.of(context) textStyle: FlutterFlowTheme.of(context)
.titleSmall .titleSmall
.override( .override(
fontFamily: FlutterFlowTheme.of(context) fontFamily: FlutterFlowTheme.of(context)
.titleSmallFamily, .titleSmallFamily,
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.primaryText, .primaryText,
fontSize: 16.0, fontSize: 16.0,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey( .containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.titleSmallFamily), .titleSmallFamily),
), ),
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1, color: FlutterFlowTheme.of(context).accent1,
width: 0.2, width: 0.2,
@ -597,16 +616,16 @@ class _RegisiterVistorTemplateComponentWidgetState
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of(context) fontFamily: FlutterFlowTheme.of(context)
.bodyMediumFamily, .bodyMediumFamily,
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.primaryText, .primaryText,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey( .containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
), ),
), ),
@ -645,12 +664,16 @@ class _RegisiterVistorTemplateComponentWidgetState
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
autofocus: false, autofocus: false,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 25,
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp('[0-9, +, -, (, )]')), RegExp('[0-9, +, -, (, )]')),
LengthLimitingTextInputFormatter(25)
], ],
obscureText: false, obscureText: false,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
@ -729,15 +752,14 @@ class _RegisiterVistorTemplateComponentWidgetState
focusNode: _model.textFieldFocusNode4, focusNode: _model.textFieldFocusNode4,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
autofocus: true, autofocus: true,
onChanged: (_) => onChanged: (_) => EasyDebounce.debounce(
EasyDebounce.debounce( '_model.textFieldFocusNode4',
'_model.textFieldFocusNode4', const Duration(milliseconds: 500),
const Duration( () => setState(() {}),
milliseconds: 500), ),
() => setState(() {}),
),
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
obscureText: false, obscureText: false,
maxLength: 80,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
@ -805,11 +827,14 @@ class _RegisiterVistorTemplateComponentWidgetState
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
validator: _model.textController4Validator.asValidator(context), inputFormatters: [LengthLimitingTextInputFormatter(80)],
validator:
_model.textController4Validator.asValidator(context),
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: _isFormValid(context) onPressed: _isFormValid(context)
? () async { ? () async {
@ -835,29 +860,7 @@ class _RegisiterVistorTemplateComponentWidgetState
foto: 'base64;jpeg,${_model.imgBase64}', foto: 'base64;jpeg,${_model.imgBase64}',
) )
.onError((e, s) async { .onError((e, s) async {
return await showAdaptiveDialog( return await DialogUtil.errorDefault(context);
context: context,
builder: (context) {
return GestureDetector(
onTap: () => Navigator.pop(context),
child: Padding(
padding: MediaQuery.viewInsetsOf(context),
child: Dialog(
backgroundColor: Colors.transparent,
child: ThrowExceptionWidget(
msg: FFLocalizations.of(context)
.getVariableText(
ptText:
'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.',
enText:
'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.',
),
),
),
),
);
},
);
}); });
if (PhpGroup.postScheduleVisitorCall.error( if (PhpGroup.postScheduleVisitorCall.error(
(_model.scheduleVisitor?.jsonBody ?? ''), (_model.scheduleVisitor?.jsonBody ?? ''),
@ -895,6 +898,7 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
), ),
); );
_formKey.currentState?.reset();
if (widget.source == if (widget.source ==
'VisitorNotFoundComponent') { 'VisitorNotFoundComponent') {
Navigator.pop(context, true); Navigator.pop(context, true);

View File

@ -187,8 +187,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': 'Service provider', 'en': 'Service provider',
}, },
'pmezihb4': { 'pmezihb4': {
'pt': 'Selecione...', 'pt': 'Selecione o tipo de pessoa...',
'en': 'Please select...', 'en': 'Please select the type of person...',
}, },
'yza6i4t7': { 'yza6i4t7': {
'pt': 'Search for an item...', 'pt': 'Search for an item...',
@ -286,12 +286,12 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': 'Single visit', 'en': 'Single visit',
}, },
'eftcs67c': { 'eftcs67c': {
'pt': 'Você tem alguma observação sobre está visita?', 'pt': 'Você tem alguma observação sobre esta visita?',
'en': 'Do you have any observations about this visit?', 'en': 'Do you have any observations about this visit?',
}, },
't0q2vuup': { 't0q2vuup': {
'pt': 'Observações da Visita', 'pt': 'Observações da Visita',
'en': 'Visit Observations', 'en': 'Visit Notes',
}, },
'w18iztdm': { 'w18iztdm': {
'pt': 'Escreva as suas observações aqui', 'pt': 'Escreva as suas observações aqui',
@ -350,7 +350,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
}, },
'cw8b3tbb': { 'cw8b3tbb': {
'pt': 'Observação da Visita', 'pt': 'Observação da Visita',
'en': 'Notes Visit', 'en': 'Visit Notes',
}, },
'k4qkbv1f': { 'k4qkbv1f': {
'pt': '', 'pt': '',
@ -482,7 +482,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': 'Release QR Code', 'en': 'Release QR Code',
}, },
'6z6kvmhl': { '6z6kvmhl': {
'pt': 'Certifique-se de que o QRCode está visivel para o leitor', 'pt': 'Certifique-se de que o QRCode está visível para o leitor',
'en': '', 'en': '',
}, },
'wkjkxd2e': { 'wkjkxd2e': {
@ -1181,7 +1181,7 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
}, },
'ujodm2ci': { 'ujodm2ci': {
'pt': 'pt':
'Para gerar o QR Code digite a senha cadastrado no aplicativo e clique em enviar.', 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.',
'en': 'en':
'To generate the QR Code, enter the password registered in the application and click send.', 'To generate the QR Code, enter the password registered in the application and click send.',
}, },

View File

@ -23,7 +23,8 @@ class AcessHistoryPageWidget extends StatefulWidget {
}; };
AcessHistoryPageWidget({super.key, required this.opt}); AcessHistoryPageWidget({super.key, required this.opt});
@override @override
State<AcessHistoryPageWidget> createState() => _AcessHistoryPageWidgetState(opt); State<AcessHistoryPageWidget> createState() =>
_AcessHistoryPageWidgetState(opt);
} }
class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> { class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
@ -43,7 +44,8 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
late Future<void> _accessFuture; late Future<void> _accessFuture;
List<dynamic> _accessWrap = []; List<dynamic> _accessWrap = [];
_AcessHistoryPageWidgetState(Map<String, String> opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { _AcessHistoryPageWidgetState(Map<String, String> opt)
: selectedTypeSubject = BehaviorSubject.seeded(opt) {
selectedTypeSubject.listen((value) {}); selectedTypeSubject.listen((value) {});
} }
@ -333,9 +335,18 @@ class _AcessHistoryPageWidgetState extends State<AcessHistoryPageWidget> {
imagePath: imagePath:
'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}', 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}',
labelsHashMap: Map<String, String>.from({ labelsHashMap: Map<String, String>.from({
'Nome:': accessHistoryItem['PES_NOME'] ?? '', FFLocalizations.of(context).getVariableText(
'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', ptText: 'Nome:',
'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '', enText: 'Name:',
): accessHistoryItem['PES_NOME'] ?? '',
FFLocalizations.of(context).getVariableText(
ptText: 'Acesso:',
enText: 'Access:',
): accessHistoryItem['ACE_DATAHORA'] ?? '',
FFLocalizations.of(context).getVariableText(
ptText: 'Setor',
enText: 'Sector',
): accessHistoryItem['SET_DESCRICAO'] ?? '',
}), }),
statusHashMap: [ statusHashMap: [
accessHistoryItem['PES_TIPO'] == 'O' accessHistoryItem['PES_TIPO'] == 'O'

View File

@ -225,15 +225,18 @@ class _HomePageWidgetState extends State<HomePageWidget> {
} }
Widget createBody() { Widget createBody() {
return Container( return SingleChildScrollView(
color: FlutterFlowTheme.of(context).primaryBackground, physics: const AlwaysScrollableScrollPhysics(),
child: wrapWithModel( child: Container(
model: _model.menuComponentModel, color: FlutterFlowTheme.of(context).primaryBackground,
updateCallback: () => setState(() {}), child: wrapWithModel(
child: const MenuComponentWidget( model: _model.menuComponentModel,
expandable: true, updateCallback: () => setState(() {}),
style: MenuView.list_grid, child: const MenuComponentWidget(
item: MenuItem.button, expandable: true,
style: MenuView.list_grid,
item: MenuItem.button,
),
), ),
), ),
); );

View File

@ -43,22 +43,24 @@ class PreferencesPageModel with ChangeNotifier {
); );
}, },
).then((value) { ).then((value) {
ScaffoldMessenger.of(context).showSnackBar( if (value) {
SnackBar( ScaffoldMessenger.of(context).showSnackBar(
content: Text( SnackBar(
FFLocalizations.of(context).getVariableText( content: Text(
enText: 'Fingerprint changed successfully', FFLocalizations.of(context).getVariableText(
ptText: 'Impressão digital alterada com sucesso', enText: 'Fingerprint changed successfully',
), ptText: 'Impressão digital alterada com sucesso',
style: TextStyle(color: FlutterFlowTheme.of(context).info)), ),
backgroundColor: FlutterFlowTheme.of(context).success, style: TextStyle(color: FlutterFlowTheme.of(context).info)),
duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).success,
behavior: SnackBarBehavior.floating, duration: const Duration(seconds: 3),
shape: RoundedRectangleBorder( behavior: SnackBarBehavior.floating,
borderRadius: BorderRadius.circular(30), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
), ),
), );
); }
}).catchError((err, stack) { }).catchError((err, stack) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(

View File

@ -1747,7 +1747,7 @@ Widget scheduleVisit(BuildContext context,
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
ptText: 'Inativo', ptText: 'Inativo',
enText: 'Inactive', enText: 'Inactive',
): FlutterFlowTheme.of(context).warning, ): FlutterFlowTheme.of(context).success,
}), }),
], ],
onTapCardItemAction: () async {}, onTapCardItemAction: () async {},

View File

@ -72,8 +72,9 @@ class CustomDrawer extends StatelessWidget {
), ),
), ),
), ),
SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
flex: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -161,16 +162,14 @@ class CustomDrawer extends StatelessWidget {
); );
} }
Expanded _buildDrawerBody() { Widget _buildDrawerBody() {
return Expanded( return wrapWithModel(
child: wrapWithModel( model: model.menuComponentModel,
model: model.menuComponentModel, updateCallback: () {},
updateCallback: () {}, child: const MenuComponentWidget(
child: const MenuComponentWidget( expandable: false,
expandable: false, style: MenuView.list,
style: MenuView.list, item: MenuItem.tile,
item: MenuItem.tile,
),
), ),
); );
} }