diff --git a/lib/components/_template_/bloc/bloc.dart b/lib/components/_template_/bloc/bloc.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/bloc/bloc.dart +++ b/lib/components/_template_/bloc/bloc.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/bloc/event.dart b/lib/components/_template_/bloc/event.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/bloc/event.dart +++ b/lib/components/_template_/bloc/event.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/bloc/index.dart b/lib/components/_template_/bloc/index.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/bloc/index.dart +++ b/lib/components/_template_/bloc/index.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/bloc/state.dart b/lib/components/_template_/bloc/state.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/bloc/state.dart +++ b/lib/components/_template_/bloc/state.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/index.dart b/lib/components/_template_/index.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/index.dart +++ b/lib/components/_template_/index.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/view_model/index.dart b/lib/components/_template_/view_model/index.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/view_model/index.dart +++ b/lib/components/_template_/view_model/index.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/view_model/view_model.dart b/lib/components/_template_/view_model/view_model.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/view_model/view_model.dart +++ b/lib/components/_template_/view_model/view_model.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/widgets/index.dart b/lib/components/_template_/widgets/index.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/widgets/index.dart +++ b/lib/components/_template_/widgets/index.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/widgets/screen.dart b/lib/components/_template_/widgets/screen.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/widgets/screen.dart +++ b/lib/components/_template_/widgets/screen.dart @@ -0,0 +1 @@ + diff --git a/lib/components/_template_/widgets/widget.dart b/lib/components/_template_/widgets/widget.dart index e69de29b..8b137891 100644 --- a/lib/components/_template_/widgets/widget.dart +++ b/lib/components/_template_/widgets/widget.dart @@ -0,0 +1 @@ + diff --git a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart index 7f19801a..a07154e5 100644 --- a/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -6,7 +6,11 @@ class AtomImageSvgTheme extends StatelessWidget { final double width; final double height; - const AtomImageSvgTheme({super.key, required this.filename, required this.width, required this.height}); + const AtomImageSvgTheme( + {super.key, + required this.filename, + required this.width, + required this.height}); @override Widget build(BuildContext context) { diff --git a/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart b/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart index b615051b..2c420571 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_datepicker.dart @@ -65,7 +65,8 @@ class _CustomDatePickerState extends State { fontSize: 32.0, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineLargeFamily), ), pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground, pickerForegroundColor: FlutterFlowTheme.of(context).primaryText, @@ -88,19 +89,27 @@ class _CustomDatePickerState extends State { child!, headerBackgroundColor: FlutterFlowTheme.of(context).primary, headerForegroundColor: FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override( - fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground, + headerTextStyle: + FlutterFlowTheme.of(context).headlineLarge.override( + fontFamily: + FlutterFlowTheme.of(context).headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context).primaryBackground, pickerForegroundColor: FlutterFlowTheme.of(context).info, - selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, - pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText, - actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + pickerDialForegroundColor: + FlutterFlowTheme.of(context).primaryText, + actionButtonForegroundColor: + FlutterFlowTheme.of(context).primaryText, iconSize: 24.0, ); }, @@ -157,7 +166,8 @@ class _CustomDatePickerState extends State { child: Stack( children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: widget.controller, focusNode: widget.focusNode, @@ -167,20 +177,26 @@ class _CustomDatePickerState extends State { obscureText: false, decoration: InputDecoration( isDense: true, - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), hintText: widget.hintText, - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), lineHeight: 1.0, ), enabledBorder: OutlineInputBorder( @@ -217,9 +233,11 @@ class _CustomDatePickerState extends State { ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), lineHeight: 1.8, ), textAlign: TextAlign.start, @@ -227,7 +245,8 @@ class _CustomDatePickerState extends State { ), ), 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: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, diff --git a/lib/components/atomic_components/shared_components_atoms/custom_select.dart b/lib/components/atomic_components/shared_components_atoms/custom_select.dart index 8898a47b..7a2b791a 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_select.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_select.dart @@ -52,7 +52,8 @@ class _CustomSelectState extends State { children: [ Expanded( child: 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: Container( width: 100.0, height: 48.0, @@ -66,11 +67,14 @@ class _CustomSelectState extends State { isMultiSelect: false, width: double.infinity, height: double.infinity, - textStyle: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedInputFontSize, ), hintText: widget.hintText, @@ -83,7 +87,8 @@ class _CustomSelectState extends State { borderColor: FlutterFlowTheme.of(context).customColor6, borderWidth: 0.5, borderRadius: 10.0, - margin: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 16.0, 0.0), + margin: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 16.0, 0.0), hidesUnderline: true, isOverButton: true, isSearchable: false, @@ -96,25 +101,32 @@ class _CustomSelectState extends State { if (widget.isRequired) if (widget.dropDownValue == null || widget.dropDownValue == '') 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: Row( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsetsDirectional.only(top: 5, start: 15), + padding: + const EdgeInsetsDirectional.only(top: 5, start: 15), child: Text( FFLocalizations.of(context).getVariableText( enText: 'This field is required', ptText: 'Este campo é obrigatório', ), - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - color: FlutterFlowTheme.of(context).customColor6, - letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodySmallFamily), - fontSize: limitedInputFontSize)), + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + color: + FlutterFlowTheme.of(context).customColor6, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodySmallFamily), + fontSize: limitedInputFontSize)), ), ], ), diff --git a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart index 2977f7cb..ec1c5af3 100644 --- a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart +++ b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart @@ -37,7 +37,8 @@ class _MediaUploadButtonUtilState extends State { return Builder( builder: (context) { - if (widget.uploadedFiles != null && widget.uploadedFiles!.bytes!.isNotEmpty) { + if (widget.uploadedFiles != null && + widget.uploadedFiles!.bytes!.isNotEmpty) { { return InkWell( splashColor: Colors.transparent, @@ -47,7 +48,8 @@ class _MediaUploadButtonUtilState extends State { onTap: () async { setState(() { widget.isUploading = false; - widget.uploadedFiles = FFUploadedFile(bytes: Uint8List.fromList([])); + widget.uploadedFiles = + FFUploadedFile(bytes: Uint8List.fromList([])); widget.onUploadComplete(widget.uploadedFiles!); }); }, @@ -72,7 +74,8 @@ class _MediaUploadButtonUtilState extends State { setState(() { _isLoading = true; }); - final selectedMedia = await selectMediaWithSourceBottomSheet( + final selectedMedia = + await selectMediaWithSourceBottomSheet( context: context, imageQuality: 100, allowPhoto: true, @@ -84,7 +87,9 @@ class _MediaUploadButtonUtilState extends State { try { final message = FFLocalizations.of(context) - .getVariableText(enText: 'Uploading file...', ptText: 'Enviando arquivo...'); + .getVariableText( + enText: 'Uploading file...', + ptText: 'Enviando arquivo...'); showUploadMessage( context, message, @@ -103,20 +108,24 @@ class _MediaUploadButtonUtilState extends State { ScaffoldMessenger.of(context).hideCurrentSnackBar(); widget.isUploading = false; } - if (selectedUploadedFiles.length == selectedMedia.length) { + if (selectedUploadedFiles.length == + selectedMedia.length) { setState(() { widget.uploadedFiles = selectedUploadedFiles.first; }); widget.onUploadComplete(widget.uploadedFiles!); - final message = - FFLocalizations.of(context).getVariableText(enText: 'Success!', ptText: 'Sucesso!'); + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Success!', ptText: 'Sucesso!'); showUploadMessage(context, message); } else { setState(() { _isLoading = false; }); final message = FFLocalizations.of(context) - .getVariableText(enText: 'Failed to upload data', ptText: 'Falha ao enviar dados'); + .getVariableText( + enText: 'Failed to upload data', + ptText: 'Falha ao enviar dados'); showUploadMessage(context, message); return; } @@ -163,13 +172,19 @@ class _MediaUploadButtonUtilState extends State { 'p4ftwxcy', ), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).primaryText, + style: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, fontSize: limitedInputTextSize, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), ), ), ) diff --git a/lib/components/atomic_components/shared_components_atoms/submit_button.dart b/lib/components/atomic_components/shared_components_atoms/submit_button.dart index 1a4cdd39..bffdee8e 100644 --- a/lib/components/atomic_components/shared_components_atoms/submit_button.dart +++ b/lib/components/atomic_components/shared_components_atoms/submit_button.dart @@ -30,7 +30,8 @@ class SubmitButtonUtil extends StatelessWidget { fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).titleSmallFamily), ), borderSide: const BorderSide( color: Colors.transparent, diff --git a/lib/components/atomic_components/shared_components_atoms/tabview.dart b/lib/components/atomic_components/shared_components_atoms/tabview.dart index 3ae0d4dd..8a62cbf3 100644 --- a/lib/components/atomic_components/shared_components_atoms/tabview.dart +++ b/lib/components/atomic_components/shared_components_atoms/tabview.dart @@ -41,7 +41,8 @@ class TabViewUtil extends StatelessWidget { fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), ), unselectedLabelStyle: const TextStyle(), indicatorColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/components/atomic_components/term_of_use/atom_terms_of_use.dart b/lib/components/atomic_components/term_of_use/atom_terms_of_use.dart index 470d61f8..01a47e5d 100644 --- a/lib/components/atomic_components/term_of_use/atom_terms_of_use.dart +++ b/lib/components/atomic_components/term_of_use/atom_terms_of_use.dart @@ -19,7 +19,8 @@ class AtomTermsOfUse extends StatelessWidget { color: FlutterFlowTheme.of(context).primaryText, fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), onTap: () => launchURL('https://freaccess.com.br/pp'), diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart index ff40e7d4..30f54431 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_model.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_model.dart @@ -2,7 +2,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'text_field_component_widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; -class TextFieldComponentModel extends FlutterFlowModel { +class TextFieldComponentModel + extends FlutterFlowModel { /// State fields for stateful widgets in this component. // State field(s) for TextField widget. diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart index 2e98b097..7c99bad0 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart @@ -20,7 +20,8 @@ class TextFieldComponentWidget extends StatefulWidget { final String? hintTextStrParam; @override - State createState() => _TextFieldComponentWidgetState(); + State createState() => + _TextFieldComponentWidgetState(); } class _TextFieldComponentWidgetState extends State { @@ -37,7 +38,8 @@ class _TextFieldComponentWidgetState extends State { super.initState(); _model = createModel(context, () => TextFieldComponentModel()); - _model.textController ??= TextEditingController(text: widget.initialValueStrParam); + _model.textController ??= + TextEditingController(text: widget.initialValueStrParam); _model.textFieldFocusNode ??= FocusNode(); } @@ -63,14 +65,16 @@ class _TextFieldComponentWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), hintText: widget.hintTextStrParam, 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -105,7 +109,8 @@ class _TextFieldComponentWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).secondaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), validator: _model.textControllerValidator.asValidator(context), ), diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart index e2e83af6..214c6fb4 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart @@ -3,7 +3,8 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:flutter/material.dart'; -class OptionSelectionModalModel extends FlutterFlowModel { +class OptionSelectionModalModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index ed4433d8..a445cc81 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -21,10 +21,12 @@ class OptionSelectionModalWidget extends StatefulWidget { final List? nameListStr; @override - State createState() => _OptionSelectionModalWidgetState(); + State createState() => + _OptionSelectionModalWidgetState(); } -class _OptionSelectionModalWidgetState extends State with TickerProviderStateMixin { +class _OptionSelectionModalWidgetState extends State + with TickerProviderStateMixin { late OptionSelectionModalModel _model; final animationsMap = {}; @@ -90,14 +92,17 @@ class _OptionSelectionModalWidgetState extends State return GestureDetector( onTap: () async { context.pop(); - if (widget.routesListStr![optionsListIndex] == 'scheduleCompleteVisitPage') { + if (widget.routesListStr![optionsListIndex] == + 'scheduleCompleteVisitPage') { // Navegação para a página ScheduleCompleteVisitPage com queryParameters context.go( '/scheduleCompleteVisitPage', extra: { - 'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()), - 'visitEndDateStr': - DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now().add(const Duration(days: 1))), + 'visitStartDateStr': DateFormat('yyyy-MM-dd HH:mm:ss') + .format(DateTime.now()), + 'visitEndDateStr': DateFormat('yyyy-MM-dd HH:mm:ss') + .format( + DateTime.now().add(const Duration(days: 1))), }, ); } else { @@ -144,20 +149,27 @@ class _OptionSelectionModalWidgetState extends State children: [ Expanded( child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), + alignment: + const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 0.0, 0.0), + 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, + color: FlutterFlowTheme.of(context) + .primaryBackground, shape: BoxShape.circle, ), - alignment: const AlignmentDirectional(0.0, 0.0), + alignment: const AlignmentDirectional( + 0.0, 0.0), child: Icon( - widget.iconsListIcon![optionsListIndex]!, - color: FlutterFlowTheme.of(context).accent1, + widget.iconsListIcon![ + optionsListIndex]!, + color: FlutterFlowTheme.of(context) + .accent1, size: 34.0, ), ), @@ -174,16 +186,21 @@ class _OptionSelectionModalWidgetState extends State mainAxisAlignment: MainAxisAlignment.center, children: [ Align( - alignment: const AlignmentDirectional(0.0, 0.0), + alignment: + const AlignmentDirectional(0.0, 0.0), child: Text( widget.nameListStr![optionsListIndex], - style: FlutterFlowTheme.of(context).titleLarge.override( + style: FlutterFlowTheme.of(context) + .titleLarge + .override( fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, + color: FlutterFlowTheme.of(context) + .primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Nunito'), ), ), ), diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_model.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_model.dart index ec888c47..79362029 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_model.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_model.dart @@ -15,7 +15,8 @@ class OrderFilterModalModel extends FlutterFlowModel { // State field(s) for CheckboxGroup widget. FormFieldController>? checkboxGroupValueController; List? get checkboxGroupValues => checkboxGroupValueController?.value; - set checkboxGroupValues(List? v) => checkboxGroupValueController?.value = v; + set checkboxGroupValues(List? v) => + checkboxGroupValueController?.value = v; @override void initState(BuildContext context) {} @@ -25,4 +26,4 @@ class OrderFilterModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart index 1835eb3c..70882191 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart @@ -28,22 +28,25 @@ class _OrderFilterModalWidgetState extends State { late Map selected; final List> adresseeTypeOptions = [ { - 'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(enText: 'Resident', ptText: 'Morador'), + 'title': FFLocalizations.of(navigatorKey.currentContext!) + .getVariableText(enText: 'Resident', ptText: 'Morador'), 'value': 'MOR' }, { - 'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(enText: 'Property', ptText: 'Propriedade'), + 'title': FFLocalizations.of(navigatorKey.currentContext!) + .getVariableText(enText: 'Property', ptText: 'Propriedade'), 'value': 'PRO' }, ]; final List> statusOptions = [ { - 'title': FFLocalizations.of(navigatorKey.currentContext!) - .getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'), + 'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText( + ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'), 'value': 'notPickedUp' }, { - 'title': FFLocalizations.of(navigatorKey.currentContext!).getVariableText(ptText: 'Retirado', enText: 'Picked Up'), + 'title': FFLocalizations.of(navigatorKey.currentContext!) + .getVariableText(ptText: 'Retirado', enText: 'Picked Up'), 'value': 'pickedUp' }, ]; @@ -61,8 +64,12 @@ class _OrderFilterModalWidgetState extends State { _model = createModel(context, () => OrderFilterModalModel()); selected = { - 'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType], - 'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus], + 'adresseeType': widget.defaultAdresseeType == '.*' + ? ['MOR', 'PRO'] + : [widget.defaultAdresseeType], + 'status': widget.defaultStatus == '.*' + ? ['notPickedUp', 'pickedUp'] + : [widget.defaultStatus], }; } @@ -92,7 +99,8 @@ class _OrderFilterModalWidgetState extends State { context.pop(filterResult); } - Widget _buildCheckboxListTile(String key, List> options, double fontsize) { + Widget _buildCheckboxListTile( + String key, List> options, double fontsize) { return Column( children: [ Row( @@ -108,7 +116,8 @@ class _OrderFilterModalWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: fontsize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -128,7 +137,8 @@ class _OrderFilterModalWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontSize: fontsize, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -156,7 +166,8 @@ class _OrderFilterModalWidgetState extends State { width: 5, color: FlutterFlowTheme.of(context).secondaryText, ), - controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha + controlAffinity: + ListTileControlAffinity.leading, // Adiciona esta linha ); }, ), @@ -186,18 +197,23 @@ class _OrderFilterModalWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 10.0, 0.0, 10.0), child: Text( - FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 18.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), - ), + FFLocalizations.of(context) + .getText('yfj9pd6k'), // Filtros + style: + FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context) + .headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 18.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .headlineMediumFamily), + ), ), ), ], @@ -209,8 +225,10 @@ class _OrderFilterModalWidgetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - _buildCheckboxListTile('adresseeType', adresseeTypeOptions, limitedBodyFontSize), - _buildCheckboxListTile('status', statusOptions, limitedBodyFontSize), + _buildCheckboxListTile('adresseeType', + adresseeTypeOptions, limitedBodyFontSize), + _buildCheckboxListTile( + 'status', statusOptions, limitedBodyFontSize), ], ), ), @@ -231,4 +249,4 @@ class _OrderFilterModalWidgetState extends State { ), ); } -} \ No newline at end of file +} diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index 981f1db5..20246e26 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -14,7 +14,8 @@ export 'throw_exception_model.dart'; // ignore: must_be_immutable class ThrowExceptionWidget extends StatefulWidget { - ThrowExceptionWidget({super.key, required this.msg, this.type = EnumThrowException.error}); + ThrowExceptionWidget( + {super.key, required this.msg, this.type = EnumThrowException.error}); final String? msg; EnumThrowException type; @@ -23,7 +24,8 @@ class ThrowExceptionWidget extends StatefulWidget { State createState() => _ThrowExceptionWidgetState(); } -class _ThrowExceptionWidgetState extends State with TickerProviderStateMixin { +class _ThrowExceptionWidgetState extends State + with TickerProviderStateMixin { late ThrowExceptionModel _model; final animationsMap = {}; @@ -52,11 +54,14 @@ class _ThrowExceptionWidgetState extends State with Ticker String _getTitleByType(BuildContext context) { switch (widget.type) { case EnumThrowException.error: - return FFLocalizations.of(context).getVariableText(ptText: "Falha :(", enText: "Fail :("); + return FFLocalizations.of(context) + .getVariableText(ptText: "Falha :(", enText: "Fail :("); case EnumThrowException.warning: - return FFLocalizations.of(context).getVariableText(ptText: "Aviso :O", enText: "Warning :O"); + return FFLocalizations.of(context) + .getVariableText(ptText: "Aviso :O", enText: "Warning :O"); case EnumThrowException.success: - return FFLocalizations.of(context).getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); + return FFLocalizations.of(context) + .getVariableText(ptText: "Sucesso ;)", enText: "Success ;)"); } } @@ -96,7 +101,8 @@ class _ThrowExceptionWidgetState extends State with Ticker @override Widget build(BuildContext context) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedHeaderFontSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return InkWell( key: const ValueKey('ThrowExceptionWidget'), splashColor: Colors.transparent, @@ -109,7 +115,8 @@ class _ThrowExceptionWidgetState extends State with Ticker child: DecoratedBox( decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(20.0), // Ajuste o valor conforme necessário + borderRadius: + BorderRadius.circular(20.0), // Ajuste o valor conforme necessário ), child: SingleChildScrollView( child: Column( @@ -137,25 +144,28 @@ class _ThrowExceptionWidgetState extends State with Ticker Text( _getTitleByType(context), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 10.0, 15.0, 0.0), child: Text( valueOrDefault(widget.msg, 'Message Not Found'), overflow: TextOverflow.clip, textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedBodyFontSize, ), ), diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart index 98bb8579..abdac046 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart @@ -3,7 +3,8 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:flutter/material.dart'; -class VisitorNotFoundComponentModel extends FlutterFlowModel { +class VisitorNotFoundComponentModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 7fdc75c7..00261f19 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -13,10 +13,12 @@ class VisitorNotFoundComponentWidget extends StatefulWidget { final String? doc; @override - State createState() => _VisitorNotFoundComponentWidgetState(); + State createState() => + _VisitorNotFoundComponentWidgetState(); } -class _VisitorNotFoundComponentWidgetState extends State { +class _VisitorNotFoundComponentWidgetState + extends State { late VisitorNotFoundComponentModel _model; @override @@ -59,7 +61,8 @@ class _VisitorNotFoundComponentWidgetState extends State context.pop(value)); // Navigator.pop(context, value) }, - text: FFLocalizations.of(context).getVariableText(enText: 'Add', ptText: 'Adicionar'), + text: FFLocalizations.of(context) + .getVariableText(enText: 'Add', ptText: 'Adicionar'), options: FFButtonOptions( height: 30.0, - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, textStyle: FlutterFlowTheme.of(context).labelSmall.override( - fontFamily: FlutterFlowTheme.of(context).labelSmallFamily, + fontFamily: + FlutterFlowTheme.of(context).labelSmallFamily, color: Colors.white, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelSmallFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelSmallFamily), ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart index 11d6aab5..1563d5d5 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart @@ -3,7 +3,8 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:flutter/material.dart'; -class BottomArrowLinkedLocalsComponentModel extends FlutterFlowModel { +class BottomArrowLinkedLocalsComponentModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index 69222d34..6dc7b85b 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -17,10 +17,12 @@ class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { ApiCallResponse? response; @override - State createState() => _BottomArrowLinkedLocalsComponentWidgetState(); + State createState() => + _BottomArrowLinkedLocalsComponentWidgetState(); } -class _BottomArrowLinkedLocalsComponentWidgetState extends State { +class _BottomArrowLinkedLocalsComponentWidgetState + extends State { late BottomArrowLinkedLocalsComponentModel _model; bool _loading = false; @@ -38,7 +40,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State BottomArrowLinkedLocalsComponentModel()); + _model = + createModel(context, () => BottomArrowLinkedLocalsComponentModel()); _localsFuture = _fetchLocals(); } @@ -104,10 +107,14 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State _handleError(BuildContext context, String errorMsg) async { + static Future _handleError( + BuildContext context, String errorMsg) async { await DialogUtil.error(context, errorMsg); } @@ -141,18 +149,25 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State _labelsHashMap(dynamic local) { - return Map.from( - {'${local['CLI_PREFIXO']}:': local['CLI_NOME'], '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC']}); + return Map.from({ + '${local['CLI_PREFIXO']}:': local['CLI_NOME'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': + local['CLU_OWNER_DSC'] + }); } Map _statusHashMap(dynamic local) { return Map.from({ if (local['CLU_STATUS'] == 'A') - FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active'): FlutterFlowTheme.of(context).success else if (local['CLU_STATUS'] == 'B') - FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked'): FlutterFlowTheme.of(context).error else - FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending'): FlutterFlowTheme.of(context).warning }); } @@ -184,16 +208,21 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State { +class ScheduleVisitDetailModel + extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -37,7 +38,8 @@ class ScheduleVisitDetailModel extends FlutterFlowModel initDB() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 508e10d6..0baeea54 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -35,7 +35,8 @@ class ScheduleVisitDetailWidget extends StatefulWidget { final String? visitObsStr; @override - State createState() => _ScheduleVisitDetailWidgetState(); + State createState() => + _ScheduleVisitDetailWidgetState(); } class _ScheduleVisitDetailWidgetState extends State { @@ -57,16 +58,19 @@ class _ScheduleVisitDetailWidgetState extends State { _model.textController1 ??= TextEditingController(text: widget.visitTempStr); _model.textFieldFocusNode1 ??= FocusNode(); - _model.textController2 ??= TextEditingController(text: widget.visitStartDate); + _model.textController2 ??= + TextEditingController(text: widget.visitStartDate); _model.textFieldFocusNode2 ??= FocusNode(); _model.textController3 ??= TextEditingController(text: widget.visitEndDate); _model.textFieldFocusNode3 ??= FocusNode(); - _model.textController4 ??= TextEditingController(text: extractDescToStr(widget.visitResonStr!)); + _model.textController4 ??= + TextEditingController(text: extractDescToStr(widget.visitResonStr!)); _model.textFieldFocusNode4 ??= FocusNode(); - _model.textController5 ??= TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); + _model.textController5 ??= + TextEditingController(text: extractDescToStr(widget.visitLevelStr!)); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -128,11 +132,13 @@ class _ScheduleVisitDetailWidgetState extends State { ), ), child: Visibility( - visible: widget.visitorStrList != null && widget.visitorStrList != '', + visible: widget.visitorStrList != null && + widget.visitorStrList != '', child: Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -155,7 +161,8 @@ class _ScheduleVisitDetailWidgetState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 5.0, 0.0, 5.0, 20.0), child: SizedBox( width: 100.0, child: ClipRRect( @@ -183,7 +190,8 @@ class _ScheduleVisitDetailWidgetState extends State { Container( decoration: const BoxDecoration(), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 10.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -195,17 +203,31 @@ class _ScheduleVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( '7w4fohoa' /* Encerramento da Visita */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -236,24 +258,32 @@ class _ScheduleVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - validator: _model.textController1Validator.asValidator(context), + validator: _model.textController1Validator + .asValidator(context), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + 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), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -262,68 +292,98 @@ class _ScheduleVisitDetailWidgetState extends State { readOnly: true, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getVariableText( + labelText: FFLocalizations.of(context) + .getVariableText( enText: 'Start', ptText: 'Início', ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintText: FFLocalizations.of(context).getText( + hintText: + FFLocalizations.of(context).getText( '0cp1e31d' /* dd/mm/yyyy */, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context) + .primary, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, fontSize: 12, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController2Validator.asValidator(context), + validator: _model.textController2Validator + .asValidator(context), ), ), ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -332,61 +392,90 @@ class _ScheduleVisitDetailWidgetState extends State { readOnly: true, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of(context).getText( 'abppdgz3' /* Término */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintText: FFLocalizations.of(context).getText( + hintText: + FFLocalizations.of(context).getText( 'kqralft4' /* dd/mm/yyyy */, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context) + .primary, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, fontSize: 12, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController3Validator.asValidator(context), + validator: _model.textController3Validator + .asValidator(context), ), ), ), @@ -394,14 +483,16 @@ class _ScheduleVisitDetailWidgetState extends State { ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + 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), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -410,66 +501,96 @@ class _ScheduleVisitDetailWidgetState extends State { readOnly: true, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of(context).getText( 'xjxhzqqm' /* Motivo da Visita */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintText: FFLocalizations.of(context).getText( + hintText: + FFLocalizations.of(context).getText( '47oezdm6' /* Motivo */, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context) + .primary, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController4Validator.asValidator(context), + validator: _model.textController4Validator + .asValidator(context), ), ), ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController5, focusNode: _model.textFieldFocusNode5, @@ -478,60 +599,89 @@ class _ScheduleVisitDetailWidgetState extends State { readOnly: true, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of(context).getText( '2ujg7u18' /* Nível de Acesso */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintText: FFLocalizations.of(context).getText( + hintText: + FFLocalizations.of(context).getText( '3emmbbfv' /* Nível de Acesso */, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context) + .primary, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of(context).error, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController5Validator.asValidator(context), + validator: _model.textController5Validator + .asValidator(context), ), ), ), @@ -541,7 +691,8 @@ class _ScheduleVisitDetailWidgetState extends State { Container( decoration: const BoxDecoration(), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController6, focusNode: _model.textFieldFocusNode6, @@ -553,17 +704,31 @@ class _ScheduleVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( 'ritce5uw' /* Observações da Visita */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -594,12 +759,18 @@ class _ScheduleVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - validator: _model.textController6Validator.asValidator(context), + validator: _model.textController6Validator + .asValidator(context), ), ), ), @@ -609,10 +780,12 @@ class _ScheduleVisitDetailWidgetState extends State { ), IconButton( onPressed: () async { - _model.postScheduleVisit = await PhpGroup.postScheduleVisitCall.call( + _model.postScheduleVisit = + await PhpGroup.postScheduleVisitCall.call( devDesc: widget.visitObsStr, idVisitante: widget.visitorStrList, - dtInicio: _model.convertDateFormat(widget.visitStartDate ?? ''), + dtInicio: + _model.convertDateFormat(widget.visitStartDate ?? ''), dtFim: _model.convertDateFormat(widget.visitEndDate ?? ''), unica: widget.visitTempStr, idMotivo: extractIdToStr(widget.visitResonStr!), @@ -629,7 +802,8 @@ class _ScheduleVisitDetailWidgetState extends State { final String? msg = PhpGroup.postScheduleVisitCall.errorMsg( (_model.postScheduleVisit?.jsonBody ?? ''), ); - await DialogUtil.error(context, msg!).then((value) => safeSetState(() {})); + await DialogUtil.error(context, msg!) + .then((value) => safeSetState(() {})); } setState(() {}); diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart index b07f502c..be8b36d1 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart @@ -3,7 +3,8 @@ import 'package:hub/components/organism_components/up_arrow_linked_locals_compon import 'package:hub/features/storage/index.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; -class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel { +class UpArrowLinkedLocalsComponentModel + extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -16,9 +17,12 @@ class UpArrowLinkedLocalsComponentModel extends FlutterFlowModel initDB() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; } @override diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index 2cadee92..d1ad656e 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -12,10 +12,12 @@ class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); @override - State createState() => _UpArrowLinkedLocalsComponentWidgetState(); + State createState() => + _UpArrowLinkedLocalsComponentWidgetState(); } -class _UpArrowLinkedLocalsComponentWidgetState extends State { +class _UpArrowLinkedLocalsComponentWidgetState + extends State { late UpArrowLinkedLocalsComponentModel _model; @override @@ -105,7 +107,8 @@ class _UpArrowLinkedLocalsComponentWidgetState extends State { +class AccessNotificationModalTemplateComponentModel + extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -31,8 +33,10 @@ class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel initDB() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart index edb51dba..652bdfe6 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -41,7 +41,8 @@ class _AccessNotificationModalTemplateComponentWidgetState void initState() { super.initState(); - _model = createModel(context, () => AccessNotificationModalTemplateComponentModel()); + _model = createModel( + context, () => AccessNotificationModalTemplateComponentModel()); _model.textController1 ??= TextEditingController(text: widget.name); _model.textFieldFocusNode1 ??= FocusNode(); @@ -65,9 +66,11 @@ class _AccessNotificationModalTemplateComponentWidgetState @override Widget build(BuildContext context) { - String labelTypeResident = FFLocalizations.of(context).getVariableText(enText: 'Resident', ptText: 'Morador'); + String labelTypeResident = FFLocalizations.of(context) + .getVariableText(enText: 'Resident', ptText: 'Morador'); - String labelTypeVisitor = FFLocalizations.of(context).getVariableText(enText: 'Visitor', ptText: 'Visitante'); + String labelTypeVisitor = FFLocalizations.of(context) + .getVariableText(enText: 'Visitor', ptText: 'Visitante'); return Align( alignment: const AlignmentDirectional(0.0, 0.0), @@ -110,10 +113,13 @@ class _AccessNotificationModalTemplateComponentWidgetState fit: BoxFit.cover, ), ), - ].addToStart(const SizedBox(width: 10.0)).addToEnd(const SizedBox(width: 10.0)), + ] + .addToStart(const SizedBox(width: 10.0)) + .addToEnd(const SizedBox(width: 10.0)), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -126,19 +132,25 @@ class _AccessNotificationModalTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'dvag09pq' /* Nome */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -150,16 +162,18 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController1Validator.asValidator(context), + validator: + _model.textController1Validator.asValidator(context), ), ), Row( @@ -167,8 +181,10 @@ class _AccessNotificationModalTemplateComponentWidgetState children: [ Expanded( child: TextFormField( - controller: - TextEditingController(text: widget.type == 'O' ? labelTypeResident : labelTypeVisitor), + controller: TextEditingController( + text: widget.type == 'O' + ? labelTypeResident + : labelTypeVisitor), focusNode: _model.textFieldFocusNode2, autofocus: false, textInputAction: TextInputAction.next, @@ -179,19 +195,27 @@ class _AccessNotificationModalTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'h3s0r1he' /* Tipo */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -203,22 +227,28 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController2Validator.asValidator(context), + validator: _model.textController2Validator + .asValidator(context), ), ), - ].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)), + ] + .addToStart(const SizedBox(width: 24.0)) + .addToEnd(const SizedBox(width: 24.0)), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -231,19 +261,25 @@ class _AccessNotificationModalTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'jveeqpdz' /* Acesso */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -255,20 +291,23 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController3Validator.asValidator(context), + validator: + _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -283,18 +322,24 @@ class _AccessNotificationModalTemplateComponentWidgetState enText: 'Access Sector', ptText: 'Setor de Acesso', ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -306,14 +351,16 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, - validator: _model.textController4Validator.asValidator(context), + validator: + _model.textController4Validator.asValidator(context), ), ), ] diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart index aed57244..3f35acf9 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart @@ -1,8 +1,10 @@ import '/flutter_flow/flutter_flow_util.dart'; -import 'card_item_template_component_widget.dart' show CardItemTemplateComponentWidget; +import 'card_item_template_component_widget.dart' + show CardItemTemplateComponentWidget; import 'package:flutter/material.dart'; -class CardItemTemplateComponentModel extends FlutterFlowModel { +class CardItemTemplateComponentModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 9cba811c..129cf635 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -27,10 +27,12 @@ class CardItemTemplateComponentWidget extends StatefulWidget { final Future Function()? onTapCardItemAction; @override - State createState() => _CardItemTemplateComponentWidgetState(); + State createState() => + _CardItemTemplateComponentWidgetState(); } -class _CardItemTemplateComponentWidgetState extends State { +class _CardItemTemplateComponentWidgetState + extends State { late CardItemTemplateComponentModel _model; late LinkedHashMap labelsLinkedHashMap; late List> statusLinkedHashMap; @@ -40,7 +42,9 @@ class _CardItemTemplateComponentWidgetState extends State CardItemTemplateComponentModel()); labelsLinkedHashMap = LinkedHashMap.from(widget.labelsHashMap ?? {}); - statusLinkedHashMap = widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); + statusLinkedHashMap = widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); } @override @@ -70,7 +74,8 @@ class _CardItemTemplateComponentWidgetState extends State { +class PassKeyTemplateComponentModel + extends FlutterFlowModel { /// State fields for stateful widgets in this component. final formKey = GlobalKey(); @@ -15,7 +16,8 @@ class PassKeyTemplateComponentModel extends FlutterFlowModel { } Future _initialize() async { - _accessPass = await StorageHelper().get(SecureStorageKey.accessPass.value) ?? ''; + _accessPass = + await StorageHelper().get(SecureStorageKey.accessPass.value) ?? ''; } @override @@ -89,7 +90,8 @@ class _PassKeyTemplateWidgetState extends State { tablet: false, )) Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -102,7 +104,8 @@ class _PassKeyTemplateWidgetState extends State { mainAxisSize: MainAxisSize.max, children: [ const Padding( - padding: EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0), + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), child: Icon( Icons.arrow_back_rounded, color: Color(0xFF15161E), @@ -110,17 +113,20 @@ class _PassKeyTemplateWidgetState extends State { ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 0.0, 0.0), child: Text( '', - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), ), ), ], @@ -128,11 +134,13 @@ class _PassKeyTemplateWidgetState extends State { ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getVariableText( enText: 'INSERT PASSWORD', - ptText: _accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', + ptText: + _accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', @@ -145,16 +153,20 @@ class _PassKeyTemplateWidgetState extends State { ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), child: Text( - FFLocalizations.of(context).getVariableText(enText: 'Enter your password to continue', ptText: 'Digite sua senha para continuar'), + FFLocalizations.of(context).getVariableText( + enText: 'Enter your password to continue', + ptText: 'Digite sua senha para continuar'), style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), ), ), @@ -164,7 +176,8 @@ class _PassKeyTemplateWidgetState extends State { child: Column( children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 12.0, 16.0, 0.0), child: SizedBox( width: double.infinity, child: TextFormField( @@ -183,29 +196,36 @@ class _PassKeyTemplateWidgetState extends State { obscureText: !_model.keyTextFieldVisibility1, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getVariableText( + labelText: + FFLocalizations.of(context).getVariableText( ptText: 'Senha', enText: 'Password', ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( + labelStyle: 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'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), hintText: FFLocalizations.of(context).getVariableText( ptText: 'Digite a sua senha.....', enText: 'Enter your password.....', ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -236,15 +256,20 @@ class _PassKeyTemplateWidgetState extends State { borderRadius: BorderRadius.circular(12.0), ), filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, - contentPadding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0), + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), suffixIcon: InkWell( onTap: () => setState( - () => _model.keyTextFieldVisibility1 = !_model.keyTextFieldVisibility1, + () => _model.keyTextFieldVisibility1 = + !_model.keyTextFieldVisibility1, ), focusNode: FocusNode(skipTraversal: true), child: Icon( - _model.keyTextFieldVisibility1 ? Icons.visibility_outlined : Icons.visibility_off_outlined, + _model.keyTextFieldVisibility1 + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, color: FlutterFlowTheme.of(context).accent1, size: 22.0, ), @@ -256,14 +281,20 @@ class _PassKeyTemplateWidgetState extends State { fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), maxLength: 4, maxLengthEnforcement: MaxLengthEnforcement.enforced, - buildCounter: (context, {required currentLength, required isFocused, maxLength}) => null, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, keyboardType: TextInputType.number, cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.keyTextFieldTextControllerValidator1.asValidator(context), + validator: _model.keyTextFieldTextControllerValidator1 + .asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(4), @@ -277,14 +308,18 @@ class _PassKeyTemplateWidgetState extends State { Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), child: FFButtonWidget( onPressed: () async { - if (_model.formKey.currentState == null || !_model.formKey.currentState!.validate()) { + if (_model.formKey.currentState == null || + !_model.formKey.currentState!.validate()) { return; } await widget.toggleActionStatus?.call( - _model.keyTextFieldTextController1.text.isEmpty ? _model.keyTextFieldTextController2.text : _model.keyTextFieldTextController1.text, + _model.keyTextFieldTextController1.text.isEmpty + ? _model.keyTextFieldTextController2.text + : _model.keyTextFieldTextController1.text, ); // Navigator.pop(context, true); context.pop(true); @@ -296,8 +331,10 @@ class _PassKeyTemplateWidgetState extends State { options: FFButtonOptions( width: 270.0, height: 50.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), color: const Color(0xFF1AAB5F), textStyle: FlutterFlowTheme.of(context).titleSmall.override( fontFamily: 'Plus Jakarta Sans', @@ -305,7 +342,8 @@ class _PassKeyTemplateWidgetState extends State { fontSize: 16.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 1c77edec..6a4f5cec 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -31,10 +31,13 @@ class DetailsComponentWidget extends StatefulWidget { class _DetailsComponentWidgetState extends State { late DetailsComponentModel _model; - LinkedHashMap get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap); + LinkedHashMap get labelsLinkedHashMap => + LinkedHashMap.from(widget.labelsHashMap); List> get statusLinkedHashMap => - widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); + widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); @override void setState(VoidCallback callback) { @@ -59,7 +62,8 @@ class _DetailsComponentWidgetState extends State { @override Widget build(BuildContext context) { // CachedNetworkImage.evictFromCache(widget.imagePath ?? ''); - final double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + final double limitedBodyFontSize = + LimitedFontSizeUtil.getBodyFontSize(context); return Container( constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width, @@ -94,7 +98,8 @@ class _DetailsComponentWidgetState extends State { SizedBox(height: MediaQuery.of(context).size.height * 0.03), Row( children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries.map((MapEntry item) { + return linkedHashMap.entries + .map((MapEntry item) { return Expanded( child: Padding( padding: EdgeInsets.symmetric( @@ -116,22 +121,30 @@ class _DetailsComponentWidgetState extends State { filled: true, fillColor: item.value, labelText: item.key, - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, fontWeight: FontWeight.bold, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily, + FlutterFlowTheme.of(context) + .labelMediumFamily, ), fontSize: limitedBodyFontSize, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily, + FlutterFlowTheme.of(context) + .labelMediumFamily, ), fontSize: limitedBodyFontSize, ), @@ -144,7 +157,8 @@ class _DetailsComponentWidgetState extends State { ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -155,7 +169,8 @@ class _DetailsComponentWidgetState extends State { textAlign: TextAlign.center, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController1Validator.asValidator(context), + validator: _model.textController1Validator + .asValidator(context), ), ), ); @@ -175,7 +190,8 @@ class _DetailsComponentWidgetState extends State { readOnly: true, initialValue: '$value', style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -190,19 +206,26 @@ class _DetailsComponentWidgetState extends State { border: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -212,25 +235,29 @@ class _DetailsComponentWidgetState extends State { enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryBackground, // Change border color here + color: FlutterFlowTheme.of(context) + .primaryBackground, // Change border color here ), ), ), diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index 17bb87d4..f045131b 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -2,10 +2,12 @@ import 'package:hub/features/backend/index.dart'; import 'package:hub/shared/utils/validator_util.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget; +import 'forgot_password_template_component_widget.dart' + show ForgotPasswordTemplateComponentWidget; import 'package:flutter/material.dart'; -class ForgotPasswordTemplateComponentModel extends FlutterFlowModel { +class ForgotPasswordTemplateComponentModel + extends FlutterFlowModel { /// State fields for stateful widgets in this component. final formKey = GlobalKey(); @@ -13,7 +15,8 @@ class ForgotPasswordTemplateComponentModel extends FlutterFlowModel createState() => _ForgotPasswordTemplateComponentWidgetState(); + State createState() => + _ForgotPasswordTemplateComponentWidgetState(); } -class _ForgotPasswordTemplateComponentWidgetState extends State { +class _ForgotPasswordTemplateComponentWidgetState + extends State { late ForgotPasswordTemplateComponentModel _model; @override @@ -49,9 +51,11 @@ class _ForgotPasswordTemplateComponentWidgetState extends State('BackButton'), splashColor: Colors.transparent, @@ -97,7 +102,8 @@ class _ForgotPasswordTemplateComponentWidgetState extends State('SendButtonWidget'), - onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) + onPressed: (_model.emailAddressTextController.text == + '' || + !ValidatorUtil.isValidEmail( + _model.emailAddressTextController.text)) ? null - : () async => await AuthenticationService.forgotPassword( + : () async => + await AuthenticationService.forgotPassword( context, _model.emailAddressTextController.text, ).then((v) => v == true ? context.pop() : null), @@ -249,23 +277,28 @@ class _ForgotPasswordTemplateComponentWidgetState extends State { +class LiberationHistoryItemDetailsTemplateComponentModel + extends FlutterFlowModel< + LiberationHistoryItemDetailsTemplateComponentWidget> { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -26,8 +28,10 @@ class LiberationHistoryItemDetailsTemplateComponentModel extends FlutterFlowMode Future initDatabase() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; ; } diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart index 5ed0fd82..539f36eb 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart @@ -5,7 +5,8 @@ import 'package:hub/components/templates_components/liberation_history_item_deta import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; -class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { +class LiberationHistoryItemDetailsTemplateComponentWidget + extends StatefulWidget { const LiberationHistoryItemDetailsTemplateComponentWidget({ super.key, required this.name, @@ -39,7 +40,8 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState @override void initState() { super.initState(); - _model = createModel(context, () => LiberationHistoryItemDetailsTemplateComponentModel()); + _model = createModel( + context, () => LiberationHistoryItemDetailsTemplateComponentModel()); _model.textController1 ??= TextEditingController(text: widget.name); _model.textFieldFocusNode1 ??= FocusNode(); @@ -104,10 +106,13 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState fit: BoxFit.cover, ), ), - ].addToStart(const SizedBox(width: 10.0)).addToEnd(const SizedBox(width: 10.0)), + ] + .addToStart(const SizedBox(width: 10.0)) + .addToEnd(const SizedBox(width: 10.0)), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -120,19 +125,25 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'dmazrriq' /* Nome */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -144,16 +155,18 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController1Validator.asValidator(context), + validator: + _model.textController1Validator.asValidator(context), ), ), Row( @@ -172,19 +185,27 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'xx3ivbr4' /* Tipo */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -196,22 +217,28 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController2Validator.asValidator(context), + validator: _model.textController2Validator + .asValidator(context), ), ), - ].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)), + ] + .addToStart(const SizedBox(width: 24.0)) + .addToEnd(const SizedBox(width: 24.0)), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -224,19 +251,25 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'rhheok7k' /* Acesso */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -248,20 +281,23 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController3Validator.asValidator(context), + validator: + _model.textController3Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -275,18 +311,24 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState labelText: FFLocalizations.of(context).getText( 'w3tciqlv' /* Acionamento */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -298,14 +340,16 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, - validator: _model.textController4Validator.asValidator(context), + validator: + _model.textController4Validator.asValidator(context), ), ), ] diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 2262612b..1039a738 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -37,7 +37,8 @@ class _MessageNotificationModalTemplateComponentWidgetState @override void initState() { super.initState(); - _model = createModel(context, () => MessageNotificationModalTemplateComponentModel()); + _model = createModel( + context, () => MessageNotificationModalTemplateComponentModel()); _model.textController1 ??= TextEditingController(text: widget.message); _model.textFieldFocusNode1 ??= FocusNode(); @@ -59,7 +60,8 @@ class _MessageNotificationModalTemplateComponentWidgetState @override Widget build(BuildContext context) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedSubHeaderFontSize = + LimitedFontSizeUtil.getSubHeaderFontSize(context); return Container( width: MediaQuery.sizeOf(context).width, @@ -79,7 +81,8 @@ class _MessageNotificationModalTemplateComponentWidgetState mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -94,17 +97,21 @@ class _MessageNotificationModalTemplateComponentWidgetState enText: 'Message', ), labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, @@ -120,7 +127,8 @@ class _MessageNotificationModalTemplateComponentWidgetState fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedBodyFontSize, ), textAlign: TextAlign.start, @@ -146,20 +154,26 @@ class _MessageNotificationModalTemplateComponentWidgetState ptText: 'De', enText: 'From', ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, @@ -172,22 +186,27 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, keyboardType: TextInputType.name, - validator: _model.textController2Validator.asValidator(context), + validator: + _model.textController2Validator.asValidator(context), ), ), - ].addToStart(const SizedBox(width: 24.0)).addToEnd(const SizedBox(width: 24.0)), + ] + .addToStart(const SizedBox(width: 24.0)) + .addToEnd(const SizedBox(width: 24.0)), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -202,17 +221,21 @@ class _MessageNotificationModalTemplateComponentWidgetState enText: 'To', ), labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, @@ -228,7 +251,8 @@ class _MessageNotificationModalTemplateComponentWidgetState fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedBodyFontSize, ), textAlign: TextAlign.start, diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart index 9c75170a..c1e82767 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart @@ -6,7 +6,8 @@ import 'package:hub/features/backend/index.dart'; import 'package:hub/features/storage/index.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; -class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { +class ScheduleProvisionalVisitPageModel + extends FlutterFlowModel { String cliUUID = ''; String devUUID = ''; String userUUID = ''; @@ -20,21 +21,25 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel visitors.add(item); void removeFromVisitors(dynamic item) => visitors.remove(item); void removeAtIndexFromVisitors(int index) => visitors.removeAt(index); - void insertAtIndexInVisitors(int index, dynamic item) => visitors.insert(index, item); - void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => visitors[index] = updateFn(visitors[index]); + void insertAtIndexInVisitors(int index, dynamic item) => + visitors.insert(index, item); + void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => + visitors[index] = updateFn(visitors[index]); List docs = []; void addToDocs(String item) => docs.add(item); void removeFromDocs(String item) => docs.remove(item); void removeAtIndexFromDocs(int index) => docs.removeAt(index); void insertAtIndexInDocs(int index, String item) => docs.insert(index, item); - void updateDocsAtIndex(int index, Function(String) updateFn) => docs[index] = updateFn(docs[index]); + void updateDocsAtIndex(int index, Function(String) updateFn) => + docs[index] = updateFn(docs[index]); final formKey = GlobalKey(); FocusNode? personNameFocusNode; TextEditingController? personNameTextController; String? Function(BuildContext, String?)? personNameTextControllerValidator; - String? _personNameTextControllerValidator(BuildContext context, String? val) { + String? _personNameTextControllerValidator( + BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getText('3hqg8buh'); } @@ -55,9 +60,11 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel 80) { + if (personNameTextController.text == '' || + personNameTextController.text.length > 80) { return false; } @@ -119,10 +129,12 @@ class ScheduleProvisionalVisitPageModel extends FlutterFlowModel init() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; - ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + ownerName = + (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; + ownerUUID = + (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; setState?.call(); } } diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart index 46c14402..54e96540 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart @@ -17,10 +17,12 @@ class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); @override - State createState() => _ScheduleProvisionalVisitPageWidgetState(); + State createState() => + _ScheduleProvisionalVisitPageWidgetState(); } -class _ScheduleProvisionalVisitPageWidgetState extends State { +class _ScheduleProvisionalVisitPageWidgetState + extends State { late ScheduleProvisionalVisitPageModel model; @override @@ -41,8 +43,10 @@ class _ScheduleProvisionalVisitPageWidgetState extends State FocusScope.of(context).unfocus(), @@ -65,17 +69,24 @@ class _ScheduleProvisionalVisitPageWidgetState extends State EasyDebounce.debounce( + controller: + model.personNameTextController, + focusNode: + model.personNameFocusNode, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + onChanged: (_) => + EasyDebounce.debounce( 'model.personNameTextController', const Duration(milliseconds: 500), () => setState(() {}), ), autofocus: false, - textInputAction: TextInputAction.next, + textInputAction: + TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of(context) + .getText( 'wehvxbz4' /* Nome / Apelido do Visitante */, ), - labelStyle: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedInputFontSize, - ), - 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), - fontSize: limitedInputFontSize, - ), + labelStyle: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + fontSize: + limitedInputFontSize, + ), + 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), + fontSize: + limitedInputFontSize, + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor5, + color: FlutterFlowTheme.of( + context) + .customColor5, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: + BorderRadius.circular(10.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of( + context) + .primary, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: + BorderRadius.circular(10.0), ), errorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: FlutterFlowTheme.of( + context) + .error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: + BorderRadius.circular(10.0), ), - focusedErrorBorder: OutlineInputBorder( + focusedErrorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: FlutterFlowTheme.of( + context) + .error, width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), + borderRadius: + BorderRadius.circular(10.0), ), suffixIcon: Icon( Icons.person, - color: FlutterFlowTheme.of(context).accent1, + color: + FlutterFlowTheme.of(context) + .accent1, ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + color: FlutterFlowTheme.of( + context) + .primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedInputFontSize, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + fontSize: + limitedInputFontSize, ), textAlign: TextAlign.start, maxLines: null, - validator: model.personNameTextControllerValidator.asValidator(context), + validator: model + .personNameTextControllerValidator + .asValidator(context), ), ), ), @@ -292,17 +412,25 @@ class _ScheduleProvisionalVisitPageWidgetState extends State EasyDebounce.debounce( + controller: + model.dateTimeTextController, + focusNode: + model.dateTimeFocusNode, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + onChanged: (_) => + EasyDebounce.debounce( 'model.dateTimeTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), readOnly: true, @@ -310,90 +438,179 @@ class _ScheduleProvisionalVisitPageWidgetState extends State { +class QrCodePassKeyTemplateComponentModel + extends FlutterFlowModel { /// State fields for stateful widgets in this component. final formKey = GlobalKey(); @@ -11,7 +13,8 @@ class QrCodePassKeyTemplateComponentModel extends FlutterFlowModel createState() => _QrCodePassKeyTemplateComponentWidgetState(); + State createState() => + _QrCodePassKeyTemplateComponentWidgetState(); } -class _QrCodePassKeyTemplateComponentWidgetState extends State { +class _QrCodePassKeyTemplateComponentWidgetState + extends State { late QrCodePassKeyTemplateComponentModel _model; @override @@ -83,7 +85,8 @@ class _QrCodePassKeyTemplateComponentWidgetState extends State safeSetState( - () => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility, + () => _model.keyTextFieldVisibility = + !_model.keyTextFieldVisibility, ), focusNode: FocusNode(skipTraversal: true), child: Icon( - _model.keyTextFieldVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined, + _model.keyTextFieldVisibility + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, color: FlutterFlowTheme.of(context).accent1, size: 22.0, ), @@ -241,16 +270,23 @@ class _QrCodePassKeyTemplateComponentWidgetState extends State null, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, keyboardType: TextInputType.number, - validator: _model.keyTextFieldTextControllerValidator.asValidator(context), + validator: _model.keyTextFieldTextControllerValidator + .asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(4), @@ -261,10 +297,12 @@ class _QrCodePassKeyTemplateComponentWidgetState extends State { +class RegisiterVistorTemplateComponentModel + extends FlutterFlowModel { Timer? _debounceTimer; late final String devUUID; late final String userUUID; @@ -18,7 +19,8 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel getVisitanteByDocument(String document, BuildContext context) async { + Future getVisitanteByDocument( + String document, BuildContext context) async { final response = await PhpGroup.getVisitorByDocCall.call( documento: document, ); - if (response.jsonBody['visitante']['VTE_ID'] != '0' && response.jsonBody['error'] != 'false') { + if (response.jsonBody['visitante']['VTE_ID'] != '0' && + response.jsonBody['error'] != 'false') { return true; } return false; @@ -90,7 +94,9 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel initializeDatabase() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; ; } diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 992e1b10..4a9c5ebe 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -24,13 +24,16 @@ class RegisiterVistorTemplateComponentWidget extends StatefulWidget { final String source; final String? doc; - const RegisiterVistorTemplateComponentWidget({super.key, required this.source, this.doc}); + const RegisiterVistorTemplateComponentWidget( + {super.key, required this.source, this.doc}); @override - State createState() => _RegisiterVistorTemplateComponentWidgetState(); + State createState() => + _RegisiterVistorTemplateComponentWidgetState(); } -class _RegisiterVistorTemplateComponentWidgetState extends State { +class _RegisiterVistorTemplateComponentWidgetState + extends State { late RegisiterVistorTemplateComponentModel _model; bool _isLoading = false; final scaffoldKey = GlobalKey(); @@ -50,7 +53,8 @@ class _RegisiterVistorTemplateComponentWidgetState extends State.seeded(false); - _model = createModel(context, () => RegisiterVistorTemplateComponentModel()); + _model = + createModel(context, () => RegisiterVistorTemplateComponentModel()); _model.textController1 ??= TextEditingController(); _model.textFieldFocusNode1 ??= FocusNode(); @@ -87,15 +91,19 @@ class _RegisiterVistorTemplateComponentWidgetState extends State( - controller: _model.dropDownValueController ??= FormFieldController(null), + controller: _model.dropDownValueController ??= + FormFieldController(null), options: [ FFLocalizations.of(context).getText( 'n8vddmcq' /* Visitante */, @@ -372,14 +430,20 @@ class _RegisiterVistorTemplateComponentWidgetState extends State setState(() => _model.dropDownValue = val), + onChanged: (val) => + setState(() => _model.dropDownValue = val), width: MediaQuery.sizeOf(context).width * 0.9, // height: 44.0, - textStyle: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getVariableText( @@ -395,29 +459,39 @@ class _RegisiterVistorTemplateComponentWidgetState extends State { +class SignInTemplateComponentModel + extends FlutterFlowModel { final formKey = GlobalKey(); final unfocusNode = FocusNode(); FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; String? Function(BuildContext, String?)? emailAddressTextControllerValidator; SignInTemplateComponentModel(); - String? _emailAddressTextControllerValidator(BuildContext context, String? val) { + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getText( 'xhnawzcb' /* Campo é necessário */, diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index 0e786f6c..84cdf9ba 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -28,10 +28,12 @@ class SignInTemplateComponentWidget extends StatefulWidget { final Future Function()? toggleSignUpPage; @override - State createState() => _SignInTemplateComponentWidgetState(); + State createState() => + _SignInTemplateComponentWidgetState(); } -class _SignInTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _SignInTemplateComponentWidgetState + extends State with TickerProviderStateMixin { late SignInTemplateComponentModel _model; final animationsMap = {}; @@ -99,14 +101,17 @@ class _SignInTemplateComponentWidgetState extends State('emailTextFormField'), - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - cursorColor: FlutterFlowTheme.of(context).primary, - onChanged: (_) => EasyDebounce.debounce( + key: const ValueKey( + 'emailTextFormField'), + controller: _model + .emailAddressTextController, + focusNode: _model + .emailAddressFocusNode, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + onChanged: (_) => + EasyDebounce.debounce( '_model.emailAddressTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: true, - autofillHints: const [AutofillHints.email], - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.next, + autofillHints: const [ + AutofillHints.email + ], + textCapitalization: + TextCapitalization.none, + textInputAction: + TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: FFLocalizations.of( + context) + .getText( '1ltg0ylb' /* Email */, ), - labelStyle: FlutterFlowTheme.of(context).labelLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - enabledBorder: OutlineInputBorder( + enabledBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor1, + color: + FlutterFlowTheme.of( + context) + .customColor1, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - focusedBorder: OutlineInputBorder( + focusedBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).success, + color: + FlutterFlowTheme.of( + context) + .success, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - errorBorder: OutlineInputBorder( + errorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), errorStyle: TextStyle( - color: FlutterFlowTheme.of(context).error, - fontSize: limitedInputFontSize, + color: FlutterFlowTheme.of( + context) + .error, + fontSize: + limitedInputFontSize, fontWeight: FontWeight.w500, ), - focusedErrorBorder: OutlineInputBorder( + focusedErrorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), suffixIcon: Icon( Icons.email, - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of( + context) + .accent1, size: 22.0, ), ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - keyboardType: TextInputType.emailAddress, - validator: _model.emailAddressTextControllerValidator.asValidator(context), + style: + FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType.emailAddress, + validator: _model + .emailAddressTextControllerValidator + .asValidator(context), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, child: TextFormField( - key: const ValueKey('passwordTextFormField'), - controller: _model.passwordTextController, - cursorColor: FlutterFlowTheme.of(context).primary, - focusNode: _model.passwordFocusNode, - onChanged: (_) => EasyDebounce.debounce('_model.passwordTextController', const Duration(milliseconds: 500), () => setState(() {})), + key: const ValueKey( + 'passwordTextFormField'), + controller: _model + .passwordTextController, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + focusNode: + _model.passwordFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration( + milliseconds: 500), + () => setState(() {})), autofocus: true, - autofillHints: const [AutofillHints.password], - textInputAction: TextInputAction.send, - obscureText: !_model.passwordVisibility, + autofillHints: const [ + AutofillHints.password + ], + textInputAction: + TextInputAction.send, + obscureText: + !_model.passwordVisibility, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */), - labelStyle: FlutterFlowTheme.of(context).labelLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: FlutterFlowTheme.of(context).customColor1, width: 0.25), - borderRadius: BorderRadius.circular(12.0), + labelText: FFLocalizations.of( + context) + .getText( + '2x19ce8k' /* Senha */), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans')), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25), + borderRadius: + BorderRadius.circular( + 12.0), ), errorStyle: TextStyle( - color: FlutterFlowTheme.of(context).error, - fontSize: limitedInputFontSize, + color: FlutterFlowTheme.of( + context) + .error, + fontSize: + limitedInputFontSize, fontWeight: FontWeight.w500, ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), borderRadius: BorderRadius.circular(12.0)), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), - borderRadius: BorderRadius.circular(12.0), + borderSide: + const BorderSide( + color: Color( + 0xFF1AAB5F), + width: 0.25), + borderRadius: + BorderRadius.circular( + 12.0)), + errorBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0xFFFF5963), + width: 0.25), + borderRadius: + BorderRadius.circular( + 12.0), ), - focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), - borderRadius: BorderRadius.circular(12.0), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: Color( + 0xFFFF5963), + width: 0.25), + borderRadius: + BorderRadius.circular( + 12.0), ), filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, suffixIcon: InkWell( - onTap: () => setState(() => _model.passwordVisibility = !_model.passwordVisibility), - focusNode: FocusNode(skipTraversal: true), - child: Icon(_model.passwordVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, size: 24.0), + onTap: () => setState(() => + _model.passwordVisibility = + !_model + .passwordVisibility), + focusNode: FocusNode( + skipTraversal: true), + child: Icon( + _model.passwordVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0), ), ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - validator: _model.passwordTextControllerValidator.asValidator(context), + style: + FlutterFlowTheme.of(context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordTextControllerValidator + .asValidator(context), ), ), ), @@ -338,73 +512,153 @@ class _SignInTemplateComponentWidgetState extends State('SubmitButtonWidget'), + key: const ValueKey( + 'SubmitButtonWidget'), onPressed: _isFormInvalid() ? null : () async { - await AuthenticationService.signIn( + await AuthenticationService + .signIn( context, _model, - emailAdress: _model.emailAddressTextController.text, - password: _model.passwordTextController.text, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, ); setState(() {}); }, - text: FFLocalizations.of(context).getText('k44tm7wo' /* Entrar */), + text: FFLocalizations.of( + context) + .getText( + 'k44tm7wo' /* Entrar */), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')), + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .primary, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .info, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans')), elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), - borderRadius: BorderRadius.circular(12.0), - disabledColor: FlutterFlowTheme.of(context).customColor5, - disabledTextColor: Colors.white, + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0), + borderRadius: + BorderRadius.circular( + 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), showLoadingIndicator: false, ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey('toggleSignUpPage'), - onPressed: () async => await widget.toggleSignUpPage?.call(), - text: FFLocalizations.of(context).getText( + key: const ValueKey( + 'toggleSignUpPage'), + onPressed: () async => + await widget + .toggleSignUpPage + ?.call(), + text: FFLocalizations.of( + context) + .getText( '14u7ipws' /* Cadastrar */, ), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: limitedInputFontSize, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .customColor1, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .secondaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), - borderRadius: BorderRadius.circular(12.0), + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0), + borderRadius: + BorderRadius.circular( + 12.0), ), showLoadingIndicator: false, ), @@ -414,143 +668,279 @@ class _SignInTemplateComponentWidgetState extends State('SubmitButtonWidget'), - onPressed: _isFormInvalid() - ? null - : () async { - try { - await AuthenticationService.signIn( - context, - _model, - emailAdress: _model.emailAddressTextController.text, - password: _model.passwordTextController.text, - ); - setState(() {}); - } catch (e, s) { - await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s); - } - }, - text: FFLocalizations.of(context).getText('1x926nsn'), + key: const ValueKey< + String>( + 'SubmitButtonWidget'), + onPressed: + _isFormInvalid() + ? null + : () async { + try { + await AuthenticationService + .signIn( + context, + _model, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState( + () {}); + } catch (e, s) { + await DialogUtil + .errorDefault( + context); + LogUtil.requestAPIFailed( + 'login.php', + _model + .emailAddressTextController + .text, + "Login", + e, + s); + } + }, + text: FFLocalizations.of( + context) + .getText('1x926nsn'), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).accent1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of( + context) + .accent1, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: + limitedInputFontSize, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, + borderSide: + const BorderSide( + color: Colors + .transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), - disabledColor: const Color(0xE81AAB5F), + borderRadius: + BorderRadius + .circular(12.0), + disabledColor: + const Color( + 0xE81AAB5F), ), - showLoadingIndicator: true, + showLoadingIndicator: + true, ), ), ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, + 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey('toggleSignUpPage'), - onPressed: () async => await widget.toggleSignUpPage?.call(), - text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */), + key: const ValueKey< + String>( + 'toggleSignUpPage'), + onPressed: () async => + await widget + .toggleSignUpPage + ?.call(), + text: FFLocalizations.of( + context) + .getText( + 'jwvd4ai1' /* Cadastrar */), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of( + context) + .customColor1, + textStyle: + FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .secondaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, + borderSide: + const BorderSide( + color: Colors + .transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius + .circular(12.0), ), - showLoadingIndicator: false, + showLoadingIndicator: + false, ), ), ), - ].divide(const SizedBox(width: 7.0))); + ].divide( + const SizedBox(width: 7.0))); } }, ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), child: InkWell( - key: const ValueKey('ForgotPassword'), + key: const ValueKey( + 'ForgotPassword'), splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const ForgotPasswordTemplateComponentWidget(), - ); - }).then((value) => safeSetState(() {})); + isScrollControlled: true, + backgroundColor: + Colors.transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery + .viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ); + }) + .then((value) => + safeSetState(() {})); }, child: RichText( - textScaler: MediaQuery.of(context).textScaler, + textScaler: + MediaQuery.of(context).textScaler, text: TextSpan( children: [ TextSpan( - text: FFLocalizations.of(context).getText( + text: + FFLocalizations.of(context) + .getText( '05dx91ku' /* Você esqueceu a sua senha? */, ), style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + limitedInputFontSize, ), ), TextSpan( - text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - mouseCursor: SystemMouseCursors.click, + text: FFLocalizations.of( + context) + .getText( + 'p5c6d54y' /* Recupere aqui */), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primary, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.normal, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + mouseCursor: + SystemMouseCursors.click, ) ], - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedInputFontSize), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + fontSize: + limitedInputFontSize), ), ), ), @@ -560,7 +950,8 @@ class _SignInTemplateComponentWidgetState extends State { +class SignUpTemplateComponentModel + extends FlutterFlowModel { final formKey = GlobalKey(); FocusNode? nameRegisterFormFocusNode; TextEditingController? nameRegisterFormTextController; - String? Function(BuildContext, String?)? nameRegisterFormTextControllerValidator; - String? _nameRegisterFormTextControllerValidator(BuildContext context, String? val) { + String? Function(BuildContext, String?)? + nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getText( '3bs10dfq' /* Campo é necessário */, @@ -20,8 +24,10 @@ class SignUpTemplateComponentModel extends FlutterFlowModel createState() => _SignUpTemplateComponentWidgetState(); + State createState() => + _SignUpTemplateComponentWidgetState(); } -class _SignUpTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _SignUpTemplateComponentWidgetState + extends State with TickerProviderStateMixin { late SignUpTemplateComponentModel _model; final animationsMap = {}; late String _deviceType; @@ -91,7 +94,8 @@ class _SignUpTemplateComponentWidgetState extends State _initialize() async { - _deviceType = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? ''; + _deviceType = + (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? ''; } @override @@ -107,19 +111,24 @@ class _SignUpTemplateComponentWidgetState extends State('nameTextFormField'), - controller: _model.nameRegisterFormTextController, - focusNode: _model.nameRegisterFormFocusNode, - onChanged: (_) => EasyDebounce.debounce( + key: const ValueKey( + 'nameTextFormField'), + controller: _model + .nameRegisterFormTextController, + focusNode: _model + .nameRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( '_model.nameRegisterFormTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: false, - autofillHints: const [AutofillHints.name], + autofillHints: const [ + AutofillHints.name + ], obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of( + context) + .getText( '3corpwhd' /* Nome */, ), - labelStyle: FlutterFlowTheme.of(context).labelLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - enabledBorder: OutlineInputBorder( + enabledBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor1, + color: + FlutterFlowTheme.of( + context) + .customColor1, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - focusedBorder: OutlineInputBorder( + focusedBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).success, + color: + FlutterFlowTheme.of( + context) + .success, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - errorBorder: OutlineInputBorder( + errorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), errorStyle: TextStyle( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).error, - fontSize: limitedInputFontSize, - fontWeight: FontWeight.w400, - fontStyle: FontStyle.normal, + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: + limitedInputFontSize, + fontWeight: + FontWeight.w400, + fontStyle: + FontStyle.normal, ), - focusedErrorBorder: OutlineInputBorder( + focusedErrorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, suffixIcon: Icon( Icons.person, - color: FlutterFlowTheme.of(context).accent1, + color: + FlutterFlowTheme.of( + context) + .accent1, size: 22.0, ), ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - validator: _model.nameRegisterFormTextControllerValidator.asValidator(context), + validator: _model + .nameRegisterFormTextControllerValidator + .asValidator(context), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, child: TextFormField( - key: const ValueKey('emailTextFormField'), - controller: _model.emailRegisterFormTextController, - focusNode: _model.emailRegisterFormFocusNode, - onChanged: (_) => EasyDebounce.debounce( + key: const ValueKey( + 'emailTextFormField'), + controller: _model + .emailRegisterFormTextController, + focusNode: _model + .emailRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( '_model.emailRegisterFormTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: false, - autofillHints: const [AutofillHints.email], + autofillHints: const [ + AutofillHints.email + ], obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of( + context) + .getText( '80wonb69' /* Email */, ), - labelStyle: FlutterFlowTheme.of(context).labelLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - enabledBorder: OutlineInputBorder( + enabledBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primaryText, + color: + FlutterFlowTheme.of( + context) + .primaryText, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - focusedBorder: OutlineInputBorder( + focusedBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).success, + color: + FlutterFlowTheme.of( + context) + .success, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - errorBorder: OutlineInputBorder( + errorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), errorStyle: TextStyle( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).error, - fontSize: limitedInputFontSize, - fontWeight: FontWeight.w400, - fontStyle: FontStyle.normal, + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: + limitedInputFontSize, + fontWeight: + FontWeight.w400, + fontStyle: + FontStyle.normal, ), - focusedErrorBorder: OutlineInputBorder( + focusedErrorBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, + color: + FlutterFlowTheme.of( + context) + .error, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, suffixIcon: Icon( Icons.email, - color: FlutterFlowTheme.of(context).accent1, + color: + FlutterFlowTheme.of( + context) + .accent1, size: 22.0, ), ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).customColor1, - fontSize: limitedInputFontSize, + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .customColor1, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - keyboardType: TextInputType.emailAddress, - validator: _model.emailRegisterFormTextControllerValidator.asValidator(context), + keyboardType: TextInputType + .emailAddress, + validator: _model + .emailRegisterFormTextControllerValidator + .asValidator(context), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), child: SizedBox( width: double.infinity, child: TextFormField( - key: const ValueKey('passwordTextFormField'), - controller: _model.passwordRegisterFormTextController, - focusNode: _model.passwordRegisterFormFocusNode, - onChanged: (_) => EasyDebounce.debounce( + key: const ValueKey( + 'passwordTextFormField'), + controller: _model + .passwordRegisterFormTextController, + focusNode: _model + .passwordRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( '_model.passwordRegisterFormTextController', - const Duration(milliseconds: 500), + const Duration( + milliseconds: 500), () => setState(() {}), ), autofocus: false, - autofillHints: const [AutofillHints.password], - obscureText: !_model.passwordRegisterFormVisibility, + autofillHints: const [ + AutofillHints.password + ], + obscureText: !_model + .passwordRegisterFormVisibility, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( + labelText: + FFLocalizations.of( + context) + .getText( '0firji8l' /* Senha */, ), - labelStyle: FlutterFlowTheme.of(context).labelLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - enabledBorder: OutlineInputBorder( + enabledBorder: + OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor1, + color: + FlutterFlowTheme.of( + context) + .customColor1, width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFF1AAB5F), + focusedBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: + Color(0xFF1AAB5F), width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), + errorBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: + Color(0xFFFF5963), width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), errorStyle: TextStyle( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).error, - fontSize: limitedInputFontSize, - fontWeight: FontWeight.w400, - fontStyle: FontStyle.normal, + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: + limitedInputFontSize, + fontWeight: + FontWeight.w400, + fontStyle: + FontStyle.normal, ), - focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), + focusedErrorBorder: + OutlineInputBorder( + borderSide: + const BorderSide( + color: + Color(0xFFFF5963), width: 0.25, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular( + 12.0), ), filled: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, suffixIcon: InkWell( - key: const ValueKey('passwordVisibilitySuffixIcon'), + key: const ValueKey< + String>( + 'passwordVisibilitySuffixIcon'), onTap: () => setState( - () => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility, + () => _model + .passwordRegisterFormVisibility = + !_model + .passwordRegisterFormVisibility, ), - focusNode: FocusNode(skipTraversal: true), + focusNode: FocusNode( + skipTraversal: true), child: Icon( - _model.passwordRegisterFormVisibility ? Icons.visibility_outlined : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, + _model.passwordRegisterFormVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: + FlutterFlowTheme.of( + context) + .accent1, size: 24.0, ), ), ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), - validator: _model.passwordRegisterFormTextControllerValidator.asValidator(context), + validator: _model + .passwordRegisterFormTextControllerValidator + .asValidator(context), ), ), ), @@ -475,53 +728,86 @@ class _SignUpTemplateComponentWidgetState extends State('SubmitButtonWidget'), + key: const ValueKey( + 'SubmitButtonWidget'), onPressed: isFormInvalid() ? null : () async { var shouldSetState = false; - _model.register = await AuthenticationService.signUp( + _model.register = + await AuthenticationService + .signUp( context, - email: _model.emailRegisterFormTextController.text, - name: _model.nameRegisterFormTextController.text, - passwd: _model.passwordRegisterFormTextController.text, + email: _model + .emailRegisterFormTextController + .text, + name: _model + .nameRegisterFormTextController + .text, + passwd: _model + .passwordRegisterFormTextController + .text, device: _deviceType, ); shouldSetState = true; if (_model.register == true) - await widget.toggleSignInPage?.call(); + await widget + .toggleSignInPage + ?.call(); else { - if (shouldSetState) setState(() {}); + if (shouldSetState) + setState(() {}); return; } - if (shouldSetState) setState(() {}); + if (shouldSetState) + setState(() {}); }, - text: FFLocalizations.of(context).getText( + text: FFLocalizations.of(context) + .getText( 'rnvdwzei' /* Cadastrar-se */, ), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).accent1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: limitedInputFontSize, + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .accent1, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .secondaryText, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), - disabledColor: FlutterFlowTheme.of(context).customColor5, + borderRadius: + BorderRadius.circular(12.0), + disabledColor: + FlutterFlowTheme.of(context) + .customColor5, disabledTextColor: Colors.white, ), showLoadingIndicator: true, @@ -530,46 +816,81 @@ class _SignUpTemplateComponentWidgetState extends State('toggleSignInPage'), + key: const ValueKey( + 'toggleSignInPage'), splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: () async => await widget.toggleSignInPage?.call(), + onTap: () async => await widget + .toggleSignInPage + ?.call(), child: RichText( - textScaler: MediaQuery.of(context).textScaler, + textScaler: MediaQuery.of(context) + .textScaler, text: TextSpan( children: [ TextSpan( - text: FFLocalizations.of(context).getText( + text: FFLocalizations.of( + context) + .getText( 'a9smhn5b' /* Você já tem uma conta? */, ), style: TextStyle( - color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedInputFontSize, + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: + limitedInputFontSize, ), ), TextSpan( - text: FFLocalizations.of(context).getText( + text: FFLocalizations.of( + context) + .getText( '09xv5ctc' /* Clique aqui */, ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: limitedInputFontSize, + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primary, + fontSize: + limitedInputFontSize, letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontWeight: + FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), ) ], - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), ), ), @@ -579,7 +900,8 @@ class _SignUpTemplateComponentWidgetState extends State { Future initializeDatabase() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; ; } diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index f8149467..41f38054 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -85,19 +85,23 @@ class _ViewVisitDetailWidgetState extends State { // } // }); - _model.textController1 = TextEditingController(text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? ''); + _model.textController1 = TextEditingController( + text: widget.visitTempStr == 'null' ? '' : widget.visitTempStr ?? ''); _model.textFieldFocusNode1 ??= FocusNode(); - _model.textController2 ??= TextEditingController(text: widget.visitStartDate); + _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.textController4 ??= + TextEditingController(text: widget.visitReasonStr); _model.textFieldFocusNode4 ??= FocusNode(); - _model.textController5 ??= TextEditingController(text: widget.visitLevelStr); + _model.textController5 ??= + TextEditingController(text: widget.visitLevelStr); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -113,7 +117,8 @@ class _ViewVisitDetailWidgetState extends State { @override Widget build(BuildContext context) { - var filteredVisitorJsonList = findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null'; + var filteredVisitorJsonList = + findVisitorById(widget.visitorJsonList, widget.visitIdStr) ?? 'null'; return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 200.0, 0.0, 0.0), @@ -149,7 +154,8 @@ class _ViewVisitDetailWidgetState extends State { child: Align( alignment: const AlignmentDirectional(1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(15.0, 0.0, 15.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 15.0, 0.0), child: FlutterFlowIconButton( borderRadius: 20.0, borderWidth: 1.0, @@ -178,7 +184,8 @@ class _ViewVisitDetailWidgetState extends State { Align( alignment: const AlignmentDirectional(1.0, -1.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 20.0, 20.0), child: Container( width: 100.0, decoration: const BoxDecoration(), @@ -218,8 +225,10 @@ class _ViewVisitDetailWidgetState extends State { child: ClipRRect( borderRadius: BorderRadius.circular(100.0), child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), imageUrl: valueOrDefault( widget.visitorImgPath, 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', @@ -238,7 +247,8 @@ class _ViewVisitDetailWidgetState extends State { Container( decoration: const BoxDecoration(), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 10.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -252,17 +262,27 @@ class _ViewVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( '9yu35pzg' /* Encerramento da Visita */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -294,23 +314,29 @@ class _ViewVisitDetailWidgetState extends State { ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - validator: _model.textController1Validator.asValidator(context), + validator: _model.textController1Validator + .asValidator(context), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + 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), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -324,20 +350,34 @@ class _ViewVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( 'aj6scczp' /* Início */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + 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, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -368,19 +408,27 @@ class _ViewVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController2Validator.asValidator(context), + validator: _model.textController2Validator + .asValidator(context), ), ), ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController3, focusNode: _model.textFieldFocusNode3, @@ -394,20 +442,34 @@ class _ViewVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( 'rvi5z7wg' /* Término */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, + 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), + 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, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -438,13 +500,20 @@ class _ViewVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController3Validator.asValidator(context), + validator: _model.textController3Validator + .asValidator(context), ), ), ), @@ -452,14 +521,16 @@ class _ViewVisitDetailWidgetState extends State { ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), + 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), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController4, focusNode: _model.textFieldFocusNode4, @@ -473,20 +544,34 @@ class _ViewVisitDetailWidgetState extends State { 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, + 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), + 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, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -517,19 +602,27 @@ class _ViewVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController4Validator.asValidator(context), + validator: _model.textController4Validator + .asValidator(context), ), ), ), Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController5, focusNode: _model.textFieldFocusNode5, @@ -543,20 +636,34 @@ class _ViewVisitDetailWidgetState extends State { 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, + 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), + 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, + 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), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -587,13 +694,20 @@ class _ViewVisitDetailWidgetState extends State { borderRadius: BorderRadius.circular(8.0), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), textAlign: TextAlign.center, - validator: _model.textController5Validator.asValidator(context), + validator: _model.textController5Validator + .asValidator(context), ), ), ), @@ -603,7 +717,8 @@ class _ViewVisitDetailWidgetState extends State { Container( decoration: const BoxDecoration(), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 8.0, 0.0, 8.0, 0.0), child: TextFormField( controller: _model.textController6, focusNode: _model.textFieldFocusNode6, @@ -617,17 +732,27 @@ class _ViewVisitDetailWidgetState extends State { labelText: FFLocalizations.of(context).getText( 'lppn9rxa' /* Observações da Visita */, ), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 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), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -659,11 +784,15 @@ class _ViewVisitDetailWidgetState extends State { ), ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - validator: _model.textController6Validator.asValidator(context), + validator: _model.textController6Validator + .asValidator(context), ), ), ), @@ -688,7 +817,8 @@ class _ViewVisitDetailWidgetState extends State { size: 24.0, ), onPressed: () async { - _model.deleteVisit = await PhpGroup.deleteVisitCall.call( + _model.deleteVisit = + await PhpGroup.deleteVisitCall.call( idVisita: widget.visitIdStr, ); @@ -698,7 +828,8 @@ class _ViewVisitDetailWidgetState extends State { false) { context.pop(); } else { - final error = await DialogUtil.errorDefault(context); + final error = + await DialogUtil.errorDefault(context); await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -735,7 +866,10 @@ class _ViewVisitDetailWidgetState extends State { ), ], ); - } else if ((widget.visitStatusStr == 'C') || (widget.visitStatusStr == 'F') || (widget.visitStatusStr == 'B') || (widget.visitStatusStr == 'I')) { + } else if ((widget.visitStatusStr == 'C') || + (widget.visitStatusStr == 'F') || + (widget.visitStatusStr == 'B') || + (widget.visitStatusStr == 'I')) { return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, 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 c7143f06..7cd079db 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 @@ -5,7 +5,8 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:flutter/material.dart'; -class VisitDetailsModalTemplateComponentModel extends FlutterFlowModel { +class VisitDetailsModalTemplateComponentModel + extends FlutterFlowModel { /// Local state fields for this component. Color statusColor = const Color(0xff000000); @@ -20,7 +21,8 @@ class VisitDetailsModalTemplateComponentModel extends FlutterFlowModel ViewVisitDetailModel()); - scheduleVisitDetailModel = createModel(context, () => ScheduleVisitDetailModel()); + scheduleVisitDetailModel = + createModel(context, () => ScheduleVisitDetailModel()); } @override diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index b6e63072..a5e922e8 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -41,10 +41,12 @@ class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { final Color? visitStatusColor; @override - State createState() => _VisitDetailsModalTemplateComponentWidgetState(); + State createState() => + _VisitDetailsModalTemplateComponentWidgetState(); } -class _VisitDetailsModalTemplateComponentWidgetState extends State { +class _VisitDetailsModalTemplateComponentWidgetState + extends State { late VisitDetailsModalTemplateComponentModel _model; @override @@ -56,7 +58,8 @@ class _VisitDetailsModalTemplateComponentWidgetState extends State VisitDetailsModalTemplateComponentModel()); + _model = + createModel(context, () => VisitDetailsModalTemplateComponentModel()); } @override diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart index ee7ec7cf..d0f79706 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_model.dart @@ -1,8 +1,10 @@ import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_details_modal_template_component_widget.dart' show VisitorDetailsModalTemplateComponentWidget; +import 'visitor_details_modal_template_component_widget.dart' + show VisitorDetailsModalTemplateComponentWidget; import 'package:flutter/material.dart'; -class VisitorDetailsModalTemplateComponentModel extends FlutterFlowModel { +class VisitorDetailsModalTemplateComponentModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart index fcd55d7b..98309e51 100644 --- a/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart @@ -25,10 +25,12 @@ class VisitorDetailsModalTemplateComponentWidget extends StatefulWidget { final String? visitorEmail; @override - State createState() => _VisitorDetailsModalTemplateComponentWidgetState(); + State createState() => + _VisitorDetailsModalTemplateComponentWidgetState(); } -class _VisitorDetailsModalTemplateComponentWidgetState extends State { +class _VisitorDetailsModalTemplateComponentWidgetState + extends State { late VisitorDetailsModalTemplateComponentModel _model; @override @@ -40,7 +42,8 @@ class _VisitorDetailsModalTemplateComponentWidgetState extends State VisitorDetailsModalTemplateComponentModel()); + _model = + createModel(context, () => VisitorDetailsModalTemplateComponentModel()); } @override @@ -82,7 +85,8 @@ class _VisitorDetailsModalTemplateComponentWidgetState extends State { +class VisitorSearchModalTemplateComponentModel + extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -13,15 +14,18 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel visitors.add(item); void removeFromVisitors(dynamic item) => visitors.remove(item); void removeAtIndexFromVisitors(int index) => visitors.removeAt(index); - void insertAtIndexInVisitors(int index, dynamic item) => visitors.insert(index, item); - void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => visitors[index] = updateFn(visitors[index]); + void insertAtIndexInVisitors(int index, dynamic item) => + visitors.insert(index, item); + void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) => + visitors[index] = updateFn(visitors[index]); List docs = []; void addToDocs(String item) => docs.add(item); void removeFromDocs(String item) => docs.remove(item); void removeAtIndexFromDocs(int index) => docs.removeAt(index); void insertAtIndexInDocs(int index, String item) => docs.insert(index, item); - void updateDocsAtIndex(int index, Function(String) updateFn) => docs[index] = updateFn(docs[index]); + void updateDocsAtIndex(int index, Function(String) updateFn) => + docs[index] = updateFn(docs[index]); FocusNode? textFieldFocusNode; TextEditingController? textController; @@ -35,8 +39,10 @@ class VisitorSearchModalTemplateComponentModel extends FlutterFlowModel initDatabase() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; ; } diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 6ceaf2c1..41fe84e8 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -25,10 +25,13 @@ class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { final Future Function(List? docsParam)? getDocs; @override - State createState() => _VisitorSearchModalTemplateComponentWidgetState(); + State createState() => + _VisitorSearchModalTemplateComponentWidgetState(); } -class _VisitorSearchModalTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _VisitorSearchModalTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { late VisitorSearchModalTemplateComponentModel _model; safeSetState(VoidCallback callback) { @@ -39,7 +42,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State VisitorSearchModalTemplateComponentModel()); + _model = + createModel(context, () => VisitorSearchModalTemplateComponentModel()); _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); @@ -54,9 +58,12 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State e).toList(); @@ -185,7 +222,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State( - getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(), + getJsonField(visitorItem, + r'''$.VTE_NOME''') + ?.toString(), 'NOT FOUND', ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily, + style: FlutterFlowTheme.of( + context) + .bodyLarge + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyLargeFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyLargeFamily), - fontSize: limitedBodyFontSize, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyLargeFamily), + fontSize: + limitedBodyFontSize, ), ), ), @@ -245,9 +307,14 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State 0 - ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) + ? () async => await addVisitor(context) + .whenComplete(safeSetState(() {})) : () async => await sendVisitors(context), text: MediaQuery.of(context).viewInsets.bottom > 0 ? FFLocalizations.of(context).getVariableText( @@ -293,20 +362,28 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State addVisitor(BuildContext context) async { safeSetState(() { _model.textController?.text = _model.textController.text; - _model.textController?.selection = TextSelection.collapsed(offset: _model.textController!.text.length); + _model.textController?.selection = + TextSelection.collapsed(offset: _model.textController!.text.length); }); - _model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call(documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), '')); + _model.getVisitorByDoc = await PhpGroup.getVisitorByDocCall.call( + documento: _model.textController.text.replaceFirst(RegExp(r'^0+'), '')); - if (PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != '0' && - PhpGroup.getVisitorByDocCall.error((_model.getVisitorByDoc?.jsonBody ?? '')) == false && - PhpGroup.getVisitorByDocCall.vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != null) { - String newDoc = _model.textController.text.replaceFirst(RegExp(r'^0+'), ''); + if (PhpGroup.getVisitorByDocCall + .vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != + '0' && + PhpGroup.getVisitorByDocCall + .error((_model.getVisitorByDoc?.jsonBody ?? '')) == + false && + PhpGroup.getVisitorByDocCall + .vistanteId((_model.getVisitorByDoc?.jsonBody ?? '')) != + null) { + String newDoc = + _model.textController.text.replaceFirst(RegExp(r'^0+'), ''); bool existDoc = _model.docs.contains(newDoc); if (existDoc == false) { - _model.addToVisitors(PhpGroup.getVisitorByDocCall.visitante((_model.getVisitorByDoc?.jsonBody ?? ''))); + _model.addToVisitors(PhpGroup.getVisitorByDocCall + .visitante((_model.getVisitorByDoc?.jsonBody ?? ''))); safeSetState(() {}); - _model.addToDocs(_model.textController.text.replaceFirst(RegExp(r'^0+'), '')); + _model.addToDocs( + _model.textController.text.replaceFirst(RegExp(r'^0+'), '')); safeSetState(() {}); } else if (existDoc == true) { ToastUtil.showToast( - message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'), + message: FFLocalizations.of(context).getVariableText( + ptText: 'Visitante já adicionado!', + enText: 'Visitor already added!'), gravity: ToastGravity.TOP, backgroundColor: Colors.red, fontSize: LimitedFontSizeUtil.getBodyFontSize(context)); @@ -353,7 +443,8 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State safeSetState(() { diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart index 8a23ea35..17ea3047 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_model.dart @@ -1,8 +1,10 @@ import '/flutter_flow/flutter_flow_util.dart'; -import 'welcome_template_component_widget.dart' show WelcomeTemplateComponentWidget; +import 'welcome_template_component_widget.dart' + show WelcomeTemplateComponentWidget; import 'package:flutter/material.dart'; -class WelcomeTemplateComponentModel extends FlutterFlowModel { +class WelcomeTemplateComponentModel + extends FlutterFlowModel { @override void initState(BuildContext context) {} diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index b46eb07d..ee0d982d 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -23,10 +23,13 @@ class WelcomeTemplateComponentWidget extends StatefulWidget { final Future Function()? toggleSignInPage; @override - State createState() => _WelcomeTemplateComponentWidgetState(); + State createState() => + _WelcomeTemplateComponentWidgetState(); } -class _WelcomeTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _WelcomeTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { late WelcomeTemplateComponentModel _model; final animationsMap = {}; @@ -87,8 +90,10 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignInPage'), + key: const ValueKey( + 'toggleSignInPage'), onPressed: () async { await widget.toggleSignInPage?.call(); }, - text: FFLocalizations.of(context).getText('dynet730' /* Entrar */), + text: FFLocalizations.of(context) + .getText('dynet730' /* Entrar */), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, + color: + FlutterFlowTheme.of(context) + .info, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular(12.0), ), showLoadingIndicator: false, ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey('toggleSignUpPage'), + key: const ValueKey( + 'toggleSignUpPage'), onPressed: () async { await widget.toggleSignUpPage?.call(); }, - text: FFLocalizations.of(context).getText( + text: + FFLocalizations.of(context).getText( 'hha60cg7' /* Cadastrar */, ), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .customColor1, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryBackground, + color: + FlutterFlowTheme.of(context) + .primaryBackground, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular(12.0), ), showLoadingIndicator: false, ), @@ -250,39 +297,59 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignInPage'), + key: const ValueKey( + 'toggleSignInPage'), onPressed: () async { - await widget.toggleSignInPage?.call(); + await widget.toggleSignInPage + ?.call(); }, - text: FFLocalizations.of(context).getText( + text: FFLocalizations.of(context) + .getText( 'zvtay8ee' /* Entrar */, ), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, fontSize: 16.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular(12.0), ), showLoadingIndicator: false, ), @@ -290,35 +357,54 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignUpPage'), + key: const ValueKey( + 'toggleSignUpPage'), onPressed: () async { - await widget.toggleSignUpPage?.call(); + await widget.toggleSignUpPage + ?.call(); }, - text: FFLocalizations.of(context).getText( + text: FFLocalizations.of(context) + .getText( 'o6zob50a' /* Cadastrar */, ), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context) + .primary, + textStyle: FlutterFlowTheme.of( + context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, fontSize: 16.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), + borderRadius: + BorderRadius.circular(12.0), ), showLoadingIndicator: false, ), @@ -333,7 +419,8 @@ class _WelcomeTemplateComponentWidgetState extends State 7) && (name != null && name != '')) { + if ((email != null && email != '') && + (passwd != null && passwd != '' && passwd.length > 7) && + (name != null && name != '')) { response = await PhpGroup.registerCall.call( name: name, password: passwd, @@ -126,7 +133,8 @@ class AuthenticationService { } } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('registro.php', email.toString(), "Register", e, s); + LogUtil.requestAPIFailed( + 'registro.php', email.toString(), "Register", e, s); return false; } } @@ -154,7 +162,9 @@ class AuthenticationService { try { final ApiCallResponse? response; final ForgotPasswordCall callback = PhpGroup.forgotPasswordCall; - final String message = FFLocalizations.of(context).getVariableText(enText: "Send E-mail Successful!", ptText: "E-mail Enviado com Sucesso!"); + final String message = FFLocalizations.of(context).getVariableText( + enText: "Send E-mail Successful!", + ptText: "E-mail Enviado com Sucesso!"); response = await callback.call(email: email); @@ -167,14 +177,17 @@ class AuthenticationService { } } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('forgotPassword.php', email, "Forgot Password", e, s); + LogUtil.requestAPIFailed( + 'forgotPassword.php', email, "Forgot Password", e, s); return false; } } - static Future changePassword(BuildContext context, String email, String password, String token) async { + static Future changePassword( + BuildContext context, String email, String password, String token) async { try { - final ApiCallResponse response = await PhpGroup.changePasswordCall.call(email: email, psswd: password, token: token); + final ApiCallResponse response = await PhpGroup.changePasswordCall + .call(email: email, psswd: password, token: token); if (response.jsonBody['error'] == false) { final String message = FFLocalizations.of(context).getVariableText( @@ -190,7 +203,8 @@ class AuthenticationService { } } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('changePassword.php', email, "Change Password", e, s); + LogUtil.requestAPIFailed( + 'changePassword.php', email, "Change Password", e, s); return false; } } diff --git a/lib/features/backend/api_requests/api_calls.dart b/lib/features/backend/api_requests/api_calls.dart index 70f1aee6..e7ab6772 100644 --- a/lib/features/backend/api_requests/api_calls.dart +++ b/lib/features/backend/api_requests/api_calls.dart @@ -27,17 +27,20 @@ class PhpGroup { static ForgotPasswordCall forgotPasswordCall = ForgotPasswordCall(); static ChangePasswordCall changePasswordCall = ChangePasswordCall(); static GetLocalsCall getLocalsCall = GetLocalsCall(); - static PostScheduleVisitorCall postScheduleVisitorCall = PostScheduleVisitorCall(); + static PostScheduleVisitorCall postScheduleVisitorCall = + PostScheduleVisitorCall(); static PostScheduleVisitCall postScheduleVisitCall = PostScheduleVisitCall(); static GetScheduleVisitCall getScheduleVisitCall = GetScheduleVisitCall(); static GetDadosCall getDadosCall = GetDadosCall(); static GetVisitorByDocCall getVisitorByDocCall = GetVisitorByDocCall(); static GetFotoVisitanteCall getFotoVisitanteCall = GetFotoVisitanteCall(); - static PostProvVisitSchedulingCall postProvVisitSchedulingCall = PostProvVisitSchedulingCall(); + static PostProvVisitSchedulingCall postProvVisitSchedulingCall = + PostProvVisitSchedulingCall(); static GetVisitsCall getVisitsCall = GetVisitsCall(); static DeleteVisitCall deleteVisitCall = DeleteVisitCall(); static GetPessoasLocalCall getPessoasLocalCall = GetPessoasLocalCall(); - static RespondeSolicitacaoCall respondeSolicitacaoCall = RespondeSolicitacaoCall(); + static RespondeSolicitacaoCall respondeSolicitacaoCall = + RespondeSolicitacaoCall(); static GetAccessCall getAccessCall = GetAccessCall(); static GetLiberationsCall getLiberationsCall = GetLiberationsCall(); static GetMessagesCall getMessagesCall = GetMessagesCall(); @@ -56,7 +59,8 @@ class PhpGroup { static GetPetPhoto getPetPhoto = GetPetPhoto(); static UnregisterDevice unregisterDevice = UnregisterDevice(); static GetVehiclesByProperty getVehiclesByProperty = GetVehiclesByProperty(); - static GetResidentsByProperty getResidentsByProperty = GetResidentsByProperty(); + static GetResidentsByProperty getResidentsByProperty = + GetResidentsByProperty(); static GetOpenedVisits getOpenedVisits = GetOpenedVisits(); static GetLicense getLicense = GetLicense(); static GetProvSchedules getProvSchedules = GetProvSchedules(); @@ -65,9 +69,12 @@ class PhpGroup { class GetProvSchedules { Future call(final String page, final String status) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getAgendamentoProv'; const String pageSize = '10'; final bool isFiltered = status != '' && status != '.*'; @@ -100,9 +107,12 @@ class GetProvSchedules { class GetOpenedVisits { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getOpenedVisits'; const String pageSize = '10'; return await ApiManager.instance.makeApiCall( @@ -132,9 +142,12 @@ class GetOpenedVisits { class GetResidentsByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; - final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; - final String cliID = await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''; + final String devUUID = + await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; + final String userUUID = + await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; + final String cliID = + await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''; const String atividade = 'getResidentsByProperty'; const String pageSize = '10'; return await ApiManager.instance.makeApiCall( @@ -163,9 +176,12 @@ class GetResidentsByProperty { class GetVehiclesByProperty { Future call(final String page) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getVehiclesByProperty'; const String pageSize = '10'; return await ApiManager.instance.makeApiCall( @@ -196,9 +212,12 @@ class GetVehiclesByProperty { class GetLicense { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'getLicense', @@ -227,8 +246,10 @@ class GetLicense { class UnregisterDevice { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'unregisterDevice', @@ -255,9 +276,12 @@ class UnregisterDevice { class DeletePet { Future call({final int? petID = 0}) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'excluirPet'; return await ApiManager.instance.makeApiCall( @@ -300,9 +324,12 @@ class UpdatePet { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'atualizarPet'; return await ApiManager.instance.makeApiCall( @@ -323,7 +350,9 @@ class UpdatePet { 'species': species, 'breed': breed, if (color != '') 'color': color, - if (birthdayDate != '') 'birthdayDate': ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!), + if (birthdayDate != '') + 'birthdayDate': + ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!), 'gender': gender, 'size': size, if (notes != '') 'notes': notes, @@ -346,9 +375,12 @@ class GetPets { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'consultaPets'; return await ApiManager.instance.makeApiCall( @@ -380,9 +412,12 @@ class GetPetPhoto { Future call({final int? petId}) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'consultaFotoPet'; return await ApiManager.instance.makeApiCall( @@ -423,9 +458,12 @@ class RegisterPet { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'cadastrarPet'; return await ApiManager.instance.makeApiCall( @@ -445,7 +483,9 @@ class RegisterPet { 'species': species, 'breed': breed, if (color != '') 'color': color, - if (birthdayDate != '') 'birthdayDate': ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!), + if (birthdayDate != '') + 'birthdayDate': + ValidatorUtil.toISO8601USA('dd/MM/yyyy', birthdayDate!), 'gender': gender, 'size': size, if (notes != '') 'notes': notes, @@ -468,9 +508,12 @@ class BuscaEnconcomendas { final String? adresseeType, final String? status, }) async { - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getEncomendas'; final String baseUrl = PhpGroup.getBaseUrl(); @@ -512,9 +555,12 @@ class CancelaVisita { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'cancelaVisita'; return await ApiManager.instance.makeApiCall( @@ -546,8 +592,10 @@ class CancelaVisita { class DeleteAccount { Future call() async { - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; final String baseUrl = PhpGroup.getBaseUrl(); return await ApiManager.instance.makeApiCall( @@ -578,9 +626,12 @@ class ChangePanic { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'updVisitado'; return await ApiManager.instance.makeApiCall( @@ -614,9 +665,12 @@ class ChangePass { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'updVisitado'; return await ApiManager.instance.makeApiCall( @@ -650,9 +704,12 @@ class RespondeVinculo { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'respondeVinculo', @@ -684,9 +741,12 @@ class ChangeNotifica { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'updVisitado'; return await ApiManager.instance.makeApiCall( @@ -718,10 +778,14 @@ class UpdateIDE { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - final String newIde = (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String newIde = + (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; const String atividade = 'updVisitado'; return await ApiManager.instance.makeApiCall( @@ -753,9 +817,12 @@ class UpdToken { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String token = (await StorageHelper().get(SecureStorageKey.token.value)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String token = + (await StorageHelper().get(SecureStorageKey.token.value)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'updToken', @@ -782,11 +849,17 @@ class UpdToken { class LoginCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; - final String password = (await StorageHelper().get(SecureStorageKey.password.value)) ?? ''; - final String type = (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? ''; - final String description = (await StorageHelper().get(SecureStorageKey.deviceDescription.value)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String email = + (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; + final String password = + (await StorageHelper().get(SecureStorageKey.password.value)) ?? ''; + final String type = + (await StorageHelper().get(SecureStorageKey.deviceType.value)) ?? ''; + final String description = + (await StorageHelper().get(SecureStorageKey.deviceDescription.value)) ?? + ''; late final String token; try { token = await FirebaseMessagingService.getToken(); @@ -869,9 +942,12 @@ class ChangePasswordCall { required final String psswd, }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'changePassword', @@ -930,8 +1006,10 @@ class GetLocalsCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; - final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; + final String devUUID = + await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; + final String userUUID = + await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; return await ApiManager.instance .makeApiCall( @@ -972,9 +1050,12 @@ class PostScheduleVisitorCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'putVisitante'; return await ApiManager.instance.makeApiCall( @@ -1027,9 +1108,12 @@ class PostScheduleVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'putVisita'; return await ApiManager.instance.makeApiCall( @@ -1081,9 +1165,12 @@ class GetScheduleVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getVisitas'; return await ApiManager.instance.makeApiCall( @@ -1355,9 +1442,12 @@ class GetDadosCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getDados'; return await ApiManager.instance @@ -1393,7 +1483,8 @@ class GetDadosCall { response, r'''$.error_msg''', )); - String? visitedDesNomeStr(dynamic response) => castToType(getJsonField( + String? visitedDesNomeStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.DES_NOME''', )); @@ -1401,27 +1492,33 @@ class GetDadosCall { response, r'''$.visitado.VDO_ID''', )); - String? visitedVDOTNomeStr(dynamic response) => castToType(getJsonField( + String? visitedVDOTNomeStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_NOME''', )); - String? visitedVDOTipoStr(dynamic response) => castToType(getJsonField( + String? visitedVDOTipoStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_TIPO''', )); - String? visitedVDOImeiStr(dynamic response) => castToType(getJsonField( + String? visitedVDOImeiStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_IMEI''', )); - String? visitedVDODocumentoStr(dynamic response) => castToType(getJsonField( + String? visitedVDODocumentoStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_DOCUMENTO''', )); - String? visitedVDOEmailStr(dynamic response) => castToType(getJsonField( + String? visitedVDOEmailStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_EMAIL''', )); - String? visitedVDOStatusWebStr(dynamic response) => castToType(getJsonField( + String? visitedVDOStatusWebStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_STATUSWEB''', )); @@ -1469,7 +1566,8 @@ class GetDadosCall { response, r'''$.visitado.DES_ID''', )); - String? visitedVDoNotTerceirosStr(dynamic response) => castToType(getJsonField( + String? visitedVDoNotTerceirosStr(dynamic response) => + castToType(getJsonField( response, r'''$.visitado.VDO_NOTTERCEIROS''', )); @@ -1538,7 +1636,8 @@ class GetDadosCall { .map((x) => castToType(x)) .withoutNulls .toList(); - List? levelNACIndPermiteReentradaStrList(dynamic response) => (getJsonField( + List? levelNACIndPermiteReentradaStrList(dynamic response) => + (getJsonField( response, r'''$.niveis[:].NAC_INDPERMITEREENTRADA''', true, @@ -1556,7 +1655,8 @@ class GetDadosCall { .map((x) => castToType(x)) .withoutNulls .toList(); - List? levelNACTempoAntiCaronaStrList(dynamic response) => (getJsonField( + List? levelNACTempoAntiCaronaStrList(dynamic response) => + (getJsonField( response, r'''$.niveis[:].NAC_TEMPOANTICARONA''', true, @@ -1590,9 +1690,12 @@ class GetVisitorByDocCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getVisitante'; return await ApiManager.instance.makeApiCall( @@ -1644,9 +1747,12 @@ class GetFotoVisitanteCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getFotoVisitante'; return await ApiManager.instance.makeApiCall( @@ -1683,9 +1789,12 @@ class PostProvVisitSchedulingCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'putAgendamentoProv'; return await ApiManager.instance.makeApiCall( @@ -1732,9 +1841,12 @@ class GetVisitsCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getVisitas'; return await ApiManager.instance.makeApiCall( @@ -1995,9 +2107,12 @@ class DeleteVisitCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'cancelaVisita'; return await ApiManager.instance.makeApiCall( @@ -2038,10 +2153,14 @@ class GetPessoasLocalCall { Future call() async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String ownerUUID = + (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; return await ApiManager.instance.makeApiCall( callName: 'getPessoasLocal', @@ -2104,9 +2223,12 @@ class RespondeSolicitacaoCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'respondeSolicitacao'; return await ApiManager.instance.makeApiCall( @@ -2154,9 +2276,12 @@ class GetAccessCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getAcessos'; return await ApiManager.instance.makeApiCall( @@ -2403,9 +2528,12 @@ class GetLiberationsCall { final StreamController controller = StreamController(); Future.microtask(() async { - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getSolicitacoes'; try { @@ -2595,9 +2723,12 @@ class GetMessagesCall { }) async { final String baseUrl = PhpGroup.getBaseUrl(); - final String devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final String userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final String devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final String userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const String atividade = 'getMensagens'; return await ApiManager.instance.makeApiCall( @@ -2641,7 +2772,8 @@ class ApiPagingParams { }); @override - String toString() => 'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)'; + String toString() => + 'PagingParams(nextPageNumber: $nextPageNumber, numItems: $numItems, lastResponse: $lastResponse,)'; } String _toEncodable(dynamic item) { diff --git a/lib/features/backend/api_requests/api_manager.dart b/lib/features/backend/api_requests/api_manager.dart index 5e8f68bb..72087153 100644 --- a/lib/features/backend/api_requests/api_manager.dart +++ b/lib/features/backend/api_requests/api_manager.dart @@ -107,7 +107,9 @@ class ApiCallResponse { final Object? exception; bool get succeeded => statusCode >= 200 && statusCode < 300; String getHeader(String headerName) => headers[headerName] ?? ''; - String get bodyText => response?.body ?? (jsonBody is String ? jsonBody as String : jsonEncode(jsonBody)); + String get bodyText => + response?.body ?? + (jsonBody is String ? jsonBody as String : jsonEncode(jsonBody)); String get exceptionMessage => exception.toString(); static ApiCallResponse fromHttpResponse( @@ -121,7 +123,9 @@ class ApiCallResponse { if (bodyType == BodyType.BLOB) { jsonBody = response.bodyBytes; } else { - final responseBody = decodeUtf8 && returnBody ? const Utf8Decoder().convert(response.bodyBytes) : response.body; + final responseBody = decodeUtf8 && returnBody + ? const Utf8Decoder().convert(response.bodyBytes) + : response.body; jsonBody = returnBody ? json.decode(responseBody) : null; } } catch (_) {} @@ -133,7 +137,8 @@ class ApiCallResponse { ); } - static ApiCallResponse fromCloudCallResponse(Map response) => ApiCallResponse( + static ApiCallResponse fromCloudCallResponse(Map response) => + ApiCallResponse( response['body'], ApiManager.toStringMap(response['headers'] ?? {}), response['statusCode'] ?? 400, @@ -150,14 +155,17 @@ class ApiManager { static String? _accessToken; - static void clearCache(String callName) => - _apiCache.keys.toSet().forEach((k) => k.callName == callName ? _apiCache.remove(k) : null); + static void clearCache(String callName) => _apiCache.keys + .toSet() + .forEach((k) => k.callName == callName ? _apiCache.remove(k) : null); static Map toStringMap(Map map) => map.map((key, value) => MapEntry(key.toString(), value.toString())); - static String asQueryParams(Map map) => - map.entries.map((e) => "${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}").join('&'); + static String asQueryParams(Map map) => map.entries + .map((e) => + "${Uri.encodeComponent(e.key)}=${Uri.encodeComponent(e.value.toString())}") + .join('&'); static Future urlRequest( ApiCallType callType, @@ -171,13 +179,15 @@ class ApiManager { BodyType? bodyType, }) async { if (params.isNotEmpty) { - final specifier = Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?'; + final specifier = + Uri.parse(apiUrl).queryParameters.isNotEmpty ? '&' : '?'; apiUrl = '$apiUrl$specifier${asQueryParams(params)}'; } if (isStreamingApi) { client ??= http.Client(); - final request = http.Request(callType.toString().split('.').last, Uri.parse(apiUrl)) - ..headers.addAll(toStringMap(headers)); + final request = + http.Request(callType.toString().split('.').last, Uri.parse(apiUrl)) + ..headers.addAll(toStringMap(headers)); final streamedResponse = await getStreamedResponse(request); return ApiCallResponse( null, @@ -189,8 +199,10 @@ class ApiManager { final makeRequest = callType == ApiCallType.GET ? (client != null ? client.get : http.get) : (client != null ? client.delete : http.delete); - final response = await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers)); - return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType); + final response = + await makeRequest(Uri.parse(apiUrl), headers: toStringMap(headers)); + return ApiCallResponse.fromHttpResponse( + response, returnBody, decodeUtf8, bodyType); } static Future requestWithBody( @@ -212,11 +224,13 @@ class ApiManager { (alwaysAllowBody && type == ApiCallType.DELETE), 'Invalid ApiCallType $type for request with body', ); - final postBody = createBody(headers, params, body, bodyType, encodeBodyUtf8); + final postBody = + createBody(headers, params, body, bodyType, encodeBodyUtf8); if (isStreamingApi) { client ??= http.Client(); - final request = http.Request(type.toString().split('.').last, Uri.parse(apiUrl)) - ..headers.addAll(toStringMap(headers)); + final request = + http.Request(type.toString().split('.').last, Uri.parse(apiUrl)) + ..headers.addAll(toStringMap(headers)); request.body = postBody; final streamedResponse = await getStreamedResponse(request); return ApiCallResponse( @@ -228,7 +242,8 @@ class ApiManager { } if (bodyType == BodyType.MULTIPART) { - return multipartRequest(type, apiUrl, headers, params, returnBody, decodeUtf8, alwaysAllowBody, bodyType); + return multipartRequest(type, apiUrl, headers, params, returnBody, + decodeUtf8, alwaysAllowBody, bodyType); } final requestFn = { @@ -237,8 +252,10 @@ class ApiManager { ApiCallType.PATCH: client != null ? client.patch : http.patch, ApiCallType.DELETE: client != null ? client.delete : http.delete, }[type]!; - final response = await requestFn(Uri.parse(apiUrl), headers: toStringMap(headers), body: postBody); - return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType); + final response = await requestFn(Uri.parse(apiUrl), + headers: toStringMap(headers), body: postBody); + return ApiCallResponse.fromHttpResponse( + response, returnBody, decodeUtf8, bodyType); } static Future multipartRequest( @@ -258,14 +275,19 @@ class ApiManager { ); bool isFile(dynamic e) => - e is FFUploadedFile || e is List || (e is List && e.firstOrNull is FFUploadedFile); + e is FFUploadedFile || + e is List || + (e is List && e.firstOrNull is FFUploadedFile); - final nonFileParams = toStringMap(Map.fromEntries(params.entries.where((e) => !isFile(e.value)))); + final nonFileParams = toStringMap( + Map.fromEntries(params.entries.where((e) => !isFile(e.value)))); List files = []; params.entries.where((e) => isFile(e.value)).forEach((e) { final param = e.value; - final uploadedFiles = param is List ? param as List : [param as FFUploadedFile]; + final uploadedFiles = param is List + ? param as List + : [param as FFUploadedFile]; for (var uploadedFile in uploadedFiles) { files.add( http.MultipartFile.fromBytes( @@ -278,13 +300,15 @@ class ApiManager { } }); - final request = http.MultipartRequest(type.toString().split('.').last, Uri.parse(apiUrl)) + final request = http.MultipartRequest( + type.toString().split('.').last, Uri.parse(apiUrl)) ..headers.addAll(toStringMap(headers)) ..files.addAll(files); nonFileParams.forEach((key, value) => request.fields[key] = value); final response = await http.Response.fromStream(await request.send()); - return ApiCallResponse.fromHttpResponse(response, returnBody, decodeUtf8, bodyType); + return ApiCallResponse.fromHttpResponse( + response, returnBody, decodeUtf8, bodyType); } static MediaType? _getMediaType(String? filename) { @@ -333,10 +357,13 @@ class ApiManager { case null: break; } - if (contentType != null && !headers.keys.any((h) => h.toLowerCase() == 'content-type')) { + if (contentType != null && + !headers.keys.any((h) => h.toLowerCase() == 'content-type')) { headers['Content-Type'] = contentType; } - return encodeBodyUtf8 && postBody is String ? utf8.encode(postBody) : postBody; + return encodeBodyUtf8 && postBody is String + ? utf8.encode(postBody) + : postBody; } Future call(ApiCallOptions options) => makeApiCall( diff --git a/lib/features/backend/api_requests/get_streamed_response.dart b/lib/features/backend/api_requests/get_streamed_response.dart index 73280a05..1a53aab0 100644 --- a/lib/features/backend/api_requests/get_streamed_response.dart +++ b/lib/features/backend/api_requests/get_streamed_response.dart @@ -1,3 +1,4 @@ import 'package:http/http.dart'; -Future getStreamedResponse(Request request) => Client().send(request); +Future getStreamedResponse(Request request) => + Client().send(request); diff --git a/lib/features/backend/schema/enums/enums.dart b/lib/features/backend/schema/enums/enums.dart index 8f7ed174..cfef83fe 100644 --- a/lib/features/backend/schema/enums/enums.dart +++ b/lib/features/backend/schema/enums/enums.dart @@ -10,7 +10,8 @@ extension FFEnumExtensions on T { } extension FFEnumListExtensions on Iterable { - T? deserialize(String? value) => firstWhereOrNull((e) => e.serialize() == value); + T? deserialize(String? value) => + firstWhereOrNull((e) => e.serialize() == value); } T? deserializeEnum(String? value) { diff --git a/lib/features/backend/schema/structs/device_struct.dart b/lib/features/backend/schema/structs/device_struct.dart index 102703cb..db8a8896 100644 --- a/lib/features/backend/schema/structs/device_struct.dart +++ b/lib/features/backend/schema/structs/device_struct.dart @@ -41,7 +41,8 @@ class DeviceStruct extends BaseStruct { description: data['description'] as String?, ); - static DeviceStruct? maybeFromMap(dynamic data) => data is Map ? DeviceStruct.fromMap(data.cast()) : null; + static DeviceStruct? maybeFromMap(dynamic data) => + data is Map ? DeviceStruct.fromMap(data.cast()) : null; Map toMap() => { 'devUUID': _devUUID, @@ -65,7 +66,8 @@ class DeviceStruct extends BaseStruct { ), }.withoutNulls; - static DeviceStruct fromSerializableMap(Map data) => DeviceStruct( + static DeviceStruct fromSerializableMap(Map data) => + DeviceStruct( devUUID: deserializeParam( data['devUUID'], ParamType.String, @@ -88,11 +90,15 @@ class DeviceStruct extends BaseStruct { @override bool operator ==(Object other) { - return other is DeviceStruct && devUUID == other.devUUID && version == other.version && description == other.description; + return other is DeviceStruct && + devUUID == other.devUUID && + version == other.version && + description == other.description; } @override - int get hashCode => const ListEquality().hash([devUUID, version, description]); + int get hashCode => + const ListEquality().hash([devUUID, version, description]); } DeviceStruct createDeviceStruct({ diff --git a/lib/features/backend/schema/util/schema_util.dart b/lib/features/backend/schema/util/schema_util.dart index e969983e..18cc5548 100644 --- a/lib/features/backend/schema/util/schema_util.dart +++ b/lib/features/backend/schema/util/schema_util.dart @@ -33,7 +33,10 @@ dynamic deserializeStructParam( if (paramValues is! Iterable) { return null; } - return paramValues.map((e) => deserializeStructParam(e, paramType, false, structBuilder: structBuilder)).toList(); + return paramValues + .map((e) => deserializeStructParam(e, paramType, false, + structBuilder: structBuilder)) + .toList(); } else if (param is Map) { return structBuilder(param); } else { @@ -50,9 +53,16 @@ List? getStructList( dynamic value, StructBuilder structBuilder, ) => - value is! List ? null : value.whereType>().map((e) => structBuilder(e)).toList(); + value is! List + ? null + : value + .whereType>() + .map((e) => structBuilder(e)) + .toList(); -List? getEnumList(dynamic value) => value is! List ? null : value.map((e) => deserializeEnum(e)).withoutNulls; +List? getEnumList(dynamic value) => value is! List + ? null + : value.map((e) => deserializeEnum(e)).withoutNulls; Color? getSchemaColor(dynamic value) => value is String ? fromCssColor(value) @@ -60,6 +70,8 @@ Color? getSchemaColor(dynamic value) => value is String ? value : null; -List? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls; +List? getColorsList(dynamic value) => + value is! List ? null : value.map(getSchemaColor).withoutNulls; -List? getDataList(dynamic value) => value is! List ? null : value.map((e) => castToType(e)!).toList(); +List? getDataList(dynamic value) => + value is! List ? null : value.map((e) => castToType(e)!).toList(); diff --git a/lib/features/history/data/data_sources/local_data_sources/access_history_local_data_source.dart b/lib/features/history/data/data_sources/local_data_sources/access_history_local_data_source.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/data_sources/local_data_sources/access_history_local_data_source.dart +++ b/lib/features/history/data/data_sources/local_data_sources/access_history_local_data_source.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/data_sources/local_data_sources/provisional_history_local_data_source.dart b/lib/features/history/data/data_sources/local_data_sources/provisional_history_local_data_source.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/data_sources/local_data_sources/provisional_history_local_data_source.dart +++ b/lib/features/history/data/data_sources/local_data_sources/provisional_history_local_data_source.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/data_sources/remote_data_sources/access_history_remote_data_source.dart b/lib/features/history/data/data_sources/remote_data_sources/access_history_remote_data_source.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/data_sources/remote_data_sources/access_history_remote_data_source.dart +++ b/lib/features/history/data/data_sources/remote_data_sources/access_history_remote_data_source.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/data_sources/remote_data_sources/provisional_history_remote_data_source.dart b/lib/features/history/data/data_sources/remote_data_sources/provisional_history_remote_data_source.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/data_sources/remote_data_sources/provisional_history_remote_data_source.dart +++ b/lib/features/history/data/data_sources/remote_data_sources/provisional_history_remote_data_source.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/models/index.dart b/lib/features/history/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/models/index.dart +++ b/lib/features/history/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/repositories/access_history_repository_impl.dart b/lib/features/history/data/repositories/access_history_repository_impl.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/repositories/access_history_repository_impl.dart +++ b/lib/features/history/data/repositories/access_history_repository_impl.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/data/repositories/provisional_history_repository_impl.dart b/lib/features/history/data/repositories/provisional_history_repository_impl.dart index e69de29b..8b137891 100644 --- a/lib/features/history/data/repositories/provisional_history_repository_impl.dart +++ b/lib/features/history/data/repositories/provisional_history_repository_impl.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/domain/entities/index.dart b/lib/features/history/domain/entities/index.dart index e69de29b..8b137891 100644 --- a/lib/features/history/domain/entities/index.dart +++ b/lib/features/history/domain/entities/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/domain/respositories/history_repository.dart b/lib/features/history/domain/respositories/history_repository.dart index e69de29b..8b137891 100644 --- a/lib/features/history/domain/respositories/history_repository.dart +++ b/lib/features/history/domain/respositories/history_repository.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/domain/usecases/index.dart b/lib/features/history/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/history/domain/usecases/index.dart +++ b/lib/features/history/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/history/presentation/blocs/access_history_bloc.dart b/lib/features/history/presentation/blocs/access_history_bloc.dart index 61c1b9c4..9e5bd113 100644 --- a/lib/features/history/presentation/blocs/access_history_bloc.dart +++ b/lib/features/history/presentation/blocs/access_history_bloc.dart @@ -23,7 +23,8 @@ class AcessHistoryPageModel extends FlutterFlowModel { requestFn: requestFn, ); void clearAccessHistoryCache() => _accessHistoryManager.clear(); - void clearAccessHistoryCacheKey(String? uniqueKey) => _accessHistoryManager.clearRequest(uniqueKey); + void clearAccessHistoryCacheKey(String? uniqueKey) => + _accessHistoryManager.clearRequest(uniqueKey); @override void initState(BuildContext context) { @@ -32,8 +33,10 @@ class AcessHistoryPageModel extends FlutterFlowModel { Future initDatabase() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override diff --git a/lib/features/history/presentation/blocs/provisional_history_bloc.dart b/lib/features/history/presentation/blocs/provisional_history_bloc.dart index 8dfd7315..3c6b0d9e 100644 --- a/lib/features/history/presentation/blocs/provisional_history_bloc.dart +++ b/lib/features/history/presentation/blocs/provisional_history_bloc.dart @@ -33,8 +33,11 @@ class ProvisionalHistoryStateBloc { } } -class ProvisionalHistoryBloc extends Bloc { - ProvisionalHistoryBloc() : super(ProvisionalHistoryStateBloc(devUUID: '', userUUID: '', cliUUID: '')) { +class ProvisionalHistoryBloc + extends Bloc { + ProvisionalHistoryBloc() + : super(ProvisionalHistoryStateBloc( + devUUID: '', userUUID: '', cliUUID: '')) { on(_onLoadProvisionalHistory); } @@ -43,9 +46,16 @@ class ProvisionalHistoryBloc extends Bloc emit, ) async { emit(state.copyWith(isLoading: true)); - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - emit(state.copyWith(devUUID: devUUID, userUUID: userUUID, cliUUID: cliUUID, isLoading: false)); + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + emit(state.copyWith( + devUUID: devUUID, + userUUID: userUUID, + cliUUID: cliUUID, + isLoading: false)); } } diff --git a/lib/features/history/presentation/pages/acess_history_page_widget.dart b/lib/features/history/presentation/pages/acess_history_page_widget.dart index 4c11f7f7..b97d5450 100644 --- a/lib/features/history/presentation/pages/acess_history_page_widget.dart +++ b/lib/features/history/presentation/pages/acess_history_page_widget.dart @@ -41,7 +41,8 @@ class _AccessHistoryState extends State { late Future _accessFuture; List _accessWrap = []; - _AccessHistoryState(Map opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { + _AccessHistoryState(Map opt) + : selectedTypeSubject = BehaviorSubject.seeded(opt) { selectedTypeSubject.listen((value) {}); } @@ -53,7 +54,8 @@ class _AccessHistoryState extends State { _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMoreAccess(); } }); @@ -113,7 +115,8 @@ class _AccessHistoryState extends State { color: theme.primaryText, fontSize: 16.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } @@ -127,37 +130,40 @@ class _AccessHistoryState extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.of(context).pop(), - child: Container( - color: Colors.transparent, - child: GestureDetector( - onTap: () {}, - child: FilterWidget( - defaultSelections: selectedTypeSubject.value, - filterOptions: { - 'personType': [ - { - 'title': FFLocalizations.of(context).getText('zok7lu4w'), - 'value': 'E', + final Map? selectedFilter = + await showModalBottomSheet>( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + color: Colors.transparent, + child: GestureDetector( + onTap: () {}, + child: FilterWidget( + defaultSelections: selectedTypeSubject.value, + filterOptions: { + 'personType': [ + { + 'title': FFLocalizations.of(context) + .getText('zok7lu4w'), + 'value': 'E', + }, + { + 'title': FFLocalizations.of(context) + .getText('oonqk812'), + 'value': 'O', + }, + ], }, - { - 'title': FFLocalizations.of(context).getText('oonqk812'), - 'value': 'O', - }, - ], - }, - filterTitles: {'personType': ''}, + filterTitles: {'personType': ''}, + ), + ), ), - ), - ), - ); - }); + ); + }); if (selectedFilter != null) { _updateAccessHistoryAction(selectedFilter); @@ -200,7 +206,8 @@ class _AccessHistoryState extends State { final List accessHistory = response.jsonBody['acessos'] ?? []; List filteredAccess = accessHistory.where((item) { - final personTypeMatches = _personType == '.*' || item["PES_TIPO"].toString() == _personType; + final personTypeMatches = + _personType == '.*' || item["PES_TIPO"].toString() == _personType; return personTypeMatches; }).toList(); @@ -233,7 +240,8 @@ class _AccessHistoryState extends State { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -257,7 +265,9 @@ class _AccessHistoryState extends State { children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText(ptText: "Nenhum histórico encontrado!", enText: "No history found!"), + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum histórico encontrado!", + enText: "No history found!"), )), ], ), @@ -297,7 +307,8 @@ class _AccessHistoryState extends State { return FutureBuilder( future: _accessFuture, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting && _accessWrap.isEmpty) { + if (snapshot.connectionState == ConnectionState.waiting && + _accessWrap.isEmpty) { return Center( child: SizedBox( width: 50.0, @@ -310,7 +321,9 @@ class _AccessHistoryState extends State { ); } else if (snapshot.hasError) { return Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Falha ao efetuar operação!", enText: "Failed to perform operation!")), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação!", + enText: "Failed to perform operation!")), ); } @@ -328,7 +341,8 @@ class _AccessHistoryState extends State { ); } - Widget _accessHistoryCardMoleculeWidget(BuildContext context, dynamic accessHistoryItem) { + Widget _accessHistoryCardMoleculeWidget( + BuildContext context, dynamic accessHistoryItem) { return CardItemTemplateComponentWidget( imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=${_model.cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}', diff --git a/lib/features/history/presentation/pages/provisional_history_page.dart b/lib/features/history/presentation/pages/provisional_history_page.dart index 02aca8be..b32b2798 100644 --- a/lib/features/history/presentation/pages/provisional_history_page.dart +++ b/lib/features/history/presentation/pages/provisional_history_page.dart @@ -20,7 +20,8 @@ import 'package:rxdart/rxdart.dart'; // ignore: must_be_immutable class ProvisionalHistoryPage extends StatefulWidget { Map opt; - ProvisionalHistoryPage({super.key, Map? opt}) : opt = opt ?? const {'AGP_STATUS': '.*'}; + ProvisionalHistoryPage({super.key, Map? opt}) + : opt = opt ?? const {'AGP_STATUS': '.*'}; @override State createState() => ProvisionalHistoryState(opt); } @@ -40,7 +41,8 @@ class ProvisionalHistoryState extends State { late Future future; List wrap = []; - ProvisionalHistoryState(Map opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { + ProvisionalHistoryState(Map opt) + : selectedTypeSubject = BehaviorSubject.seeded(opt) { selectedTypeSubject.listen((value) {}); } @@ -50,7 +52,8 @@ class ProvisionalHistoryState extends State { future = fetchHistoryService(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -112,7 +115,8 @@ class ProvisionalHistoryState extends State { color: theme.primaryText, fontSize: 16.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } @@ -126,57 +130,62 @@ class ProvisionalHistoryState extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.of(context).pop(), - child: Container( - color: Colors.transparent, - child: GestureDetector( - onTap: () {}, - child: FilterWidget( - defaultSelections: selectedTypeSubject.value, - filterOptions: { - 'AGP_STATUS': [ - { - 'title': FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ), - 'value': 'AT', + final Map? selectedFilter = + await showModalBottomSheet>( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + color: Colors.transparent, + child: GestureDetector( + onTap: () {}, + child: FilterWidget( + defaultSelections: selectedTypeSubject.value, + filterOptions: { + 'AGP_STATUS': [ + { + 'title': FFLocalizations.of(context) + .getVariableText( + ptText: 'Ativo', + enText: 'Active', + ), + 'value': 'AT', + }, + { + 'title': FFLocalizations.of(context) + .getVariableText( + ptText: 'Convidado', + enText: 'Guest', + ), + 'value': 'CO', + }, + { + 'title': FFLocalizations.of(context) + .getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ), + 'value': 'IN', + }, + { + 'title': FFLocalizations.of(context) + .getVariableText( + ptText: 'Aguardando Aprovação', + enText: 'Awaiting Approval', + ), + 'value': 'AA', + }, + ], }, - { - 'title': FFLocalizations.of(context).getVariableText( - ptText: 'Convidado', - enText: 'Guest', - ), - 'value': 'CO', - }, - { - 'title': FFLocalizations.of(context).getVariableText( - ptText: 'Inativo', - enText: 'Inactive', - ), - 'value': 'IN', - }, - { - 'title': FFLocalizations.of(context).getVariableText( - ptText: 'Aguardando Aprovação', - enText: 'Awaiting Approval', - ), - 'value': 'AA', - }, - ], - }, - filterTitles: {'AGP_STATUS': ''}, + filterTitles: {'AGP_STATUS': ''}, + ), + ), ), - ), - ), - ); - }); + ); + }); if (selectedFilter != null) { _updateHistoryAction(selectedFilter); @@ -210,9 +219,11 @@ class ProvisionalHistoryState extends State { Future fetchHistoryService() async { try { setState(() => _loading = true); - var response = await PhpGroup.getProvSchedules(_pageNumber.toString(), status); + var response = + await PhpGroup.getProvSchedules(_pageNumber.toString(), status); - final List history = response.jsonBody['agendamento']['value'] ?? []; + final List history = + response.jsonBody['agendamento']['value'] ?? []; if (history.isNotEmpty) { setState(() { @@ -251,7 +262,9 @@ class ProvisionalHistoryState extends State { children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText(ptText: "Nenhum histórico encontrado!", enText: "No history found!"), + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum histórico encontrado!", + enText: "No history found!"), )), ], ), @@ -291,7 +304,8 @@ class ProvisionalHistoryState extends State { return FutureBuilder( future: future, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting && wrap.isEmpty) { + if (snapshot.connectionState == ConnectionState.waiting && + wrap.isEmpty) { return Center( child: SizedBox( width: 50.0, @@ -304,7 +318,9 @@ class ProvisionalHistoryState extends State { ); } else if (snapshot.hasError) { return Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Falha ao efetuar operação!", enText: "Failed to perform operation!")), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação!", + enText: "Failed to perform operation!")), ); } @@ -338,7 +354,8 @@ class ProvisionalHistoryState extends State { ); } - Map _buildLabelsHashMap(BuildContext context, dynamic historyItem) { + Map _buildLabelsHashMap( + BuildContext context, dynamic historyItem) { return { FFLocalizations.of(context).getVariableText( ptText: 'Nome:', @@ -370,7 +387,8 @@ class ProvisionalHistoryState extends State { return "${dateTime.day.toString().padLeft(2, '0')}/${dateTime.month.toString().padLeft(2, '0')}/${dateTime.year} ${dateTime.hour.toString().padLeft(2, '0')}:${dateTime.minute.toString().padLeft(2, '0')}"; } - List> _buildStatusHashMap(BuildContext context, dynamic historyItem) { + List> _buildStatusHashMap( + BuildContext context, dynamic historyItem) { return [ { FFLocalizations.of(context).getVariableText( diff --git a/lib/features/history/presentation/widgets/access_filter_modal.dart b/lib/features/history/presentation/widgets/access_filter_modal.dart index 85a5ecbb..1346fe8b 100644 --- a/lib/features/history/presentation/widgets/access_filter_modal.dart +++ b/lib/features/history/presentation/widgets/access_filter_modal.dart @@ -20,7 +20,8 @@ class AccessFilterModel extends FlutterFlowModel { // State field(s) for CheckboxGroup widget. FormFieldController>? checkboxGroupValueController; List? get checkboxGroupValues => checkboxGroupValueController?.value; - set checkboxGroupValues(List? v) => checkboxGroupValueController?.value = v; + set checkboxGroupValues(List? v) => + checkboxGroupValueController?.value = v; @override void initState(BuildContext context) {} @@ -71,8 +72,12 @@ class _AccessFilterState extends State { _model.textFieldFocusNode ??= FocusNode(); selected = { - 'personType': widget.defaultPersonType == '.*' ? ['E', 'O'] : [widget.defaultPersonType], - 'accessType': widget.defaultAccessType == '.*' ? ['0', '1'] : [widget.defaultAccessType], + 'personType': widget.defaultPersonType == '.*' + ? ['E', 'O'] + : [widget.defaultPersonType], + 'accessType': widget.defaultAccessType == '.*' + ? ['0', '1'] + : [widget.defaultAccessType], 'search': '.*', }; } @@ -81,7 +86,9 @@ class _AccessFilterState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(), + 'search': _model.textController?.text == '' + ? '.*' + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -104,7 +111,8 @@ class _AccessFilterState extends State { context.pop(filterResult); } - Widget _buildCheckboxListTile(String key, List> options, double fontsize) { + Widget _buildCheckboxListTile( + String key, List> options, double fontsize) { double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); return Column( children: [ @@ -121,7 +129,8 @@ class _AccessFilterState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: limitedInputFontSize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -141,7 +150,8 @@ class _AccessFilterState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontSize: limitedInputFontSize, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -168,7 +178,8 @@ class _AccessFilterState extends State { width: 5, color: FlutterFlowTheme.of(context).secondaryText, ), - controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha + controlAffinity: + ListTileControlAffinity.leading, // Adiciona esta linha ); }, ), @@ -211,16 +222,24 @@ class _AccessFilterState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 10.0, 0.0, 10.0), child: Text( - FFLocalizations.of(context).getText('yfj9pd6k'), // Filtros - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + FFLocalizations.of(context) + .getText('yfj9pd6k'), // Filtros + style: FlutterFlowTheme.of(context) + .headlineMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), + fontSize: + LimitedFontSizeUtil.getHeaderFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .headlineMediumFamily), ), ), ), @@ -233,7 +252,8 @@ class _AccessFilterState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - _buildCheckboxListTile('personType', personTypeOptions, 14), + _buildCheckboxListTile( + 'personType', personTypeOptions, 14), ], ), ), @@ -247,12 +267,15 @@ class _AccessFilterState extends State { ), child: Text(FFLocalizations.of(context).getText('88kshkph'), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).info, - fontSize: LimitedFontSizeUtil.getInputFontSize(context), + fontSize: + LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), )), ), ], diff --git a/lib/features/history/presentation/widgets/provisional_filter_modal.dart b/lib/features/history/presentation/widgets/provisional_filter_modal.dart index c06612ab..44d0f538 100644 --- a/lib/features/history/presentation/widgets/provisional_filter_modal.dart +++ b/lib/features/history/presentation/widgets/provisional_filter_modal.dart @@ -17,7 +17,8 @@ class FilterModel extends FlutterFlowModel { bool? checkboxValue2; FormFieldController>? checkboxGroupValueController; List? get checkboxGroupValues => checkboxGroupValueController?.value; - set checkboxGroupValues(List? v) => checkboxGroupValueController?.value = v; + set checkboxGroupValues(List? v) => + checkboxGroupValueController?.value = v; @override void initState(BuildContext context) {} @@ -69,11 +70,15 @@ class _FilterWidgetState extends State { void _applyFilter() { Map filterResult = { - 'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(), + 'search': _model.textController?.text == '' + ? '.*' + : _model.textController!.text.toLowerCase(), }; widget.filterOptions.forEach((key, options) { - filterResult[key] = selected[key]!.isEmpty || selected[key]!.length < 1 ? '.*' : selected[key]!; + filterResult[key] = selected[key]!.isEmpty || selected[key]!.length < 1 + ? '.*' + : selected[key]!; }); setState(() { // Update the state with the new filter result @@ -82,7 +87,8 @@ class _FilterWidgetState extends State { context.pop(filterResult); } - Widget _buildCheckboxListTile(String key, List> options, double fontsize) { + Widget _buildCheckboxListTile( + String key, List> options, double fontsize) { double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); return Column( children: [ @@ -99,7 +105,8 @@ class _FilterWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: limitedInputFontSize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -119,7 +126,8 @@ class _FilterWidgetState extends State { fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontSize: limitedInputFontSize, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, ), ), @@ -175,19 +183,26 @@ class _FilterWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 10.0, 0.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 10.0, 0.0, 10.0), child: Text( FFLocalizations.of(context).getVariableText( ptText: 'Filtros', enText: 'Filters', ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, + style: FlutterFlowTheme.of(context) + .headlineMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), + fontSize: + LimitedFontSizeUtil.getHeaderFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .headlineMediumFamily), ), ), ), @@ -200,7 +215,8 @@ class _FilterWidgetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: widget.filterOptions.keys.map((key) { - return _buildCheckboxListTile(key, widget.filterOptions[key]!, 14); + return _buildCheckboxListTile( + key, widget.filterOptions[key]!, 14); }).toList(), ), ), @@ -218,12 +234,15 @@ class _FilterWidgetState extends State { enText: 'Apply', ), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).info, - fontSize: LimitedFontSizeUtil.getInputFontSize(context), + fontSize: + LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), )), ), ], diff --git a/lib/features/home/data/data_sources/index.dart b/lib/features/home/data/data_sources/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/data/data_sources/index.dart +++ b/lib/features/home/data/data_sources/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/data/models/index.dart b/lib/features/home/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/data/models/index.dart +++ b/lib/features/home/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/data/repositories/index.dart b/lib/features/home/data/repositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/data/repositories/index.dart +++ b/lib/features/home/data/repositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/domain/entities/index.dart b/lib/features/home/domain/entities/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/domain/entities/index.dart +++ b/lib/features/home/domain/entities/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/domain/respositories/index.dart b/lib/features/home/domain/respositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/domain/respositories/index.dart +++ b/lib/features/home/domain/respositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/domain/usecases/index.dart b/lib/features/home/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/domain/usecases/index.dart +++ b/lib/features/home/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/home/presentation/blocs/home_bloc.dart b/lib/features/home/presentation/blocs/home_bloc.dart index 3eb2219b..32efb9ab 100644 --- a/lib/features/home/presentation/blocs/home_bloc.dart +++ b/lib/features/home/presentation/blocs/home_bloc.dart @@ -17,11 +17,16 @@ class HomeBloc extends Bloc { } Future _onHomeEvent(HomeEvent event, Emitter emit) async { - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - final userName = (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; - final userEmail = (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final userName = + (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; + final userEmail = + (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; emit(state.copyWith( devUUID: devUUID, diff --git a/lib/features/home/presentation/pages/about_system.dart b/lib/features/home/presentation/pages/about_system.dart index a9d0ddb6..26fb1b72 100644 --- a/lib/features/home/presentation/pages/about_system.dart +++ b/lib/features/home/presentation/pages/about_system.dart @@ -54,7 +54,8 @@ class _AboutSystemPageState extends State { ); } - PreferredSizeWidget _buildAppBar(BuildContext context, FlutterFlowTheme theme) { + PreferredSizeWidget _buildAppBar( + BuildContext context, FlutterFlowTheme theme) { return AppBar( backgroundColor: theme.primaryBackground, automaticallyImplyLeading: false, @@ -91,7 +92,8 @@ class _AboutSystemPageState extends State { color: theme.primaryText, fontSize: 16.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } @@ -148,7 +150,8 @@ class _AboutSystemPageState extends State { color: theme.primaryText, fontSize: 16.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + useGoogleFonts: + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } diff --git a/lib/features/home/presentation/pages/home_page.dart b/lib/features/home/presentation/pages/home_page.dart index a4e20486..b11c8bdd 100644 --- a/lib/features/home/presentation/pages/home_page.dart +++ b/lib/features/home/presentation/pages/home_page.dart @@ -17,7 +17,8 @@ class HomePageWidget extends StatefulWidget { State createState() => _HomePageWidgetState(); } -class _HomePageWidgetState extends State with WidgetsBindingObserver { +class _HomePageWidgetState extends State + with WidgetsBindingObserver { final scaffoldKey = GlobalKey(); @override @@ -97,7 +98,8 @@ class _HomePageWidgetState extends State with WidgetsBindingObse fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, color: FlutterFlowTheme.of(context).info, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ].divide(const SizedBox(width: 8.0)), diff --git a/lib/features/home/presentation/widgets/drawer_widget.dart b/lib/features/home/presentation/widgets/drawer_widget.dart index 1a0ac823..9e681c10 100644 --- a/lib/features/home/presentation/widgets/drawer_widget.dart +++ b/lib/features/home/presentation/widgets/drawer_widget.dart @@ -28,7 +28,8 @@ class DrawerWidget extends StatelessWidget { } else if (!snapshot.hasData || snapshot.data! == false) { return Center( child: Padding( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 10), + padding: + EdgeInsets.only(top: MediaQuery.of(context).size.height / 10), child: CircularProgressIndicator( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primary, @@ -93,9 +94,11 @@ class DrawerWidget extends StatelessWidget { height: 80.0, fit: BoxFit.cover, alignment: Alignment.center, - placeholder: (context, url) => Image.asset('assets/images/person.jpg'), + placeholder: (context, url) => + Image.asset('assets/images/person.jpg'), errorListener: (_) => Image.asset('assets/images/person.jpg'), - errorWidget: (_, __, ___) => Image.asset('assets/images/person.jpg'), + errorWidget: (_, __, ___) => + Image.asset('assets/images/person.jpg'), ), ), ), @@ -142,7 +145,8 @@ class DrawerWidget extends StatelessWidget { return Padding( padding: const EdgeInsets.symmetric(vertical: 10.0), child: TextFormField( - controller: TextEditingController(), // Replace with appropriate controller + controller: + TextEditingController(), // Replace with appropriate controller focusNode: FocusNode(), // Replace with appropriate focus node autofocus: false, obscureText: false, diff --git a/lib/features/home/presentation/widgets/index.dart b/lib/features/home/presentation/widgets/index.dart index e69de29b..8b137891 100644 --- a/lib/features/home/presentation/widgets/index.dart +++ b/lib/features/home/presentation/widgets/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/locals/data/data_sources/locals_remote_data_source.dart b/lib/features/locals/data/data_sources/locals_remote_data_source.dart index 7ccea96d..3b656e62 100644 --- a/lib/features/locals/data/data_sources/locals_remote_data_source.dart +++ b/lib/features/locals/data/data_sources/locals_remote_data_source.dart @@ -24,7 +24,8 @@ abstract class LocalsRemoteDataSource { } class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { - static final LocalsRemoteDataSourceImpl _instance = LocalsRemoteDataSourceImpl._internal(); + static final LocalsRemoteDataSourceImpl _instance = + LocalsRemoteDataSourceImpl._internal(); factory LocalsRemoteDataSourceImpl() => _instance; LocalsRemoteDataSourceImpl._internal(); @@ -50,7 +51,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { final List locals = response.jsonBody['locais'] ?? []; final bool isEmpty = locals.isEmpty; - final bool isActive = locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty; + final bool isActive = + locals.where((local) => local['CLU_STATUS'] != 'B').isNotEmpty; final bool isEnable = !isEmpty && isActive; if (isEnable) { @@ -95,7 +97,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { final bool isInactived = await LocalUtil.isInactived(locals); final bool isPending = LocalUtil.isPending(locals); final bool isUnique = locals.length == 1; - final bool isBlocked = locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty; + final bool isBlocked = + locals.where((local) => local['CLU_STATUS'] == 'B').isNotEmpty; final bool isEnabled = isUnique && isActive; final bool isDisabled = isUnique && isBlocked; final bool isUnselected = await LocalUtil.isUnselected(); @@ -142,8 +145,10 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { @override Future checkLocals(BuildContext context) async { - String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + String cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; return cliUUID.isEmpty && cliName.isEmpty; } @@ -167,7 +172,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { if (isError == true) { final GetLocalsCall callback = PhpGroup.getLocalsCall; response = await callback.call(); - final String errorMsg = response.jsonBody['error_msg'] ?? 'Local indisponível'; + final String errorMsg = + response.jsonBody['error_msg'] ?? 'Local indisponível'; // await DialogUtil.error(context, errorMsg).whenComplete(() async => await selectLocal(context, response)); return false; } else { @@ -186,7 +192,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { } @override - Future selectLocal(BuildContext context, ApiCallResponse? response) async { + Future selectLocal( + BuildContext context, ApiCallResponse? response) async { return await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -220,7 +227,8 @@ class LocalsRemoteDataSourceImpl implements LocalsRemoteDataSource { await StorageHelper().set(ProfileStorageKey.ownerName.key, ''); await StorageHelper().set(ProfileStorageKey.clientUUID.key, ''); context.pop(); - context.go('/homePage', extra: {'update': LocalsRepositoryImpl().update}); + context.go('/homePage', + extra: {'update': LocalsRepositoryImpl().update}); SnackBarUtil.showSnackBar(context, content); } }).catchError((err, stack) { diff --git a/lib/features/locals/data/models/index.dart b/lib/features/locals/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/locals/data/models/index.dart +++ b/lib/features/locals/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/locals/data/repositories/locals_repository_impl.dart b/lib/features/locals/data/repositories/locals_repository_impl.dart index 74d8fb55..5957c051 100644 --- a/lib/features/locals/data/repositories/locals_repository_impl.dart +++ b/lib/features/locals/data/repositories/locals_repository_impl.dart @@ -37,8 +37,10 @@ class LocalsRepositoryImpl implements LocalsRepository { } Future check(BuildContext context) async { - final String? cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key); - final String? ownerUUID = await StorageHelper().get(ProfileStorageKey.ownerUUID.key); + final String? cliUUID = + await StorageHelper().get(ProfileStorageKey.clientUUID.key); + final String? ownerUUID = + await StorageHelper().get(ProfileStorageKey.ownerUUID.key); final bool haveCli = cliUUID != null && cliUUID.isNotEmpty; final bool haveOwner = ownerUUID != null && ownerUUID.isNotEmpty; if (!haveCli && !haveOwner) { diff --git a/lib/features/locals/domain/entities/index.dart b/lib/features/locals/domain/entities/index.dart index e69de29b..8b137891 100644 --- a/lib/features/locals/domain/entities/index.dart +++ b/lib/features/locals/domain/entities/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/locals/domain/usecases/index.dart b/lib/features/locals/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/locals/domain/usecases/index.dart +++ b/lib/features/locals/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/locals/index.dart b/lib/features/locals/index.dart index c6e39062..804475c2 100644 --- a/lib/features/locals/index.dart +++ b/lib/features/locals/index.dart @@ -1,4 +1,4 @@ export 'data/index.dart'; export 'domain/index.dart'; export 'presentation/index.dart'; -export 'utils/index.dart'; \ No newline at end of file +export 'utils/index.dart'; diff --git a/lib/features/locals/presentation/blocs/local_profile_bloc.dart b/lib/features/locals/presentation/blocs/local_profile_bloc.dart index 69201d30..60b9b720 100644 --- a/lib/features/locals/presentation/blocs/local_profile_bloc.dart +++ b/lib/features/locals/presentation/blocs/local_profile_bloc.dart @@ -15,9 +15,11 @@ class LocalProfileState { final String cliUUID; final String ownerName; - LocalProfileState({this.cliName = '', this.cliUUID = '', this.ownerName = ''}); + LocalProfileState( + {this.cliName = '', this.cliUUID = '', this.ownerName = ''}); - LocalProfileState copyWith({String? cliName, String? ownerName, String? cliUUID}) { + LocalProfileState copyWith( + {String? cliName, String? ownerName, String? cliUUID}) { return LocalProfileState( cliName: cliName ?? this.cliName, ownerName: ownerName ?? this.ownerName, @@ -36,11 +38,16 @@ class LocalProfileBloc extends Bloc { }); } - Future _onLocalProfileEvent(LocalProfileEvent event, Emitter emit) async { - final cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; - final ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - emit(state.copyWith(cliName: cliName, cliUUID: cliUUID, ownerName: ownerName)); + Future _onLocalProfileEvent( + LocalProfileEvent event, Emitter emit) async { + final cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + final ownerName = + (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + emit(state.copyWith( + cliName: cliName, cliUUID: cliUUID, ownerName: ownerName)); } // void updateProfile(BuildContext context) { @@ -51,7 +58,8 @@ class LocalProfileBloc extends Bloc { // } } -class LocalProfileComponentModel extends FlutterFlowModel { +class LocalProfileComponentModel + extends FlutterFlowModel { String cliName = ''; String cliUUID = ''; String ownerName = ''; @@ -63,9 +71,12 @@ class LocalProfileComponentModel extends FlutterFlowModel getData() async { - cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; - ownerName = (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + ownerName = + (await StorageHelper().get(ProfileStorageKey.ownerName.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; setStateCallback?.call(); } diff --git a/lib/features/locals/presentation/widgets/index.dart b/lib/features/locals/presentation/widgets/index.dart index e0361f45..2b0fd4c4 100644 --- a/lib/features/locals/presentation/widgets/index.dart +++ b/lib/features/locals/presentation/widgets/index.dart @@ -1 +1 @@ -export 'local_profile/index.dart'; \ No newline at end of file +export 'local_profile/index.dart'; diff --git a/lib/features/locals/presentation/widgets/local_profile/local_profile_widget.dart b/lib/features/locals/presentation/widgets/local_profile/local_profile_widget.dart index cf343964..e3db9435 100644 --- a/lib/features/locals/presentation/widgets/local_profile/local_profile_widget.dart +++ b/lib/features/locals/presentation/widgets/local_profile/local_profile_widget.dart @@ -12,10 +12,12 @@ class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({super.key}); @override - State createState() => _LocalProfileComponentWidgetState(); + State createState() => + _LocalProfileComponentWidgetState(); } -class _LocalProfileComponentWidgetState extends State { +class _LocalProfileComponentWidgetState + extends State { bool _isLoading = false; Future retrieveProfileInfo() async { @@ -36,7 +38,8 @@ class _LocalProfileComponentWidgetState extends State 20 ? 12 : scaledFontSize; + final double limitedFontSize = + scaledFontSize > 20 ? 12 : scaledFontSize; if (snapshot.connectionState == ConnectionState.waiting) { return const Center(child: CircularProgressIndicator()); } else if (snapshot.hasError) { @@ -58,7 +61,8 @@ class _LocalProfileComponentWidgetState extends State Image.asset('assets/images/home.png'), - errorListener: (_) => Image.asset('assets/images/home.png'), - errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'), + placeholder: (context, url) => + Image.asset('assets/images/home.png'), + errorListener: (_) => + Image.asset('assets/images/home.png'), + errorWidget: (_, __, ___) => + Image.asset('assets/images/home.png'), ), )), ), @@ -130,12 +137,16 @@ class _LocalProfileComponentWidgetState extends State Image.asset('assets/images/home.png'), - errorListener: (_) => Image.asset('assets/images/home.png'), - errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'), + placeholder: (context, url) => + Image.asset('assets/images/home.png'), + errorListener: (_) => + Image.asset('assets/images/home.png'), + errorWidget: (_, __, ___) => + Image.asset('assets/images/home.png'), ), )), ), @@ -219,36 +236,50 @@ class _LocalProfileComponentWidgetState extends State(' ' + state.ownerName, ''), + message: + valueOrDefault(' ' + state.ownerName, ''), child: Text( - valueOrDefault(state.ownerName.length > 30 ? '${state.ownerName.substring(0, 20)}...' : state.ownerName, ''), + valueOrDefault( + state.ownerName.length > 30 + ? '${state.ownerName.substring(0, 20)}...' + : state.ownerName, + ''), overflow: TextOverflow.ellipsis, maxLines: 1, - style: FlutterFlowTheme.of(context).labelMedium.override( + style: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).info, fontSize: limitedFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), ), ), ), ], ), ), - ].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 20.0)) + .addToEnd(const SizedBox(width: 20.0)), ), ), ), diff --git a/lib/features/locals/utils/local_util.dart b/lib/features/locals/utils/local_util.dart index 45438432..0aa0cb85 100644 --- a/lib/features/locals/utils/local_util.dart +++ b/lib/features/locals/utils/local_util.dart @@ -11,10 +11,13 @@ import 'package:hub/shared/utils/log_util.dart'; class LocalUtil { static void handleError(BuildContext context, String errorMsg) async { - final String devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; - final String userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; + final String devUUID = + await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; + final String userUUID = + await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; final bool isAuthenticated = userUUID.isNotEmpty && devUUID.isNotEmpty; - final bool isDevLinked = !errorMsg.contains('Esse dispositivo nao pertence a esse usuario'); + final bool isDevLinked = + !errorMsg.contains('Esse dispositivo nao pertence a esse usuario'); log('() => isLinked: $errorMsg'); if (!isAuthenticated) { errorMsg = FFLocalizations.of(context).getVariableText( @@ -36,13 +39,18 @@ class LocalUtil { // await DialogUtil.error(context, errorMsg).whenComplete(() async => await LocalsRemoteDataSourceImpl().selectLocal(context, null)); } - static Future handleUnavailable(BuildContext context, List locals) async { + static Future handleUnavailable( + BuildContext context, List locals) async { log('() => isUnavailable'); try { - await StorageHelper().set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']); - await StorageHelper().set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']); - await StorageHelper().set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']); - await StorageHelper().set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']); + await StorageHelper() + .set(ProfileStorageKey.clientUUID.key, locals[0]['CLI_ID']); + await StorageHelper() + .set(ProfileStorageKey.ownerUUID.key, locals[0]['CLU_OWNER_ID']); + await StorageHelper() + .set(ProfileStorageKey.clientName.key, locals[0]['CLI_NOME']); + await StorageHelper() + .set(ProfileStorageKey.ownerName.key, locals[0]['CLU_OWNER_DSC']); var response = await PhpGroup.resopndeVinculo.call(tarefa: 'A'); if (response.jsonBody['error'] == true) { @@ -53,10 +61,14 @@ class LocalUtil { return false; } - if (response.jsonBody['error'] == false) return await LocalsRemoteDataSourceImpl().processData(context).then((value) => value); + if (response.jsonBody['error'] == false) + return await LocalsRemoteDataSourceImpl() + .processData(context) + .then((value) => value); } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vínculo', e, s); + LogUtil.requestAPIFailed( + 'responderVinculo.php', '', 'Responder Vínculo', e, s); return false; } return false; @@ -64,11 +76,16 @@ class LocalUtil { static Future handleEnabled(BuildContext context, dynamic local) async { log('() => isEnabled'); - await StorageHelper().set(ProfileStorageKey.clientUUID.key, local['CLI_ID']); - await StorageHelper().set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']); - await StorageHelper().set(ProfileStorageKey.clientName.key, local['CLI_NOME']); - await StorageHelper().set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']); - await StorageHelper().set(ProfileStorageKey.userName.key, local['USU_NOME']); + await StorageHelper() + .set(ProfileStorageKey.clientUUID.key, local['CLI_ID']); + await StorageHelper() + .set(ProfileStorageKey.ownerUUID.key, local['CLU_OWNER_ID']); + await StorageHelper() + .set(ProfileStorageKey.clientName.key, local['CLI_NOME']); + await StorageHelper() + .set(ProfileStorageKey.ownerName.key, local['CLU_OWNER_DSC']); + await StorageHelper() + .set(ProfileStorageKey.userName.key, local['USU_NOME']); return await LocalsRemoteDataSourceImpl().processData(context); } @@ -81,15 +98,25 @@ class LocalUtil { static Future updateStorageUtil(Map jsonBody) async { try { - await StorageHelper().set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false); - await StorageHelper().set(LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false); - await StorageHelper().set(LocalsStorageKey.pets.key, jsonBody['pet'] ?? false); - await StorageHelper().set(LocalsStorageKey.petAmount.key, jsonBody['petAmountRegister']?.toString().isEmpty ?? true ? '0' : jsonBody['petAmountRegister'].toString()); - await StorageHelper().set(ProfileStorageKey.userName.key, jsonBody['visitado']['VDO_NOME'] ?? ''); - await StorageHelper().set(ProfileStorageKey.userEmail.key, jsonBody['visitado']['VDO_EMAIL'] ?? ''); + await StorageHelper() + .set(LocalsStorageKey.whatsapp.key, jsonBody['whatsapp'] ?? false); + await StorageHelper().set( + LocalsStorageKey.provisional.key, jsonBody['provisional'] ?? false); + await StorageHelper() + .set(LocalsStorageKey.pets.key, jsonBody['pet'] ?? false); + await StorageHelper().set( + LocalsStorageKey.petAmount.key, + jsonBody['petAmountRegister']?.toString().isEmpty ?? true + ? '0' + : jsonBody['petAmountRegister'].toString()); + await StorageHelper().set(ProfileStorageKey.userName.key, + jsonBody['visitado']['VDO_NOME'] ?? ''); + await StorageHelper().set(ProfileStorageKey.userEmail.key, + jsonBody['visitado']['VDO_EMAIL'] ?? ''); final bool isNewVersion = jsonBody['newVersion'] ?? false; - await StorageHelper().set(LocalsStorageKey.isNewVersion.key, isNewVersion); + await StorageHelper() + .set(LocalsStorageKey.isNewVersion.key, isNewVersion); return isNewVersion; } catch (e, s) { log('Error in _updateStorageUtil: $e', stackTrace: s); @@ -102,30 +129,44 @@ class LocalUtil { } static Future isInactived(List locals) async { - String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - return locals.where((local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A').isNotEmpty; + String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + return locals + .where( + (local) => local['CLI_ID'] != cliUUID && local['CLU_STATUS'] == 'A') + .isNotEmpty; } static bool isPending(List locals) { - return locals.where((local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A').isNotEmpty; + return locals + .where( + (local) => local['CLU_STATUS'] != 'B' && local['CLU_STATUS'] != 'A') + .isNotEmpty; } static Future isUnselected() async { - String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; - String ownerUUID = (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; + String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + String cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + String ownerUUID = + (await StorageHelper().get(ProfileStorageKey.ownerUUID.key)) ?? ''; return cliUUID.isEmpty && cliName.isEmpty && ownerUUID.isEmpty; } static Future isSelected(bool isInactived) async { - String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + String cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; return cliUUID.isNotEmpty && cliName.isNotEmpty && isInactived; } static Future isAvailable() async { - String cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - String cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + String cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + String cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; return cliUUID.isNotEmpty && cliName.isNotEmpty; } } diff --git a/lib/features/menu/data/data_sources/menu_local_data_source.dart b/lib/features/menu/data/data_sources/menu_local_data_source.dart index ed9b3e2f..d12ecc93 100644 --- a/lib/features/menu/data/data_sources/menu_local_data_source.dart +++ b/lib/features/menu/data/data_sources/menu_local_data_source.dart @@ -10,20 +10,25 @@ import 'package:hub/shared/utils/path_util.dart'; import '../../../modules/domain/entities/index.dart'; abstract class MenuLocalDataSource { - Future addMenuEntry(EnumMenuItem item, List entries, IconData icon, String text, Function() action); - Future processDisplayDefault(EnumMenuItem item, MenuEntry opt, List entries); - Future handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List entries); + Future addMenuEntry(EnumMenuItem item, List entries, + IconData icon, String text, Function() action); + Future processDisplayDefault( + EnumMenuItem item, MenuEntry opt, List entries); + Future handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, + List entries); Future processStartDate(String startDate, MenuEntry entry); Future processExpirationDate(String expirationDate, MenuEntry entry); } class MenuLocalDataSourceImpl implements MenuLocalDataSource { - static final MenuLocalDataSourceImpl _instance = MenuLocalDataSourceImpl._internal(); + static final MenuLocalDataSourceImpl _instance = + MenuLocalDataSourceImpl._internal(); factory MenuLocalDataSourceImpl() => _instance; MenuLocalDataSourceImpl._internal(); @override - Future addMenuEntry(EnumMenuItem item, List entries, IconData icon, String text, Function() action) async { + Future addMenuEntry(EnumMenuItem item, List entries, + IconData icon, String text, Function() action) async { final menuItem = item == EnumMenuItem.button ? ButtonMenuItem(icon: icon, action: action, title: text) : item == EnumMenuItem.card || item == EnumMenuItem.tile @@ -36,7 +41,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource { } @override - Future processDisplayDefault(EnumMenuItem item, MenuEntry opt, List entries) async { + Future processDisplayDefault( + EnumMenuItem item, MenuEntry opt, List entries) async { if (opt.key == 'FRE-HUB-LOGOUT') { await addMenuEntry(item, entries, opt.icon, opt.name, () async { await AuthenticationService.signOut(navigatorKey.currentContext!); @@ -47,7 +53,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource { } @override - Future handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, List entries) async { + Future handleMenu(EnumMenuItem item, EnumDisplay display, MenuEntry opt, + List entries) async { try { switch (display.value) { case 'VISIVEL': @@ -57,7 +64,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource { break; case 'DESABILITADO': await addMenuEntry(item, entries, opt.icon, opt.name, () async { - await DialogUnavailable.unavailableFeature(navigatorKey.currentContext!); + await DialogUnavailable.unavailableFeature( + navigatorKey.currentContext!); }); break; case 'INVISIVEL': @@ -82,7 +90,8 @@ class MenuLocalDataSourceImpl implements MenuLocalDataSource { } @override - Future processExpirationDate(String expirationDate, MenuEntry opt) async { + Future processExpirationDate( + String expirationDate, MenuEntry opt) async { try { if (expirationDate.isEmpty) return false; final expiration = DateTime.tryParse(expirationDate); diff --git a/lib/features/menu/data/models/index.dart b/lib/features/menu/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/menu/data/models/index.dart +++ b/lib/features/menu/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/menu/data/repositories/menu_repository_impl.dart b/lib/features/menu/data/repositories/menu_repository_impl.dart index 37c9217e..4f6d7f5d 100644 --- a/lib/features/menu/data/repositories/menu_repository_impl.dart +++ b/lib/features/menu/data/repositories/menu_repository_impl.dart @@ -8,32 +8,39 @@ class MenuRepositoryImpl implements MenuRepository { final MenuLocalDataSource menuDataSource = MenuLocalDataSourceImpl(); @override - Future> generateMenuEntries(List menuEntries, EnumMenuItem item) async { + Future> generateMenuEntries( + List menuEntries, EnumMenuItem item) async { List entries = []; // final bool isNewVersion = await StorageHelper().get(KeychainStorageKey.isNewVersion.value).then((v) => v.toBoolean()); try { for (var entry in menuEntries) { - final bool isDefault = await menuDataSource.processDisplayDefault(item, entry, entries); + final bool isDefault = + await menuDataSource.processDisplayDefault(item, entry, entries); if (isDefault) continue; - final licenseValue = await LicenseRepositoryImpl().getLicense(entry.key); + final licenseValue = + await LicenseRepositoryImpl().getLicense(entry.key); if (licenseValue != null) { final licenseMap = await stringToMap(licenseValue); final display = EnumDisplay.fromString(licenseMap['display']); final startDate = licenseMap['startDate'] ?? ''; final expirationDate = licenseMap['expirationDate'] ?? ''; - final isStarted = await menuDataSource.processStartDate(startDate, entry); - final isExpired = await menuDataSource.processExpirationDate(expirationDate, entry); + final isStarted = + await menuDataSource.processStartDate(startDate, entry); + final isExpired = + await menuDataSource.processExpirationDate(expirationDate, entry); if (isStarted && !isExpired) { await menuDataSource.handleMenu(item, display, entry, entries); } if (isExpired) { log('Entry ${entry.key} is expired'); - await menuDataSource.handleMenu(item, EnumDisplay.inactive, entry, entries); + await menuDataSource.handleMenu( + item, EnumDisplay.inactive, entry, entries); } if (!isStarted) { log('Entry ${entry.key} is not started'); - await menuDataSource.handleMenu(item, EnumDisplay.inactive, entry, entries); + await menuDataSource.handleMenu( + item, EnumDisplay.inactive, entry, entries); } } } @@ -43,18 +50,26 @@ class MenuRepositoryImpl implements MenuRepository { return entries; } - Future processDisplay(Map module, bool isNewVersion) async { + Future processDisplay( + Map module, bool isNewVersion) async { if (await _shouldUpdateDisplay(module, isNewVersion)) { - final displayValue = module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL'; - await LicenseLocalDataSourceImpl().setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue); + final displayValue = + module['display'] == EnumDisplay.active ? 'VISIVEL' : 'INVISIVEL'; + await LicenseLocalDataSourceImpl() + .setDisplayByKey(['FRE-HUB-ABOUT-PROPERTY'], displayValue); return EnumDisplay.fromString(displayValue); } return EnumDisplay.fromString(module['display']); } - Future _shouldUpdateDisplay(Map module, bool isNewVersion) async { - const keysToCheck = [LicenseKeys.residents, LicenseKeys.vehicles, LicenseKeys.openedVisits]; + Future _shouldUpdateDisplay( + Map module, bool isNewVersion) async { + const keysToCheck = [ + LicenseKeys.residents, + LicenseKeys.vehicles, + LicenseKeys.openedVisits + ]; return isNewVersion && keysToCheck.any((key) => module['key'] == key.value); } } diff --git a/lib/features/menu/domain/entities/menu_item.dart b/lib/features/menu/domain/entities/menu_item.dart index 842eab13..ec62f641 100644 --- a/lib/features/menu/domain/entities/menu_item.dart +++ b/lib/features/menu/domain/entities/menu_item.dart @@ -6,7 +6,8 @@ enum EnumMenuItem { card, tile; - MenuItem getInstance(final Function() action, final String title, final IconData icon) { + MenuItem getInstance( + final Function() action, final String title, final IconData icon) { switch (this) { case EnumMenuItem.button: return ButtonMenuItem(action: action, title: title, icon: icon); diff --git a/lib/features/menu/domain/respositories/menu_repository.dart b/lib/features/menu/domain/respositories/menu_repository.dart index bccd444a..fdccddd8 100644 --- a/lib/features/menu/domain/respositories/menu_repository.dart +++ b/lib/features/menu/domain/respositories/menu_repository.dart @@ -1,5 +1,6 @@ import 'package:hub/features/menu/index.dart'; abstract class MenuRepository { - Future> generateMenuEntries(List menuEntries, EnumMenuItem item); + Future> generateMenuEntries( + List menuEntries, EnumMenuItem item); } diff --git a/lib/features/menu/domain/usecases/index.dart b/lib/features/menu/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/menu/domain/usecases/index.dart +++ b/lib/features/menu/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/menu/presentation/blocs/menu_bloc.dart b/lib/features/menu/presentation/blocs/menu_bloc.dart index 9b701787..c1b7e205 100644 --- a/lib/features/menu/presentation/blocs/menu_bloc.dart +++ b/lib/features/menu/presentation/blocs/menu_bloc.dart @@ -27,7 +27,8 @@ class MenuBloc extends Bloc { final List entries; late StreamSubscription _completer; - MenuBloc({required this.style, required this.item, required this.entries}) : super(MenuState()) { + MenuBloc({required this.style, required this.item, required this.entries}) + : super(MenuState()) { on(_onMenuEvent); _completer = LocalsRepositoryImpl.license.stream.listen((v) { add(MenuEvent()); @@ -37,7 +38,8 @@ class MenuBloc extends Bloc { Future _onMenuEvent(MenuEvent event, Emitter emit) async { await LicenseRemoteDataSourceImpl().waitForSaveCompletion(); - final List newEntries = await MenuRepositoryImpl().generateMenuEntries(entries, item); + final List newEntries = + await MenuRepositoryImpl().generateMenuEntries(entries, item); emit(state.copyWith(menuEntries: newEntries)); } diff --git a/lib/features/menu/presentation/blocs/menu_view_bloc.dart b/lib/features/menu/presentation/blocs/menu_view_bloc.dart index bd77e2de..722ffc6d 100644 --- a/lib/features/menu/presentation/blocs/menu_view_bloc.dart +++ b/lib/features/menu/presentation/blocs/menu_view_bloc.dart @@ -1,5 +1,3 @@ - - import 'package:flutter_bloc/flutter_bloc.dart'; class MenuViewEvent {} diff --git a/lib/features/menu/presentation/index.dart b/lib/features/menu/presentation/index.dart index 2bb09756..8351c972 100644 --- a/lib/features/menu/presentation/index.dart +++ b/lib/features/menu/presentation/index.dart @@ -1,3 +1,3 @@ export 'blocs/index.dart'; export 'widgets/index.dart'; -export 'mappers/index.dart'; \ No newline at end of file +export 'mappers/index.dart'; diff --git a/lib/features/menu/presentation/mappers/menu_entry.dart b/lib/features/menu/presentation/mappers/menu_entry.dart index 0b443f7a..c9796188 100644 --- a/lib/features/menu/presentation/mappers/menu_entry.dart +++ b/lib/features/menu/presentation/mappers/menu_entry.dart @@ -154,7 +154,8 @@ class MenuEntry implements BaseModule { MenuEntry( key: 'FRE-HUB-PETS', icon: Icons.pets, - name: FFLocalizations.of(navigatorKey.currentContext!).getVariableText(ptText: 'Cadastrar Pets', enText: 'Pets Register'), + name: FFLocalizations.of(navigatorKey.currentContext!) + .getVariableText(ptText: 'Cadastrar Pets', enText: 'Pets Register'), route: '/petsPage', types: [MenuEntryType.Home, MenuEntryType.Drawer], ), diff --git a/lib/features/menu/presentation/widgets/index.dart b/lib/features/menu/presentation/widgets/index.dart index 800e0aa8..b3915d35 100644 --- a/lib/features/menu/presentation/widgets/index.dart +++ b/lib/features/menu/presentation/widgets/index.dart @@ -1,4 +1,4 @@ export 'menu_item/index.dart'; export 'menu_view/index.dart'; -export 'menu_factory.dart'; \ No newline at end of file +export 'menu_factory.dart'; diff --git a/lib/features/menu/presentation/widgets/menu_item/menu_item_button.dart b/lib/features/menu/presentation/widgets/menu_item/menu_item_button.dart index 2b0d5576..c8f81e31 100644 --- a/lib/features/menu/presentation/widgets/menu_item/menu_item_button.dart +++ b/lib/features/menu/presentation/widgets/menu_item/menu_item_button.dart @@ -99,7 +99,8 @@ class _MenuButtonWidgetState extends State { color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedFontSize, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), ), ), ), diff --git a/lib/features/menu/presentation/widgets/menu_item/menu_item_card.dart b/lib/features/menu/presentation/widgets/menu_item/menu_item_card.dart index 6ea197ce..19843d1c 100644 --- a/lib/features/menu/presentation/widgets/menu_item/menu_item_card.dart +++ b/lib/features/menu/presentation/widgets/menu_item/menu_item_card.dart @@ -53,7 +53,8 @@ class _MenuCardItemState extends State { Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 10.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 10.0, 0.0), child: Container( width: 30.0, height: 30.0, diff --git a/lib/features/menu/presentation/widgets/menu_view/menu_list_view.dart b/lib/features/menu/presentation/widgets/menu_view/menu_list_view.dart index cd301a64..5146a97a 100644 --- a/lib/features/menu/presentation/widgets/menu_view/menu_list_view.dart +++ b/lib/features/menu/presentation/widgets/menu_view/menu_list_view.dart @@ -83,7 +83,8 @@ class _MenuListViewState extends State { itemBuilder: (context, index) { return Padding( padding: const EdgeInsets.all(8.0), - child: SizedBox(height: 115, width: 115, child: widget.options[index]), + child: + SizedBox(height: 115, width: 115, child: widget.options[index]), ); }, ), @@ -104,7 +105,8 @@ class _MenuListViewState extends State { itemBuilder: (context, index) { return Padding( padding: const EdgeInsets.all(8.0), - child: SizedBox(height: 115, width: 115, child: widget.options[index]), + child: + SizedBox(height: 115, width: 115, child: widget.options[index]), ); }, ), diff --git a/lib/features/menu/presentation/widgets/menu_view/menu_staggered_view.dart b/lib/features/menu/presentation/widgets/menu_view/menu_staggered_view.dart index 4a81ac5b..371fac5a 100644 --- a/lib/features/menu/presentation/widgets/menu_view/menu_staggered_view.dart +++ b/lib/features/menu/presentation/widgets/menu_view/menu_staggered_view.dart @@ -13,7 +13,12 @@ class MenuStaggeredViewModel extends FlutterFlowModel { } class MenuStaggeredView extends StatefulWidget { - const MenuStaggeredView({super.key, required this.changeMenuStyle, required this.item, required this.options, required this.isGrid}); + const MenuStaggeredView( + {super.key, + required this.changeMenuStyle, + required this.item, + required this.options, + required this.isGrid}); final EnumMenuItem item; final bool isGrid; @@ -55,7 +60,9 @@ class _MenuStaggeredViewState extends State { return Column( children: [ _buildGridView(crossAxisCount), - ].addToStart(const SizedBox(height: 30)).addToEnd(const SizedBox(height: 30)), + ] + .addToStart(const SizedBox(height: 30)) + .addToEnd(const SizedBox(height: 30)), ); } diff --git a/lib/features/modules/constants/index.dart b/lib/features/modules/constants/index.dart index 20bc3626..799c6845 100644 --- a/lib/features/modules/constants/index.dart +++ b/lib/features/modules/constants/index.dart @@ -1 +1 @@ -export 'license_constants.dart'; \ No newline at end of file +export 'license_constants.dart'; diff --git a/lib/features/modules/constants/license_constants.dart b/lib/features/modules/constants/license_constants.dart index 6a4a2fcc..ea2bf899 100644 --- a/lib/features/modules/constants/license_constants.dart +++ b/lib/features/modules/constants/license_constants.dart @@ -1,8 +1,7 @@ +const String tableLicense = 'license'; - const String tableLicense = 'license'; - - class LicenseConstants { - static String get createLicenseTable => ''' +class LicenseConstants { + static String get createLicenseTable => ''' CREATE TABLE IF NOT EXISTS $tableLicense ( key TEXT UNIQUE, display TEXT, @@ -12,9 +11,9 @@ ); '''; - static String get deleteLicenseTable => 'DROP TABLE IF EXISTS $tableLicense;'; + static String get deleteLicenseTable => 'DROP TABLE IF EXISTS $tableLicense;'; - static String get updatePetsHistoryTrigger => ''' + static String get updatePetsHistoryTrigger => ''' CREATE TRIGGER update_fre_hub_pets_history AFTER INSERT ON $tableLicense WHEN NEW.key = 'FRE-HUB-PETS' @@ -24,9 +23,10 @@ END; '''; - static String get dropPetsHistoryTrigger => 'DROP TRIGGER IF EXISTS update_fre_hub_pets_history;'; + static String get dropPetsHistoryTrigger => + 'DROP TRIGGER IF EXISTS update_fre_hub_pets_history;'; - static String get updateDisplayTrigger => ''' + static String get updateDisplayTrigger => ''' CREATE TRIGGER update_display_trigger AFTER UPDATE ON $tableLicense WHEN NEW.key IN ('FRE-HUB-OPENED-VISITS', 'FRE-HUB-VEHICLES', 'FRE-HUB-RESIDENTS') @@ -44,9 +44,10 @@ END; '''; - static String get dropUpdateDisplayTrigger => 'DROP TRIGGER IF EXISTS update_display_trigger;'; + static String get dropUpdateDisplayTrigger => + 'DROP TRIGGER IF EXISTS update_display_trigger;'; - static String get insertDisplayTrigger => ''' + static String get insertDisplayTrigger => ''' CREATE TRIGGER insert_display_trigger AFTER INSERT ON $tableLicense WHEN NEW.key IN ('FRE-HUB-OPENED-VISITS', 'FRE-HUB-VEHICLES', 'FRE-HUB-RESIDENTS') @@ -62,9 +63,10 @@ END; '''; - static String get dropInsertDisplayTrigger => 'DROP TRIGGER IF EXISTS insert_display_trigger;'; + static String get dropInsertDisplayTrigger => + 'DROP TRIGGER IF EXISTS insert_display_trigger;'; - static String get updatePeopleDisplayTrigger => ''' + static String get updatePeopleDisplayTrigger => ''' CREATE TRIGGER update_people_display_trigger AFTER UPDATE ON $tableLicense WHEN NEW.key IN ('FRE-HUB-OPENED-VISITS', 'FRE-HUB-VEHICLES', 'FRE-HUB-RESIDENTS') @@ -80,5 +82,6 @@ END; '''; - static String get dropPeopleDisplayTrigger => 'DROP TRIGGER IF EXISTS update_people_display_trigger;'; - } \ No newline at end of file + static String get dropPeopleDisplayTrigger => + 'DROP TRIGGER IF EXISTS update_people_display_trigger;'; +} diff --git a/lib/features/modules/data/data_sources/license_local_data_source.dart b/lib/features/modules/data/data_sources/license_local_data_source.dart index ff2390c4..e2ef21aa 100644 --- a/lib/features/modules/data/data_sources/license_local_data_source.dart +++ b/lib/features/modules/data/data_sources/license_local_data_source.dart @@ -13,7 +13,8 @@ abstract class LicenseLocalDataSource { } class LicenseLocalDataSourceImpl implements LicenseLocalDataSource { - static final LicenseLocalDataSourceImpl _instance = LicenseLocalDataSourceImpl._internal(); + static final LicenseLocalDataSourceImpl _instance = + LicenseLocalDataSourceImpl._internal(); factory LicenseLocalDataSourceImpl() => _instance; LicenseLocalDataSourceImpl._internal(); @@ -23,7 +24,8 @@ class LicenseLocalDataSourceImpl implements LicenseLocalDataSource { } @override - Future setDisplayByKey(final List keys, final String display) async { + Future setDisplayByKey( + final List keys, final String display) async { if (keys.isEmpty) return; final validKeys = keys.where((key) => key.isNotEmpty).toList(); for (var key in validKeys) { @@ -38,14 +40,16 @@ class LicenseLocalDataSourceImpl implements LicenseLocalDataSource { @override Future isNewVersion() async { - final String? reponse = await StorageHelper().get(LocalsStorageKey.isNewVersion.key); + final String? reponse = + await StorageHelper().get(LocalsStorageKey.isNewVersion.key); final bool isNewVersion = reponse.toBoolean(); return isNewVersion; } @override Future get(String key) async { - var response = await DatabaseService.database.query(tableLicense, where: 'key = ?', whereArgs: [key]); + var response = await DatabaseService.database + .query(tableLicense, where: 'key = ?', whereArgs: [key]); if (response.isEmpty) { return null; } @@ -61,14 +65,21 @@ class LicenseLocalDataSourceImpl implements LicenseLocalDataSource { await DatabaseService.database.rawInsert( 'INSERT OR REPLACE INTO $tableLicense (key, display, expirationDate, startDate, quantity) VALUES (?, ?, ?, ?, ?)', - [key, value['display'], value['expirationDate'], value['startDate'], value['quantity']], + [ + key, + value['display'], + value['expirationDate'], + value['startDate'], + value['quantity'] + ], ); return; } @override Future del(String key) async { - await DatabaseService.database.delete(tableLicense, where: 'key = ?', whereArgs: [key]); + await DatabaseService.database + .delete(tableLicense, where: 'key = ?', whereArgs: [key]); } @override diff --git a/lib/features/modules/data/data_sources/license_remote_data_source.dart b/lib/features/modules/data/data_sources/license_remote_data_source.dart index 9bee2849..5a80c9c7 100644 --- a/lib/features/modules/data/data_sources/license_remote_data_source.dart +++ b/lib/features/modules/data/data_sources/license_remote_data_source.dart @@ -17,7 +17,8 @@ abstract class LicenseRemoteDataSource { } class LicenseRemoteDataSourceImpl implements LicenseRemoteDataSource { - static final LicenseRemoteDataSourceImpl _instance = LicenseRemoteDataSourceImpl._internal(); + static final LicenseRemoteDataSourceImpl _instance = + LicenseRemoteDataSourceImpl._internal(); factory LicenseRemoteDataSourceImpl() => _instance; LicenseRemoteDataSourceImpl._internal(); @@ -35,15 +36,27 @@ class LicenseRemoteDataSourceImpl implements LicenseRemoteDataSource { try { final License license = await License.getLicense(isNewVersion); - final List inactiveModuleKey = license.modules.where((module) => module.display == ModuleStatus.inactive.key).map((module) => module.key).toList(); + final List inactiveModuleKey = license.modules + .where((module) => module.display == ModuleStatus.inactive.key) + .map((module) => module.key) + .toList(); - final List activeModuleKey = license.modules.where((module) => module.display == ModuleStatus.active.key).map((module) => module.key).toList(); + final List activeModuleKey = license.modules + .where((module) => module.display == ModuleStatus.active.key) + .map((module) => module.key) + .toList(); - final List disabledModuleKey = license.modules.where((module) => module.display == ModuleStatus.disabled.key).map((module) => module.key).toList(); + final List disabledModuleKey = license.modules + .where((module) => module.display == ModuleStatus.disabled.key) + .map((module) => module.key) + .toList(); - await LicenseLocalDataSourceImpl().setDisplayByKey(inactiveModuleKey, 'INVISIVEL'); - await LicenseLocalDataSourceImpl().setDisplayByKey(activeModuleKey, 'VISIVEL'); - await LicenseLocalDataSourceImpl().setDisplayByKey(disabledModuleKey, 'DESABILITADO'); + await LicenseLocalDataSourceImpl() + .setDisplayByKey(inactiveModuleKey, 'INVISIVEL'); + await LicenseLocalDataSourceImpl() + .setDisplayByKey(activeModuleKey, 'VISIVEL'); + await LicenseLocalDataSourceImpl() + .setDisplayByKey(disabledModuleKey, 'DESABILITADO'); return true; } catch (e, s) { diff --git a/lib/features/modules/data/models/license_model.dart b/lib/features/modules/data/models/license_model.dart index 1bbf5d3f..48e215cc 100644 --- a/lib/features/modules/data/models/license_model.dart +++ b/lib/features/modules/data/models/license_model.dart @@ -11,5 +11,6 @@ class LicenseModel with _$LicenseModel { required List modules, }) = _LicenseModel; - factory LicenseModel.fromJson(Map json) => _$LicenseModelFromJson(json); + factory LicenseModel.fromJson(Map json) => + _$LicenseModelFromJson(json); } diff --git a/lib/features/modules/data/models/module_model.dart b/lib/features/modules/data/models/module_model.dart index c45efffe..e373edc3 100644 --- a/lib/features/modules/data/models/module_model.dart +++ b/lib/features/modules/data/models/module_model.dart @@ -14,5 +14,6 @@ class ModuleModel with _$ModuleModel { required int quantity, }) = _ModuleModel; - factory ModuleModel.fromJson(Map json) => _$ModuleModelFromJson(json); + factory ModuleModel.fromJson(Map json) => + _$ModuleModelFromJson(json); } diff --git a/lib/features/modules/data/repositories/license_repository_impl.dart b/lib/features/modules/data/repositories/license_repository_impl.dart index bc33f656..0a5a5b48 100644 --- a/lib/features/modules/data/repositories/license_repository_impl.dart +++ b/lib/features/modules/data/repositories/license_repository_impl.dart @@ -9,7 +9,8 @@ typedef LicenseStatus = bool; class LicenseRepositoryImpl implements LicenseRepository { final LicenseLocalDataSource localDataSource = LicenseLocalDataSourceImpl(); - final LicenseRemoteDataSource remoteDataSource = LicenseRemoteDataSourceImpl(); + final LicenseRemoteDataSource remoteDataSource = + LicenseRemoteDataSourceImpl(); final Database database = DatabaseService.database; LicenseRepositoryImpl(); diff --git a/lib/features/modules/domain/entities/base_module.dart b/lib/features/modules/domain/entities/base_module.dart index ef2c82a8..1cfbeef0 100644 --- a/lib/features/modules/domain/entities/base_module.dart +++ b/lib/features/modules/domain/entities/base_module.dart @@ -2,8 +2,6 @@ import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; - - abstract class BaseModule { String get key; String get name; diff --git a/lib/features/modules/domain/entities/license.dart b/lib/features/modules/domain/entities/license.dart index d7e4524f..17a70650 100644 --- a/lib/features/modules/domain/entities/license.dart +++ b/lib/features/modules/domain/entities/license.dart @@ -60,7 +60,9 @@ class License { } static Future _precessWpp() async { - final bool whatsapp = await StorageHelper().get(LocalsStorageKey.whatsapp.key).then((v) => v.toBoolean()); + final bool whatsapp = await StorageHelper() + .get(LocalsStorageKey.whatsapp.key) + .then((v) => v.toBoolean()); if (whatsapp) return ModuleStatus.active.key; else @@ -68,7 +70,9 @@ class License { } static Future _processProvisional() async { - final bool provisional = await StorageHelper().get(LocalsStorageKey.provisional.key).then((v) => v.toBoolean()); + final bool provisional = await StorageHelper() + .get(LocalsStorageKey.provisional.key) + .then((v) => v.toBoolean()); if (provisional) return ModuleStatus.active.key; else @@ -76,7 +80,9 @@ class License { } static Future _processPets() async { - final bool pets = await StorageHelper().get(LocalsStorageKey.pets.key).then((v) => v.toBoolean()); + final bool pets = await StorageHelper() + .get(LocalsStorageKey.pets.key) + .then((v) => v.toBoolean()); if (pets) return ModuleStatus.active.key; else @@ -133,21 +139,27 @@ class License { ), Module( key: LicenseKeys.openedVisits.value, - display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, + display: isNewVersionWithModule + ? ModuleStatus.active.key + : ModuleStatus.inactive.key, expirationDate: '', startDate: '', quantity: 0, ), Module( key: LicenseKeys.vehicles.value, - display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, + display: isNewVersionWithModule + ? ModuleStatus.active.key + : ModuleStatus.inactive.key, expirationDate: '', startDate: '', quantity: 0, ), Module( key: LicenseKeys.residents.value, - display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, + display: isNewVersionWithModule + ? ModuleStatus.active.key + : ModuleStatus.inactive.key, expirationDate: '', startDate: '', quantity: 0, @@ -210,14 +222,18 @@ class License { ), Module( key: LicenseKeys.property.value, - display: isNewVersionWithModule ? ModuleStatus.active.key : ModuleStatus.inactive.key, + display: isNewVersionWithModule + ? ModuleStatus.active.key + : ModuleStatus.inactive.key, expirationDate: '', startDate: '', quantity: 0, ), Module( key: LicenseKeys.people.value, - display: isNewVersionWithModule ? ModuleStatus.inactive.key : ModuleStatus.active.key, + display: isNewVersionWithModule + ? ModuleStatus.inactive.key + : ModuleStatus.active.key, expirationDate: '', startDate: '', quantity: 0, diff --git a/lib/features/modules/domain/usecases/index.dart b/lib/features/modules/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/modules/domain/usecases/index.dart +++ b/lib/features/modules/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/modules/index.dart b/lib/features/modules/index.dart index 385ad97a..9e2e57a1 100644 --- a/lib/features/modules/index.dart +++ b/lib/features/modules/index.dart @@ -1,4 +1,4 @@ export 'data/index.dart'; export 'domain/index.dart'; export 'presentation/index.dart'; -export 'constants/index.dart'; \ No newline at end of file +export 'constants/index.dart'; diff --git a/lib/features/modules/presentation/blocs/index.dart b/lib/features/modules/presentation/blocs/index.dart index e69de29b..8b137891 100644 --- a/lib/features/modules/presentation/blocs/index.dart +++ b/lib/features/modules/presentation/blocs/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/modules/presentation/widgets/index.dart b/lib/features/modules/presentation/widgets/index.dart index e69de29b..8b137891 100644 --- a/lib/features/modules/presentation/widgets/index.dart +++ b/lib/features/modules/presentation/widgets/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/notifications/deep_link_service.dart b/lib/features/notifications/deep_link_service.dart index 5712a7ae..f7aa1ac0 100644 --- a/lib/features/notifications/deep_link_service.dart +++ b/lib/features/notifications/deep_link_service.dart @@ -62,7 +62,8 @@ class DeepLinkService { child: ForgotPasswordScreen(email: email, token: token), ), isScrollControlled: true, - backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!).primaryBackground, + backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!) + .primaryBackground, showDragHandle: true, useSafeArea: true, enableDrag: true, diff --git a/lib/features/notifications/firebase_messaging_service.dart b/lib/features/notifications/firebase_messaging_service.dart index 07fe7df5..3d4a77f7 100644 --- a/lib/features/notifications/firebase_messaging_service.dart +++ b/lib/features/notifications/firebase_messaging_service.dart @@ -9,12 +9,16 @@ import 'package:hub/shared/utils/log_util.dart'; import 'notification_service.dart'; Future handleMessage(RemoteMessage message) async { - NotificationService.show(title: message.notification!.title!, body: message.notification!.body!, payload: Map.from(message.data)); + NotificationService.show( + title: message.notification!.title!, + body: message.notification!.body!, + payload: Map.from(message.data)); } class FirebaseMessagingService { // Singleton instance - static final FirebaseMessagingService _instance = FirebaseMessagingService._internal(); + static final FirebaseMessagingService _instance = + FirebaseMessagingService._internal(); // Factory constructor factory FirebaseMessagingService() => _instance; @@ -33,7 +37,8 @@ class FirebaseMessagingService { _firebaseMessaging.pluginConstants; } - static Future getToken() async => await FirebaseMessaging.instance.getToken() ?? ''; + static Future getToken() async => + await FirebaseMessaging.instance.getToken() ?? ''; Future updateDeviceToken() async { try { diff --git a/lib/features/notifications/notification_service.dart b/lib/features/notifications/notification_service.dart index 06f77ff9..9b1dcabb 100644 --- a/lib/features/notifications/notification_service.dart +++ b/lib/features/notifications/notification_service.dart @@ -11,12 +11,19 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/utils/dialog_util.dart'; -Future onMessageReceived(Map payload, String? extra, String? handleClick) async { +Future onMessageReceived( + Map payload, String? extra, String? handleClick) async { final localId = jsonDecode(payload['local']!)['CLI_ID']; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - answersRequest({required BuildContext context, required String? ref, required String? task, required String? response, required String? id}) async { + answersRequest( + {required BuildContext context, + required String? ref, + required String? task, + required String? response, + required String? id}) async { final ApiCallResponse? respondeSolicitacaoCall; final RespondeSolicitacaoCall callback = PhpGroup.respondeSolicitacaoCall; @@ -57,8 +64,10 @@ Future onMessageReceived(Map payload, String? extra, Stri enText: 'Approve Visit', ), FFLocalizations.of(context).getVariableText( - ptText: 'Você tem certeza que deseja aprovar essa visita?', - enText: 'Are you sure you want to approve this visit?', + ptText: + 'Você tem certeza que deseja aprovar essa visita?', + enText: + 'Are you sure you want to approve this visit?', ), () async { await answersRequest( @@ -95,8 +104,10 @@ Future onMessageReceived(Map payload, String? extra, Stri enText: 'Block Visit', ), FFLocalizations.of(context).getVariableText( - ptText: 'Você tem certeza que deseja bloquear essa visita?', - enText: 'Are you sure you want to block this visit?', + ptText: + 'Você tem certeza que deseja bloquear essa visita?', + enText: + 'Are you sure you want to block this visit?', ), () async { await answersRequest .call( @@ -138,7 +149,8 @@ Future onMessageReceived(Map payload, String? extra, Stri ptText: 'Mensagem', ): payload['mensagem'], }), - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=${payload['documento'] ?? ''}&tipo=E', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=${payload['documento'] ?? ''}&tipo=E', statusHashMap: [ { FFLocalizations.of(context).getVariableText( @@ -170,16 +182,21 @@ Future onMessageReceived(Map payload, String? extra, Stri return Dialog( backgroundColor: Colors.transparent, child: DetailsComponentWidget( - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=$id&tipo=$type', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=$id&tipo=$type', labelsHashMap: Map.from({ FFLocalizations.of(context).getVariableText( enText: 'Name', ptText: 'Nome', - ): payload['PES_NOME'] != null ? payload['PES_NOME'].toString() : payload['USR_NOME'].toString(), + ): payload['PES_NOME'] != null + ? payload['PES_NOME'].toString() + : payload['USR_NOME'].toString(), FFLocalizations.of(context).getVariableText( enText: 'Type', ptText: 'Tipo', - ): payload['USR_TIPO'].toString() == 'O' ? 'Morador' : 'Visitante', + ): payload['USR_TIPO'].toString() == 'O' + ? 'Morador' + : 'Visitante', FFLocalizations.of(context).getVariableText( enText: 'Access Date', ptText: 'Data de Acesso', @@ -222,8 +239,11 @@ Future onMessageReceived(Map payload, String? extra, Stri child: MessageNotificationModalTemplateComponentWidget( id: localId, from: payload['remetente'].toString(), - to: payload['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante', - message: extra.toString().isEmpty ? 'Unknown' : extra.toString(), + to: payload['destinatario'].toString() == 'O' + ? 'Morador' + : 'Visitante', + message: + extra.toString().isEmpty ? 'Unknown' : extra.toString(), ), ), ); @@ -258,15 +278,24 @@ class NotificationService { ledColor: Colors.white, ) ], - channelGroups: [NotificationChannelGroup(channelGroupKey: 'basic_channel_group', channelGroupName: 'group_1')], + channelGroups: [ + NotificationChannelGroup( + channelGroupKey: 'basic_channel_group', + channelGroupName: 'group_1') + ], debug: kDebugMode); - await AwesomeNotifications().isNotificationAllowed().then((isAllowed) async { - final bool requestOSnotification = (await StorageHelper().get(LocalsStorageKey.requestOSNotification.key)) == 'true'; + await AwesomeNotifications() + .isNotificationAllowed() + .then((isAllowed) async { + final bool requestOSnotification = (await StorageHelper() + .get(LocalsStorageKey.requestOSNotification.key)) == + 'true'; if (requestOSnotification == false) { if (isAllowed == false) { - await StorageHelper().set(LocalsStorageKey.requestOSNotification.key, true); + await StorageHelper() + .set(LocalsStorageKey.requestOSNotification.key, true); await AwesomeNotifications().requestPermissionToSendNotifications(); } } @@ -280,18 +309,22 @@ class NotificationService { onDismissActionReceivedMethod: onDismissActionReceivedMethod); } - static Future onActionReceivedMethod(ReceivedAction receivedAction) async { + static Future onActionReceivedMethod( + ReceivedAction receivedAction) async { final payload = receivedAction.payload ?? {}; final extra = receivedAction.body; final handleClick = payload['click_action']; onMessageReceived(payload, extra, handleClick); } - static Future onNotificationCreatedMethod(ReceivedNotification receivedNotification) async {} + static Future onNotificationCreatedMethod( + ReceivedNotification receivedNotification) async {} - static Future onNotificationDisplayedMethod(ReceivedNotification receivedNotification) async {} + static Future onNotificationDisplayedMethod( + ReceivedNotification receivedNotification) async {} - static Future onDismissActionReceivedMethod(ReceivedAction receivedAction) async {} + static Future onDismissActionReceivedMethod( + ReceivedAction receivedAction) async {} static Future show({ required final String title, @@ -323,7 +356,11 @@ class NotificationService { ), actionButtons: actionButtons, schedule: scheduled - ? NotificationInterval(interval: Duration(seconds: interval!), timeZone: await AwesomeNotifications().getLocalTimeZoneIdentifier(), preciseAlarm: true) + ? NotificationInterval( + interval: Duration(seconds: interval!), + timeZone: + await AwesomeNotifications().getLocalTimeZoneIdentifier(), + preciseAlarm: true) : null); } } diff --git a/lib/features/profile/data/models/index.dart b/lib/features/profile/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/data/models/index.dart +++ b/lib/features/profile/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/data/repositories/index.dart b/lib/features/profile/data/repositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/data/repositories/index.dart +++ b/lib/features/profile/data/repositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/domain/entities/index.dart b/lib/features/profile/domain/entities/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/domain/entities/index.dart +++ b/lib/features/profile/domain/entities/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/domain/respositories/index.dart b/lib/features/profile/domain/respositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/domain/respositories/index.dart +++ b/lib/features/profile/domain/respositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/domain/usecases/index.dart b/lib/features/profile/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/domain/usecases/index.dart +++ b/lib/features/profile/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/presentation/blocs/index.dart b/lib/features/profile/presentation/blocs/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/presentation/blocs/index.dart +++ b/lib/features/profile/presentation/blocs/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/presentation/pages/index.dart b/lib/features/profile/presentation/pages/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/presentation/pages/index.dart +++ b/lib/features/profile/presentation/pages/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/profile/presentation/widgets/index.dart b/lib/features/profile/presentation/widgets/index.dart index e69de29b..8b137891 100644 --- a/lib/features/profile/presentation/widgets/index.dart +++ b/lib/features/profile/presentation/widgets/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/data/data_sources/index.dart b/lib/features/property/data/data_sources/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/data/data_sources/index.dart +++ b/lib/features/property/data/data_sources/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/data/models/index.dart b/lib/features/property/data/models/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/data/models/index.dart +++ b/lib/features/property/data/models/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/data/repositories/index.dart b/lib/features/property/data/repositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/data/repositories/index.dart +++ b/lib/features/property/data/repositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/domain/entities/index.dart b/lib/features/property/domain/entities/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/domain/entities/index.dart +++ b/lib/features/property/domain/entities/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/domain/respositories/index.dart b/lib/features/property/domain/respositories/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/domain/respositories/index.dart +++ b/lib/features/property/domain/respositories/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/domain/usecases/index.dart b/lib/features/property/domain/usecases/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/domain/usecases/index.dart +++ b/lib/features/property/domain/usecases/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/presentation/blocs/index.dart b/lib/features/property/presentation/blocs/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/presentation/blocs/index.dart +++ b/lib/features/property/presentation/blocs/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/property/presentation/pages/about_property_screen.dart b/lib/features/property/presentation/pages/about_property_screen.dart index a4180b6a..9753b962 100644 --- a/lib/features/property/presentation/pages/about_property_screen.dart +++ b/lib/features/property/presentation/pages/about_property_screen.dart @@ -38,7 +38,8 @@ class AboutPropertyPage extends StatefulWidget { State createState() => _AboutPropertyPageState(); } -class _AboutPropertyPageState extends State with SingleTickerProviderStateMixin { +class _AboutPropertyPageState extends State + with SingleTickerProviderStateMixin { late AboutPropertyModel _model; @override @@ -60,11 +61,15 @@ class _AboutPropertyPageState extends State with SingleTicker @override Widget build(BuildContext context) { - return Scaffold(appBar: _buildAppBar(context), backgroundColor: FlutterFlowTheme.of(context).primaryBackground, body: _buildBody(context)); + return Scaffold( + appBar: _buildAppBar(context), + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: _buildBody(context)); } PreferredSizeWidget _buildAppBar(BuildContext context) { - final String title = FFLocalizations.of(context).getVariableText(ptText: "Sobre a Propriedade", enText: "About the Property"); + final String title = FFLocalizations.of(context).getVariableText( + ptText: "Sobre a Propriedade", enText: "About the Property"); return AppBarUtil( title: title, onBackButtonPressed: () => context.pop(), diff --git a/lib/features/property/presentation/widgets/index.dart b/lib/features/property/presentation/widgets/index.dart index e69de29b..8b137891 100644 --- a/lib/features/property/presentation/widgets/index.dart +++ b/lib/features/property/presentation/widgets/index.dart @@ -0,0 +1 @@ + diff --git a/lib/features/storage/services/database_storage_service.dart b/lib/features/storage/services/database_storage_service.dart index 25124bbc..832d2be4 100644 --- a/lib/features/storage/services/database_storage_service.dart +++ b/lib/features/storage/services/database_storage_service.dart @@ -51,14 +51,16 @@ class DatabaseService { await _createTables(database, version); } - Future _onUpgrade(Database database, int oldVersion, int newVersion) async { + Future _onUpgrade( + Database database, int oldVersion, int newVersion) async { print('Upgrading database from version $oldVersion to $newVersion...'); if (oldVersion < 2 && newVersion >= 2) { await _createTables(database, newVersion); } } - Future _onDowngrade(Database database, int oldVersion, int newVersion) async { + Future _onDowngrade( + Database database, int oldVersion, int newVersion) async { print('Downgrading database from version $oldVersion to $newVersion...'); if (oldVersion >= 2 && newVersion < 2) { await _dropTables(database); diff --git a/lib/features/storage/services/secure_storage_service.dart b/lib/features/storage/services/secure_storage_service.dart index e69de29b..8b137891 100644 --- a/lib/features/storage/services/secure_storage_service.dart +++ b/lib/features/storage/services/secure_storage_service.dart @@ -0,0 +1 @@ + diff --git a/lib/features/storage/services/shared_storage_service.dart b/lib/features/storage/services/shared_storage_service.dart index e69de29b..8b137891 100644 --- a/lib/features/storage/services/shared_storage_service.dart +++ b/lib/features/storage/services/shared_storage_service.dart @@ -0,0 +1 @@ + diff --git a/lib/features/storage/services/storage_service.dart b/lib/features/storage/services/storage_service.dart index e69de29b..8b137891 100644 --- a/lib/features/storage/services/storage_service.dart +++ b/lib/features/storage/services/storage_service.dart @@ -0,0 +1 @@ + diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index df4c0669..ac64bcb6 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -1,7 +1,8 @@ // File generated by FlutterFire CLI. // ignore_for_file: type=lint import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; -import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; /// Default [FirebaseOptions] for use with your Firebase apps. /// @@ -72,8 +73,10 @@ class DefaultFirebaseOptions { projectId: 'accessmoblie-da839', databaseURL: 'https://accessmoblie-da839.firebaseio.com', storageBucket: 'accessmoblie-da839.appspot.com', - androidClientId: '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com', - iosClientId: '187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com', + androidClientId: + '187064172787-7et0qu5p2qtmisvqgndn3kfi1b7u9ifl.apps.googleusercontent.com', + iosClientId: + '187064172787-c5gs7fvp78om9r7dofkjn2qmpumkuvig.apps.googleusercontent.com', iosBundleId: 'br.com.freaccess.hub', ); } diff --git a/lib/flutter_flow/custom_functions.dart b/lib/flutter_flow/custom_functions.dart index 155966e4..231eef12 100644 --- a/lib/flutter_flow/custom_functions.dart +++ b/lib/flutter_flow/custom_functions.dart @@ -42,7 +42,10 @@ Future> stringToMap(String v) async { throw FormatException('Invalid key-value pair: $part of $v'); } final key = keyValue[0].trim(); - final value = keyValue.sublist(1).join(':').trim(); // Join the remaining parts to handle DateTime correctly + final value = keyValue + .sublist(1) + .join(':') + .trim(); // Join the remaining parts to handle DateTime correctly return MapEntry(key, value); }), )); diff --git a/lib/flutter_flow/custom_icons.dart b/lib/flutter_flow/custom_icons.dart index 92ede9d6..52991086 100644 --- a/lib/flutter_flow/custom_icons.dart +++ b/lib/flutter_flow/custom_icons.dart @@ -14,7 +14,8 @@ class FFIcons { static const IconData kvector1 = IconData(0xe902, fontFamily: _iconsFamily); // menu - static const IconData kiconFastPass = IconData(0xe900, fontFamily: _menuFamily); + static const IconData kiconFastPass = + IconData(0xe900, fontFamily: _menuFamily); static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily); static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily); } diff --git a/lib/flutter_flow/flutter_flow_animations.dart b/lib/flutter_flow/flutter_flow_animations.dart index 6f897e25..486179ca 100644 --- a/lib/flutter_flow/flutter_flow_animations.dart +++ b/lib/flutter_flow/flutter_flow_animations.dart @@ -51,8 +51,12 @@ extension AnimatedWidgetExtension on Widget { return Animate( effects: animationInfo.effects, child: this, - onPlay: (controller) => animationInfo.loop ? controller.repeat(reverse: animationInfo.reverse) : null, - onComplete: (controller) => !animationInfo.loop && animationInfo.reverse ? controller.reverse() : null, + onPlay: (controller) => animationInfo.loop + ? controller.repeat(reverse: animationInfo.reverse) + : null, + onComplete: (controller) => !animationInfo.loop && animationInfo.reverse + ? controller.reverse() + : null, ); } @@ -63,7 +67,11 @@ extension AnimatedWidgetExtension on Widget { }) { animationInfo.maybeUpdateEffects(effects); return hasBeenTriggered || animationInfo.applyInitialState - ? Animate(controller: animationInfo.controller, autoPlay: false, effects: animationInfo.effects, child: this) + ? Animate( + controller: animationInfo.controller, + autoPlay: false, + effects: animationInfo.effects, + child: this) : this; } } diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart b/lib/flutter_flow/flutter_flow_button_tabbar.dart index d8860120..e4cd78cc 100644 --- a/lib/flutter_flow/flutter_flow_button_tabbar.dart +++ b/lib/flutter_flow/flutter_flow_button_tabbar.dart @@ -8,7 +8,8 @@ import 'package:flutter/rendering.dart'; const double _kTabHeight = 46.0; -typedef _LayoutCallback = void Function(List xOffsets, TextDirection textDirection, double width); +typedef _LayoutCallback = void Function( + List xOffsets, TextDirection textDirection, double width); class _TabLabelBarRenderer extends RenderFlex { _TabLabelBarRenderer({ @@ -33,7 +34,8 @@ class _TabLabelBarRenderer extends RenderFlex { RenderBox? child = firstChild; final List xOffsets = []; while (child != null) { - final FlexParentData childParentData = child.parentData! as FlexParentData; + final FlexParentData childParentData = + child.parentData! as FlexParentData; xOffsets.add(childParentData.offset.dx); assert(child.parentData == childParentData); child = childParentData.nextSibling; @@ -82,7 +84,8 @@ class _TabLabelBar extends Flex { } @override - void updateRenderObject(BuildContext context, _TabLabelBarRenderer renderObject) { + void updateRenderObject( + BuildContext context, _TabLabelBarRenderer renderObject) { super.updateRenderObject(context, renderObject); renderObject.onPerformLayout = onPerformLayout; } @@ -133,7 +136,8 @@ class _IndicatorPainter extends CustomPainter { assert(_currentTabOffsets!.isNotEmpty); assert(tabIndex >= 0); assert(tabIndex <= maxTabIndex); - return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) / 2.0; + return (_currentTabOffsets![tabIndex] + _currentTabOffsets![tabIndex + 1]) / + 2.0; } @override @@ -188,10 +192,12 @@ class _TabBarScrollPosition extends ScrollPositionWithSingleContext { // ballistic scroll activity. if (!_viewportDimensionWasNonZero || _needsPixelsCorrection) { _needsPixelsCorrection = false; - correctPixels(tabBar._initialScrollOffset(viewportDimension, minScrollExtent, maxScrollExtent)); + correctPixels(tabBar._initialScrollOffset( + viewportDimension, minScrollExtent, maxScrollExtent)); result = false; } - return super.applyContentDimensions(minScrollExtent, maxScrollExtent) && result; + return super.applyContentDimensions(minScrollExtent, maxScrollExtent) && + result; } void markNeedsPixelsCorrection() { @@ -207,7 +213,8 @@ class _TabBarScrollController extends ScrollController { final _FlutterFlowButtonTabBarState tabBar; @override - ScrollPosition createScrollPosition(ScrollPhysics physics, ScrollContext context, ScrollPosition? oldPosition) { + ScrollPosition createScrollPosition(ScrollPhysics physics, + ScrollContext context, ScrollPosition? oldPosition) { return _TabBarScrollPosition( physics: physics, context: context, @@ -218,7 +225,8 @@ class _TabBarScrollController extends ScrollController { } /// A Flutterflow Design widget that displays a horizontal row of tabs. -class FlutterFlowButtonTabBar extends StatefulWidget implements PreferredSizeWidget { +class FlutterFlowButtonTabBar extends StatefulWidget + implements PreferredSizeWidget { /// The [tabs] argument must not be null and its length must match the [controller]'s /// [TabController.length]. /// @@ -352,14 +360,17 @@ class FlutterFlowButtonTabBar extends StatefulWidget implements PreferredSizeWid maxHeight = math.max(itemHeight, maxHeight); } } - return Size.fromHeight(maxHeight + labelPadding.vertical + buttonMargin.vertical); + return Size.fromHeight( + maxHeight + labelPadding.vertical + buttonMargin.vertical); } @override - State createState() => _FlutterFlowButtonTabBarState(); + State createState() => + _FlutterFlowButtonTabBarState(); } -class _FlutterFlowButtonTabBarState extends State with TickerProviderStateMixin { +class _FlutterFlowButtonTabBarState extends State + with TickerProviderStateMixin { ScrollController? _scrollController; TabController? _controller; _IndicatorPainter? _indicatorPainter; @@ -383,7 +394,8 @@ class _FlutterFlowButtonTabBarState extends State with /// The animation duration is 2/3 of the tab scroll animation duration in /// Material design (kTabScrollDuration). - _animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 200)); + _animationController = AnimationController( + vsync: this, duration: const Duration(milliseconds: 200)); // so the buttons start in their "final" state (color) _animationController @@ -401,7 +413,8 @@ class _FlutterFlowButtonTabBarState extends State with bool get _controllerIsValid => _controller?.animation != null; void _updateTabController() { - final TabController? newController = widget.controller ?? DefaultTabController.maybeOf(context); + final TabController? newController = + widget.controller ?? DefaultTabController.maybeOf(context); assert(() { if (newController == null) { throw FlutterError( @@ -486,7 +499,8 @@ class _FlutterFlowButtonTabBarState extends State with int get maxTabIndex => _indicatorPainter!.maxTabIndex; - double _tabScrollOffset(int index, double viewportWidth, double minExtent, double maxExtent) { + double _tabScrollOffset( + int index, double viewportWidth, double minExtent, double maxExtent) { if (!widget.isScrollable) { return 0.0; } @@ -502,27 +516,34 @@ class _FlutterFlowButtonTabBarState extends State with break; } - return clampDouble(tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent); + return clampDouble( + tabCenter + paddingStart - viewportWidth / 2.0, minExtent, maxExtent); } double _tabCenteredScrollOffset(int index) { final ScrollPosition position = _scrollController!.position; - return _tabScrollOffset(index, position.viewportDimension, position.minScrollExtent, position.maxScrollExtent); + return _tabScrollOffset(index, position.viewportDimension, + position.minScrollExtent, position.maxScrollExtent); } - double _initialScrollOffset(double viewportWidth, double minExtent, double maxExtent) { + double _initialScrollOffset( + double viewportWidth, double minExtent, double maxExtent) { return _tabScrollOffset(_currentIndex, viewportWidth, minExtent, maxExtent); } void _scrollToCurrentIndex() { final double offset = _tabCenteredScrollOffset(_currentIndex); - _scrollController!.animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease); + _scrollController! + .animateTo(offset, duration: kTabScrollDuration, curve: Curves.ease); } void _scrollToControllerValue() { - final double? leadingPosition = _currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null; + final double? leadingPosition = + _currentIndex > 0 ? _tabCenteredScrollOffset(_currentIndex - 1) : null; final double middlePosition = _tabCenteredScrollOffset(_currentIndex); - final double? trailingPosition = _currentIndex < maxTabIndex ? _tabCenteredScrollOffset(_currentIndex + 1) : null; + final double? trailingPosition = _currentIndex < maxTabIndex + ? _tabCenteredScrollOffset(_currentIndex + 1) + : null; final double index = _controller!.index.toDouble(); final double value = _controller!.animation!.value; @@ -534,9 +555,13 @@ class _FlutterFlowButtonTabBarState extends State with } else if (value == index) { offset = middlePosition; } else if (value < index) { - offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value)!; + offset = leadingPosition == null + ? middlePosition + : lerpDouble(middlePosition, leadingPosition, index - value)!; } else { - offset = trailingPosition == null ? middlePosition : lerpDouble(middlePosition, trailingPosition, value - index)!; + offset = trailingPosition == null + ? middlePosition + : lerpDouble(middlePosition, trailingPosition, value - index)!; } _scrollController!.jumpTo(offset); @@ -574,7 +599,8 @@ class _FlutterFlowButtonTabBarState extends State with } // Called each time layout completes. - void _saveTabOffsets(List tabOffsets, TextDirection textDirection, double width) { + void _saveTabOffsets( + List tabOffsets, TextDirection textDirection, double width) { _tabStripWidth = width; _indicatorPainter?.saveTabOffsets(tabOffsets, textDirection); } @@ -598,34 +624,52 @@ class _FlutterFlowButtonTabBarState extends State with } final TextStyle? textStyle = TextStyle.lerp( - (widget.unselectedLabelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith( + (widget.unselectedLabelStyle ?? + tabBarTheme.labelStyle ?? + DefaultTextStyle.of(context).style) + .copyWith( color: widget.unselectedLabelColor, ), - (widget.labelStyle ?? tabBarTheme.labelStyle ?? DefaultTextStyle.of(context).style).copyWith( + (widget.labelStyle ?? + tabBarTheme.labelStyle ?? + DefaultTextStyle.of(context).style) + .copyWith( color: widget.labelColor, ), animationValue); - final Color? textColor = Color.lerp(widget.unselectedLabelColor, widget.labelColor, animationValue); + final Color? textColor = Color.lerp( + widget.unselectedLabelColor, widget.labelColor, animationValue); - final Color? borderColor = Color.lerp(widget.unselectedBorderColor, widget.borderColor, animationValue); + final Color? borderColor = Color.lerp( + widget.unselectedBorderColor, widget.borderColor, animationValue); BoxDecoration? boxDecoration = BoxDecoration.lerp( BoxDecoration( - color: widget.unselectedDecoration?.color ?? widget.unselectedBackgroundColor ?? Colors.transparent, + color: widget.unselectedDecoration?.color ?? + widget.unselectedBackgroundColor ?? + Colors.transparent, boxShadow: widget.unselectedDecoration?.boxShadow, gradient: widget.unselectedDecoration?.gradient, - borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius), + borderRadius: widget.useToggleButtonStyle + ? null + : BorderRadius.circular(widget.borderRadius), ), BoxDecoration( - color: widget.decoration?.color ?? widget.backgroundColor ?? Colors.transparent, + color: widget.decoration?.color ?? + widget.backgroundColor ?? + Colors.transparent, boxShadow: widget.decoration?.boxShadow, gradient: widget.decoration?.gradient, - borderRadius: widget.useToggleButtonStyle ? null : BorderRadius.circular(widget.borderRadius), + borderRadius: widget.useToggleButtonStyle + ? null + : BorderRadius.circular(widget.borderRadius), ), animationValue); - if (widget.useToggleButtonStyle && widget.borderWidth > 0 && boxDecoration != null) { + if (widget.useToggleButtonStyle && + widget.borderWidth > 0 && + boxDecoration != null) { if (index == 0) { boxDecoration = boxDecoration.copyWith( border: Border( @@ -659,11 +703,13 @@ class _FlutterFlowButtonTabBarState extends State with return Padding( key: _tabKeys[index], // padding for the buttons - padding: widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin, + padding: + widget.useToggleButtonStyle ? EdgeInsets.zero : widget.buttonMargin, child: TextButton( onPressed: () => _handleTap(index), style: ButtonStyle( - elevation: WidgetStateProperty.all(widget.useToggleButtonStyle ? 0 : widget.elevation), + elevation: WidgetStateProperty.all( + widget.useToggleButtonStyle ? 0 : widget.elevation), /// give a pretty small minimum size minimumSize: WidgetStateProperty.all(const Size(10, 10)), @@ -729,11 +775,14 @@ class _FlutterFlowButtonTabBarState extends State with if (_controller!.length == 0) { return Container( - height: _kTabHeight + widget.labelPadding.vertical + widget.buttonMargin.vertical, + height: _kTabHeight + + widget.labelPadding.vertical + + widget.buttonMargin.vertical, ); } - final List wrappedTabs = List.generate(widget.tabs.length, (int index) { + final List wrappedTabs = + List.generate(widget.tabs.length, (int index) { return _buildStyledTab(widget.tabs[index], index); }); diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart b/lib/flutter_flow/flutter_flow_checkbox_group.dart index 8f367952..c8714df5 100644 --- a/lib/flutter_flow/flutter_flow_checkbox_group.dart +++ b/lib/flutter_flow/flutter_flow_checkbox_group.dart @@ -37,7 +37,8 @@ class FlutterFlowCheckboxGroup extends StatefulWidget { final TextStyle? unselectedTextStyle; @override - State createState() => _FlutterFlowCheckboxGroupState(); + State createState() => + _FlutterFlowCheckboxGroupState(); } class _FlutterFlowCheckboxGroupState extends State { @@ -85,7 +86,8 @@ class _FlutterFlowCheckboxGroupState extends State { itemBuilder: (context, index) { final option = widget.options[index]; final selected = selectedValues.contains(option); - final unselectedTextStyle = widget.unselectedTextStyle ?? widget.textStyle; + final unselectedTextStyle = + widget.unselectedTextStyle ?? widget.textStyle; return Theme( data: ThemeData(unselectedWidgetColor: widget.checkboxBorderColor), child: Padding( @@ -99,7 +101,9 @@ class _FlutterFlowCheckboxGroupState extends State { if (isSelected == null) { return; } - isSelected ? checkboxValues.add(option) : checkboxValues.remove(option); + isSelected + ? checkboxValues.add(option) + : checkboxValues.remove(option); widget.controller.value = List.from(checkboxValues); setState(() {}); } @@ -107,7 +111,8 @@ class _FlutterFlowCheckboxGroupState extends State { activeColor: widget.activeColor, checkColor: widget.checkColor, shape: RoundedRectangleBorder( - borderRadius: widget.checkboxBorderRadius ?? BorderRadius.zero, + borderRadius: + widget.checkboxBorderRadius ?? BorderRadius.zero, ), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, visualDensity: VisualDensity.compact, @@ -117,7 +122,8 @@ class _FlutterFlowCheckboxGroupState extends State { padding: widget.labelPadding ?? EdgeInsets.zero, child: Text( widget.options[index], - style: selected ? widget.textStyle : unselectedTextStyle, + style: + selected ? widget.textStyle : unselectedTextStyle, ), ), ), diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart index 3988efa6..c82ebb61 100644 --- a/lib/flutter_flow/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -86,10 +86,13 @@ class FlutterFlowDropDown extends StatefulWidget { class _FlutterFlowDropDownState extends State> { bool get isMultiSelect => widget.isMultiSelect; FormFieldController get controller => widget.controller!; - FormFieldController?> get multiSelectController => widget.multiSelectController!; + FormFieldController?> get multiSelectController => + widget.multiSelectController!; T? get currentValue { - final value = isMultiSelect ? multiSelectController.value?.firstOrNull : controller.value; + final value = isMultiSelect + ? multiSelectController.value?.firstOrNull + : controller.value; return widget.options.contains(value) ? value : null; } @@ -97,14 +100,17 @@ class _FlutterFlowDropDownState extends State> { if (!isMultiSelect || multiSelectController.value == null) { return {}; } - return widget.options.toSet().intersection(multiSelectController.value!.toSet()); + return widget.options + .toSet() + .intersection(multiSelectController.value!.toSet()); } Map get optionLabels => Map.fromEntries( widget.options.asMap().entries.map( (option) => MapEntry( option.value, - widget.optionLabels == null || widget.optionLabels!.length < option.key + 1 + widget.optionLabels == null || + widget.optionLabels!.length < option.key + 1 ? option.value.toString() : widget.optionLabels![option.key], ), @@ -123,7 +129,8 @@ class _FlutterFlowDropDownState extends State> { void initState() { super.initState(); if (isMultiSelect) { - _listener = () => widget.onMultiSelectChanged!(multiSelectController.value); + _listener = + () => widget.onMultiSelectChanged!(multiSelectController.value); multiSelectController.addListener(_listener); } else { _listener = () => widget.onChanged!(controller.value); @@ -158,16 +165,22 @@ class _FlutterFlowDropDownState extends State> { ), child: Padding( padding: _useDropdown2() ? EdgeInsets.zero : widget.margin, - child: widget.hidesUnderline ? DropdownButtonHideUnderline(child: dropdownWidget) : dropdownWidget, + child: widget.hidesUnderline + ? DropdownButtonHideUnderline(child: dropdownWidget) + : dropdownWidget, ), ), ); } bool _useDropdown2() => - widget.isMultiSelect || widget.isSearchable || !widget.isOverButton || widget.maxHeight != null; + widget.isMultiSelect || + widget.isSearchable || + !widget.isOverButton || + widget.maxHeight != null; - Widget _buildDropdownWidget() => _useDropdown2() ? _buildDropdown() : _buildLegacyDropdown(); + Widget _buildDropdownWidget() => + _useDropdown2() ? _buildDropdown() : _buildLegacyDropdown(); Widget _buildLegacyDropdown() { return DropdownButtonFormField( @@ -181,14 +194,20 @@ class _FlutterFlowDropDownState extends State> { dropdownColor: widget.fillColor, focusColor: Colors.transparent, decoration: InputDecoration( - labelText: widget.labelText == null || widget.labelText!.isEmpty ? null : widget.labelText, + labelText: widget.labelText == null || widget.labelText!.isEmpty + ? null + : widget.labelText, labelStyle: widget.labelTextStyle, - border: widget.hidesUnderline ? InputBorder.none : const UnderlineInputBorder(), + border: widget.hidesUnderline + ? InputBorder.none + : const UnderlineInputBorder(), ), ); } - Text? _createHintText() => widget.hintText != null ? Text(widget.hintText!, style: widget.textStyle) : null; + Text? _createHintText() => widget.hintText != null + ? Text(widget.hintText!, style: widget.textStyle) + : null; List> _createMenuItems() => widget.options .map( @@ -209,11 +228,14 @@ class _FlutterFlowDropDownState extends State> { enabled: false, child: StatefulBuilder( builder: (context, menuSetState) { - final isSelected = multiSelectController.value?.contains(item) ?? false; + final isSelected = + multiSelectController.value?.contains(item) ?? false; return InkWell( onTap: () { multiSelectController.value ??= []; - isSelected ? multiSelectController.value!.remove(item) : multiSelectController.value!.add(item); + isSelected + ? multiSelectController.value!.remove(item) + : multiSelectController.value!.add(item); multiSelectController.update(); // This rebuilds the StatefulWidget to update the button's text. setState(() {}); @@ -246,9 +268,11 @@ class _FlutterFlowDropDownState extends State> { .toList(); Widget _buildDropdown() { - final overlayColor = WidgetStateProperty.resolveWith( - (states) => states.contains(WidgetState.focused) ? Colors.transparent : null); - final iconStyleData = widget.icon != null ? IconStyleData(icon: widget.icon!) : const IconStyleData(); + final overlayColor = WidgetStateProperty.resolveWith((states) => + states.contains(WidgetState.focused) ? Colors.transparent : null); + final iconStyleData = widget.icon != null + ? IconStyleData(icon: widget.icon!) + : const IconStyleData(); return DropdownButton2( value: currentValue, hint: _createHintText(), @@ -274,14 +298,19 @@ class _FlutterFlowDropDownState extends State> { maxHeight: widget.maxHeight, padding: EdgeInsets.zero, ), - onChanged: widget.disabled ? null : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val), + onChanged: widget.disabled + ? null + : (isMultiSelect ? (_) {} : (val) => widget.controller!.value = val), isExpanded: true, selectedItemBuilder: (context) => widget.options .map((item) => Align( alignment: AlignmentDirectional.centerStart, child: Text( isMultiSelect - ? currentValues.where((v) => optionLabels.containsKey(v)).map((v) => optionLabels[v]).join(', ') + ? currentValues + .where((v) => optionLabels.containsKey(v)) + .map((v) => optionLabels[v]) + .join(', ') : optionLabels[item]!, style: widget.textStyle, maxLines: 1, @@ -321,7 +350,9 @@ class _FlutterFlowDropDownState extends State> { ), ), searchMatchFn: (item, searchValue) { - return (optionLabels[item.value] ?? '').toLowerCase().contains(searchValue.toLowerCase()); + return (optionLabels[item.value] ?? '') + .toLowerCase() + .contains(searchValue.toLowerCase()); }, ) : null, diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart b/lib/flutter_flow/flutter_flow_icon_button.dart index 69e35057..6e77c8a0 100644 --- a/lib/flutter_flow/flutter_flow_icon_button.dart +++ b/lib/flutter_flow/flutter_flow_icon_button.dart @@ -90,10 +90,12 @@ class _FlutterFlowIconButtonState extends State { ), iconColor: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.disabled) && widget.disabledIconColor != null) { + if (states.contains(WidgetState.disabled) && + widget.disabledIconColor != null) { return widget.disabledIconColor; } - if (states.contains(WidgetState.hovered) && widget.hoverIconColor != null) { + if (states.contains(WidgetState.hovered) && + widget.hoverIconColor != null) { return widget.hoverIconColor; } return iconColor; @@ -101,10 +103,12 @@ class _FlutterFlowIconButtonState extends State { ), backgroundColor: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.disabled) && widget.disabledColor != null) { + if (states.contains(WidgetState.disabled) && + widget.disabledColor != null) { return widget.disabledColor; } - if (states.contains(WidgetState.hovered) && widget.hoverColor != null) { + if (states.contains(WidgetState.hovered) && + widget.hoverColor != null) { return widget.hoverColor; } diff --git a/lib/flutter_flow/flutter_flow_model.dart b/lib/flutter_flow/flutter_flow_model.dart index f5b7af2e..5a1225da 100644 --- a/lib/flutter_flow/flutter_flow_model.dart +++ b/lib/flutter_flow/flutter_flow_model.dart @@ -111,7 +111,8 @@ class FlutterFlowDynamicModels { } S? getValueAtIndex(int index, S? Function(T) getValue) { - final uniqueKey = _childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key; + final uniqueKey = + _childrenIndexes.entries.firstWhereOrNull((e) => e.value == index)?.key; return getValueForKey(uniqueKey, getValue); } @@ -161,5 +162,6 @@ T? _getDefaultValue() { } extension TextValidationExtensions on String? Function(BuildContext, String?)? { - String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null; + String? Function(String?)? asValidator(BuildContext context) => + this != null ? (val) => this!(context, val) : null; } diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart index d6607aea..d178b517 100644 --- a/lib/flutter_flow/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -28,7 +28,8 @@ DeviceSize getDeviceSize(BuildContext context) { abstract class FlutterFlowTheme { static DeviceSize deviceSize = DeviceSize.mobile; - static Future initialize() async => _prefs = await SharedPreferences.getInstance(); + static Future initialize() async => + _prefs = await SharedPreferences.getInstance(); static ThemeMode get themeMode { final darkMode = _prefs?.getBool(kThemeModeKey); return darkMode == null @@ -38,11 +39,14 @@ abstract class FlutterFlowTheme { : ThemeMode.light; } - static void saveThemeMode(ThemeMode mode) => - mode == ThemeMode.system ? _prefs?.remove(kThemeModeKey) : _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark); + static void saveThemeMode(ThemeMode mode) => mode == ThemeMode.system + ? _prefs?.remove(kThemeModeKey) + : _prefs?.setBool(kThemeModeKey, mode == ThemeMode.dark); static FlutterFlowTheme of(BuildContext context) { // deviceSize = getDeviceSize(context); - return Theme.of(context).brightness == Brightness.dark ? DarkModeTheme() : LightModeTheme(); + return Theme.of(context).brightness == Brightness.dark + ? DarkModeTheme() + : LightModeTheme(); } @Deprecated('Use primary instead') diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 5f27409a..a4773c37 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -68,7 +68,8 @@ Theme wrapInMaterialDatePickerTheme( required double iconSize, }) { final baseTheme = Theme.of(context); - final dateTimeMaterialStateForegroundColor = WidgetStateProperty.resolveWith((states) { + final dateTimeMaterialStateForegroundColor = + WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.disabled)) { return pickerForegroundColor.withOpacity(0.60); } @@ -81,7 +82,8 @@ Theme wrapInMaterialDatePickerTheme( return null; }); - final dateTimeMaterialStateBackgroundColor = WidgetStateProperty.resolveWith((states) { + final dateTimeMaterialStateBackgroundColor = + WidgetStateProperty.resolveWith((states) { if (states.contains(WidgetState.selected)) { return selectedDateTimeBackgroundColor; } @@ -150,7 +152,8 @@ Theme wrapInMaterialDatePickerTheme( if (states.contains(WidgetState.hovered)) { return actionButtonForegroundColor.withOpacity(0.04); } - if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) { + if (states.contains(WidgetState.focused) || + states.contains(WidgetState.pressed)) { return actionButtonForegroundColor.withOpacity(0.12); } return null; @@ -255,7 +258,8 @@ Theme wrapInMaterialTimePickerTheme( if (states.contains(WidgetState.hovered)) { return actionButtonForegroundColor.withOpacity(0.04); } - if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) { + if (states.contains(WidgetState.focused) || + states.contains(WidgetState.pressed)) { return actionButtonForegroundColor.withOpacity(0.12); } return null; @@ -267,7 +271,9 @@ Theme wrapInMaterialTimePickerTheme( hourMinuteTextColor: pickerForegroundColor, dialHandColor: selectedDateTimeBackgroundColor, dialTextColor: WidgetStateColor.resolveWith((states) => - states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerDialForegroundColor), + states.contains(WidgetState.selected) + ? selectedDateTimeForegroundColor + : pickerDialForegroundColor), dayPeriodBorderSide: BorderSide( color: pickerForegroundColor, ), @@ -276,9 +282,13 @@ Theme wrapInMaterialTimePickerTheme( fontSize: limitedFontSize, ), dayPeriodTextColor: WidgetStateColor.resolveWith((states) => - states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerForegroundColor), - dayPeriodColor: WidgetStateColor.resolveWith( - (states) => states.contains(WidgetState.selected) ? selectedDateTimeBackgroundColor : Colors.transparent), + states.contains(WidgetState.selected) + ? selectedDateTimeForegroundColor + : pickerForegroundColor), + dayPeriodColor: WidgetStateColor.resolveWith((states) => + states.contains(WidgetState.selected) + ? selectedDateTimeBackgroundColor + : Colors.transparent), entryModeIconColor: pickerForegroundColor, ), ), @@ -361,7 +371,8 @@ String formatNumber( break; case FormatType.custom: final hasLocale = locale != null && locale.isNotEmpty; - formattedValue = NumberFormat(format, hasLocale ? locale : null).format(value); + formattedValue = + NumberFormat(format, hasLocale ? locale : null).format(value); } if (formattedValue.isEmpty) { @@ -369,7 +380,9 @@ String formatNumber( } if (currency != null) { - final currencySymbol = currency.isNotEmpty ? currency : NumberFormat.simpleCurrency().format(0.0).substring(0, 1); + final currencySymbol = currency.isNotEmpty + ? currency + : NumberFormat.simpleCurrency().format(0.0).substring(0, 1); formattedValue = '$currencySymbol$formattedValue'; } @@ -427,7 +440,9 @@ dynamic getJsonField( } final value = field.first.value; if (isForList) { - return value is! Iterable ? [value] : (value is List ? value : value.toList()); + return value is! Iterable + ? [value] + : (value is List ? value : value.toList()); } return value; } @@ -448,7 +463,8 @@ bool get isWeb => kIsWeb; const kBreakpointSmall = 479.0; const kBreakpointMedium = 767.0; const kBreakpointLarge = 991.0; -bool isMobileWidth(BuildContext context) => MediaQuery.sizeOf(context).width < kBreakpointSmall; +bool isMobileWidth(BuildContext context) => + MediaQuery.sizeOf(context).width < kBreakpointSmall; bool responsiveVisibility({ required BuildContext context, bool phone = true, @@ -481,21 +497,28 @@ extension FFTextEditingControllerExt on TextEditingController? { } extension IterableExt on Iterable { - List sortedList({S Function(T)? keyOf, bool desc = false}) { - final sortedAscending = toList()..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); + List sortedList( + {S Function(T)? keyOf, bool desc = false}) { + final sortedAscending = toList() + ..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b)))); if (desc) { return sortedAscending.reversed.toList(); } return sortedAscending; } - List mapIndexed(S Function(int, T) func) => - toList().asMap().map((index, value) => MapEntry(index, func(index, value))).values.toList(); + List mapIndexed(S Function(int, T) func) => toList() + .asMap() + .map((index, value) => MapEntry(index, func(index, value))) + .values + .toList(); } -void setAppLanguage(BuildContext context, String language) => App.of(context).setLocale(language); +void setAppLanguage(BuildContext context, String language) => + App.of(context).setLocale(language); -void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => App.of(context).setThemeMode(themeMode); +void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => + App.of(context).setThemeMode(themeMode); void showSnackbar( BuildContext context, @@ -530,7 +553,9 @@ void showSnackbar( ], ), duration: Duration(seconds: duration), - backgroundColor: error ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success, + backgroundColor: error + ? FlutterFlowTheme.of(context).error + : FlutterFlowTheme.of(context).success, behavior: SnackBarBehavior.floating, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30), @@ -539,7 +564,8 @@ void showSnackbar( ); } -void showAlertDialog(BuildContext context, String title, String content, Future Function() action) { +void showAlertDialog(BuildContext context, String title, String content, + Future Function() action) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); @@ -550,12 +576,16 @@ void showAlertDialog(BuildContext context, String title, String content, Future< return AlertDialog( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, title: Text(title, - style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedHeaderFontSize), textAlign: TextAlign.center), content: Padding( padding: const EdgeInsets.all(8.0), child: Text(content, - style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedBodyFontSize)), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedBodyFontSize)), ), actions: [ Row( @@ -568,8 +598,9 @@ void showAlertDialog(BuildContext context, String title, String content, Future< width: MediaQuery.of(context).size.width * 0.3, height: 50, color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: - TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize), + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, @@ -592,8 +623,9 @@ void showAlertDialog(BuildContext context, String title, String content, Future< height: 50, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, - textStyle: - TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedInputFontSize), + textStyle: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedInputFontSize), splashColor: const Color.fromARGB(255, 129, 129, 129), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, @@ -615,7 +647,9 @@ void showAlertDialog(BuildContext context, String title, String content, Future< extension FFStringExt on String { String maybeHandleOverflow({int? maxChars, String replacement = ''}) => - maxChars != null && length > maxChars ? replaceRange(maxChars, null, replacement) : this; + maxChars != null && length > maxChars + ? replaceRange(maxChars, null, replacement) + : this; } extension ListFilterExt on Iterable { @@ -624,13 +658,16 @@ extension ListFilterExt on Iterable { extension MapFilterExtensions on Map { Map get withoutNulls => Map.fromEntries( - entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value as T)), + entries + .where((e) => e.value != null) + .map((e) => MapEntry(e.key, e.value as T)), ); } extension MapListContainsExt on List { - bool containsMap(dynamic map) => - map is Map ? any((e) => e is Map && const DeepCollectionEquality().equals(e, map)) : contains(map); + bool containsMap(dynamic map) => map is Map + ? any((e) => e is Map && const DeepCollectionEquality().equals(e, map)) + : contains(map); } extension ListDivideExt on Iterable { @@ -638,17 +675,23 @@ extension ListDivideExt on Iterable { List divide(Widget t, {bool Function(int)? filterFn}) => isEmpty ? [] - : (enumerate.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t]).expand((i) => i).toList() + : (enumerate + .map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t]) + .expand((i) => i) + .toList() ..removeLast()); List around(Widget t) => addToStart(t).addToEnd(t); - List addToStart(Widget t) => enumerate.map((e) => e.value).toList()..insert(0, t); + List addToStart(Widget t) => + enumerate.map((e) => e.value).toList()..insert(0, t); - List addToEnd(Widget t) => enumerate.map((e) => e.value).toList()..add(t); + List addToEnd(Widget t) => + enumerate.map((e) => e.value).toList()..add(t); List paddingTopEach(double val) => - map((w) => Padding(padding: EdgeInsets.only(top: val), child: w)).toList(); + map((w) => Padding(padding: EdgeInsets.only(top: val), child: w)) + .toList(); } extension StatefulWidgetExtensions on State { diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart index 1071e2af..6845d783 100644 --- a/lib/flutter_flow/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -74,13 +74,16 @@ class _FFButtonWidgetState extends State { bool loading = false; int get maxLines => widget.options.maxLines ?? 1; - String? get text => widget.options.textStyle?.fontSize == 0 ? null : widget.text; + String? get text => + widget.options.textStyle?.fontSize == 0 ? null : widget.text; @override Widget build(BuildContext context) { Widget textWidget = loading ? SizedBox( - width: widget.options.width == null ? _getTextWidth(text, widget.options.textStyle, maxLines) : null, + width: widget.options.width == null + ? _getTextWidth(text, widget.options.textStyle, maxLines) + : null, child: Center( child: SizedBox( width: 23, @@ -95,7 +98,8 @@ class _FFButtonWidgetState extends State { ) : Text( text ?? '', - style: text == null ? null : widget.options.textStyle?.withoutColor(), + style: + text == null ? null : widget.options.textStyle?.withoutColor(), textAlign: widget.options.textAlign, maxLines: maxLines, overflow: TextOverflow.ellipsis, @@ -122,24 +126,29 @@ class _FFButtonWidgetState extends State { ButtonStyle style = ButtonStyle( shape: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.hovered) && widget.options.hoverBorderSide != null) { + if (states.contains(WidgetState.hovered) && + widget.options.hoverBorderSide != null) { return RoundedRectangleBorder( - borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8), + borderRadius: + widget.options.borderRadius ?? BorderRadius.circular(8), side: widget.options.hoverBorderSide!, ); } return RoundedRectangleBorder( - borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8), + borderRadius: + widget.options.borderRadius ?? BorderRadius.circular(8), side: widget.options.borderSide ?? BorderSide.none, ); }, ), foregroundColor: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.disabled) && widget.options.disabledTextColor != null) { + if (states.contains(WidgetState.disabled) && + widget.options.disabledTextColor != null) { return widget.options.disabledTextColor; } - if (states.contains(WidgetState.hovered) && widget.options.hoverTextColor != null) { + if (states.contains(WidgetState.hovered) && + widget.options.hoverTextColor != null) { return widget.options.hoverTextColor; } return widget.options.textStyle?.color ?? Colors.white; @@ -147,10 +156,12 @@ class _FFButtonWidgetState extends State { ), backgroundColor: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.disabled) && widget.options.disabledColor != null) { + if (states.contains(WidgetState.disabled) && + widget.options.disabledColor != null) { return widget.options.disabledColor; } - if (states.contains(WidgetState.hovered) && widget.options.hoverColor != null) { + if (states.contains(WidgetState.hovered) && + widget.options.hoverColor != null) { return widget.options.hoverColor; } return widget.options.color; @@ -162,11 +173,12 @@ class _FFButtonWidgetState extends State { } return widget.options.hoverColor == null ? null : Colors.transparent; }), - padding: WidgetStateProperty.all( - widget.options.padding ?? const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)), + padding: WidgetStateProperty.all(widget.options.padding ?? + const EdgeInsets.symmetric(horizontal: 12.0, vertical: 4.0)), elevation: WidgetStateProperty.resolveWith( (states) { - if (states.contains(WidgetState.hovered) && widget.options.hoverElevation != null) { + if (states.contains(WidgetState.hovered) && + widget.options.hoverElevation != null) { return widget.options.hoverElevation!; } return widget.options.elevation ?? 2.0; @@ -190,7 +202,8 @@ class _FFButtonWidgetState extends State { border: Border.fromBorderSide( widget.options.borderSide ?? BorderSide.none, ), - borderRadius: widget.options.borderRadius ?? BorderRadius.circular(8), + borderRadius: + widget.options.borderRadius ?? BorderRadius.circular(8), ), child: IconButton( splashRadius: 1.0, @@ -263,12 +276,13 @@ extension _WithoutColorExtension on TextStyle { } // Slightly hacky method of getting the layout width of the provided text. -double? _getTextWidth(String? text, TextStyle? style, int maxLines) => text != null - ? (TextPainter( - text: TextSpan(text: text, style: style), - textDirection: TextDirection.ltr, - maxLines: maxLines, - )..layout()) - .size - .width - : null; +double? _getTextWidth(String? text, TextStyle? style, int maxLines) => + text != null + ? (TextPainter( + text: TextSpan(text: text, style: style), + textDirection: TextDirection.ltr, + maxLines: maxLines, + )..layout()) + .size + .width + : null; diff --git a/lib/flutter_flow/form_field_controller.dart b/lib/flutter_flow/form_field_controller.dart index b8d79ccb..b8020e3b 100644 --- a/lib/flutter_flow/form_field_controller.dart +++ b/lib/flutter_flow/form_field_controller.dart @@ -15,7 +15,8 @@ class FormFieldController extends ValueNotifier { class FormListFieldController extends FormFieldController> { final List? _initialListValue; - FormListFieldController(super.initialValue) : _initialListValue = List.from(initialValue ?? []); + FormListFieldController(super.initialValue) + : _initialListValue = List.from(initialValue ?? []); @override void reset() => value = List.from(_initialListValue ?? []); diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index a7fd9712..ffb64dcd 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -9,13 +9,16 @@ class FFLocalizations { final Locale locale; - static FFLocalizations of(BuildContext context) => Localizations.of(context, FFLocalizations)!; + static FFLocalizations of(BuildContext context) => + Localizations.of(context, FFLocalizations)!; static List languages() => ['pt', 'en']; static late SharedPreferences _prefs; - static Future initialize() async => _prefs = await SharedPreferences.getInstance(); - static Future storeLocale(String locale) => _prefs.setString(_kLocaleStorageKey, locale); + static Future initialize() async => + _prefs = await SharedPreferences.getInstance(); + static Future storeLocale(String locale) => + _prefs.setString(_kLocaleStorageKey, locale); static Locale? getStoredLocale() { final locale = _prefs.getString(_kLocaleStorageKey); return locale != null && locale.isNotEmpty ? createLocale(locale) : null; @@ -23,10 +26,15 @@ class FFLocalizations { String get languageCode => locale.toString(); String? get languageShortCode => - _languagesWithShortCode.contains(locale.toString()) ? '${locale.toString()}_short' : null; - int get languageIndex => languages().contains(languageCode) ? languages().indexOf(languageCode) : 0; + _languagesWithShortCode.contains(locale.toString()) + ? '${locale.toString()}_short' + : null; + int get languageIndex => languages().contains(languageCode) + ? languages().indexOf(languageCode) + : 0; - String getText(String key) => (kTranslationsMap[key] ?? {})[locale.toString()] ?? ''; + String getText(String key) => + (kTranslationsMap[key] ?? {})[locale.toString()] ?? ''; String getVariableText({ String? ptText = '', @@ -75,12 +83,15 @@ class FFLocalizationsDelegate extends LocalizationsDelegate { bool isSupported(Locale locale) { final language = locale.toString(); return FFLocalizations.languages().contains( - language.endsWith('_') ? language.substring(0, language.length - 1) : language, + language.endsWith('_') + ? language.substring(0, language.length - 1) + : language, ); } @override - Future load(Locale locale) => SynchronousFuture(FFLocalizations(locale)); + Future load(Locale locale) => + SynchronousFuture(FFLocalizations(locale)); @override bool shouldReload(FFLocalizationsDelegate old) => false; @@ -1051,8 +1062,10 @@ final kTranslationsMap = >>[ 'en': 'FORGOT YOUR PASSWORD?', }, 'wu2f7yzo': { - 'pt': 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.', - 'en': 'Don\'t worry, we will help you, enter the email registered in the application and click send.', + 'pt': + 'Não se preucupe nós vamos te ajudar, digite o email cadastrado no aplicativo e clique em enviar.', + 'en': + 'Don\'t worry, we will help you, enter the email registered in the application and click send.', }, 'mtz8l7ft': { 'pt': 'E-mail', @@ -1167,8 +1180,10 @@ final kTranslationsMap = >>[ 'en': 'ENTER YOUR PASSWORD', }, 'ujodm2ci': { - 'pt': 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.', - 'en': 'To generate the QR Code, enter the password registered in the application and click send.', + 'pt': + 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.', + 'en': + 'To generate the QR Code, enter the password registered in the application and click send.', }, 'rfqrdet7': { 'pt': 'Senha', diff --git a/lib/flutter_flow/keep_alive_wrapper.dart b/lib/flutter_flow/keep_alive_wrapper.dart index 464ba0ca..286bde09 100644 --- a/lib/flutter_flow/keep_alive_wrapper.dart +++ b/lib/flutter_flow/keep_alive_wrapper.dart @@ -12,7 +12,8 @@ class KeepAliveWidgetWrapper extends StatefulWidget { State createState() => _KeepAliveWidgetWrapperState(); } -class _KeepAliveWidgetWrapperState extends State with AutomaticKeepAliveClientMixin { +class _KeepAliveWidgetWrapperState extends State + with AutomaticKeepAliveClientMixin { @override bool get wantKeepAlive => true; diff --git a/lib/flutter_flow/lat_lng.dart b/lib/flutter_flow/lat_lng.dart index 88ef1eae..9e7b8ea8 100644 --- a/lib/flutter_flow/lat_lng.dart +++ b/lib/flutter_flow/lat_lng.dart @@ -12,5 +12,8 @@ class LatLng { int get hashCode => latitude.hashCode + longitude.hashCode; @override - bool operator ==(other) => other is LatLng && latitude == other.latitude && longitude == other.longitude; + bool operator ==(other) => + other is LatLng && + latitude == other.latitude && + longitude == other.longitude; } diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 8af1b46b..3178c5fd 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -86,10 +86,20 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { builder: (context, _) { return FutureBuilder( future: () async { - final bool isLogged = await StorageHelper().get(SecureStorageKey.isLogged.value) == 'true'; - final bool haveLocal = await StorageHelper().get(SecureStorageKey.haveLocal.value) == 'true'; - final bool haveUserUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key))?.isNotEmpty ?? false; - final bool haveDevUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key))?.isNotEmpty ?? false; + final bool isLogged = + await StorageHelper().get(SecureStorageKey.isLogged.value) == + 'true'; + final bool haveLocal = + await StorageHelper().get(SecureStorageKey.haveLocal.value) == + 'true'; + final bool haveUserUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) + ?.isNotEmpty ?? + false; + final bool haveDevUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) + ?.isNotEmpty ?? + false; if (isLogged && haveDevUUID && haveUserUUID) { return haveLocal @@ -99,17 +109,20 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { create: (context) => MenuBloc( style: MenuView.list_grid, item: EnumMenuItem.button, - entries: MenuEntry.getEntriesByType(MenuEntryType.Home), + entries: MenuEntry.getEntriesByType( + MenuEntryType.Home), )..add(MenuEvent()), ), BlocProvider( create: (context) => HomeBloc()..add(HomeEvent()), ), BlocProvider( - create: (context) => LocalProfileBloc()..add(LocalProfileEvent()), + create: (context) => + LocalProfileBloc()..add(LocalProfileEvent()), ), ], - child: HomePageWidget(key: UniqueKey(), LocalsRepositoryImpl().update), + child: HomePageWidget( + key: UniqueKey(), LocalsRepositoryImpl().update), ) : const ReceptionPageWidget(); } else { @@ -133,8 +146,10 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { name: 'forgotPassword', path: '/forgotPassword', builder: (context, params) { - late final String email = params.getParam('email', ParamType.String); - late final String token = params.getParam('token', ParamType.String); + late final String email = + params.getParam('email', ParamType.String); + late final String token = + params.getParam('token', ParamType.String); return ForgotPasswordScreen( key: UniqueKey(), @@ -151,7 +166,8 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { name: 'homePage', path: '/homePage', builder: (context, params) { - final Future Function(BuildContext context)? update = params.getParam('update', ParamType.Function); + final Future Function(BuildContext context)? update = + params.getParam('update', ParamType.Function); return MultiBlocProvider( providers: [ BlocProvider( @@ -165,39 +181,115 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { create: (context) => HomeBloc()..add(HomeEvent()), ), BlocProvider( - create: (context) => LocalProfileBloc()..add(LocalProfileEvent()), + create: (context) => + LocalProfileBloc()..add(LocalProfileEvent()), ), ], child: HomePageWidget(key: UniqueKey(), update), ); }), - FFRoute(name: 'petsOnThePropertyPage', path: '/petsOnThePropertyPage', builder: (context, params) => Scaffold(body: const PetsHistoryScreen(isApp: true))), - FFRoute(name: 'vehiclesOnThePropertyPage', path: '/vehiclesOnThePropertyPage', builder: (context, params) => const VehicleOnTheProperty()), - FFRoute(name: 'receptionPage', path: '/receptionPage', builder: (context, params) => const ReceptionPageWidget()), - FFRoute(name: 'messageHistoryPage', path: '/messageHistoryPage', builder: (context, params) => const MessageHistoryPageWidget()), - FFRoute(name: 'registerVisitorPage', path: '/registerVisitorPage', builder: (context, params) => const RegisterVisitorPageWidget()), - FFRoute(name: 'scheduleCompleteVisitPage', path: '/scheduleCompleteVisitPage', builder: (context, params) => const ScheduleCompleteVisitPageWidget()), - FFRoute(name: 'deliverySchedule', path: '/deliverySchedule', builder: (context, params) => const DeliverySchedule()), - FFRoute(name: 'provisionalSchedule', path: '/provisionalSchedule', builder: (context, params) => const ProvisionalSchedule()), - FFRoute(name: 'fastPassPage', path: '/fastPassPage', builder: (context, params) => FastPassPageWidget()), - FFRoute(name: 'preferencesSettings', path: '/preferencesSettings', builder: (context, params) => PreferencesPageWidget()), - FFRoute(name: 'aboutProperty', path: '/aboutProperty', builder: (context, params) => AboutPropertyPage()), - FFRoute(name: 'residentsOnThePropertyPage', path: '/residentsOnThePropertyPage', builder: (context, params) => ResidentsOnTheProperty()), - FFRoute(name: 'visitsOnThePropertyPage', path: '/visitsOnThePropertyPage', builder: (context, params) => VisitsOnTheProperty()), - FFRoute(name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => PeopleOnThePropertyPage()), + FFRoute( + name: 'petsOnThePropertyPage', + path: '/petsOnThePropertyPage', + builder: (context, params) => + Scaffold(body: const PetsHistoryScreen(isApp: true))), + FFRoute( + name: 'vehiclesOnThePropertyPage', + path: '/vehiclesOnThePropertyPage', + builder: (context, params) => const VehicleOnTheProperty()), + FFRoute( + name: 'receptionPage', + path: '/receptionPage', + builder: (context, params) => const ReceptionPageWidget()), + FFRoute( + name: 'messageHistoryPage', + path: '/messageHistoryPage', + builder: (context, params) => const MessageHistoryPageWidget()), + FFRoute( + name: 'registerVisitorPage', + path: '/registerVisitorPage', + builder: (context, params) => const RegisterVisitorPageWidget()), + FFRoute( + name: 'scheduleCompleteVisitPage', + path: '/scheduleCompleteVisitPage', + builder: (context, params) => + const ScheduleCompleteVisitPageWidget()), + FFRoute( + name: 'deliverySchedule', + path: '/deliverySchedule', + builder: (context, params) => const DeliverySchedule()), + FFRoute( + name: 'provisionalSchedule', + path: '/provisionalSchedule', + builder: (context, params) => const ProvisionalSchedule()), + FFRoute( + name: 'fastPassPage', + path: '/fastPassPage', + builder: (context, params) => FastPassPageWidget()), + FFRoute( + name: 'preferencesSettings', + path: '/preferencesSettings', + builder: (context, params) => PreferencesPageWidget()), + FFRoute( + name: 'aboutProperty', + path: '/aboutProperty', + builder: (context, params) => AboutPropertyPage()), + FFRoute( + name: 'residentsOnThePropertyPage', + path: '/residentsOnThePropertyPage', + builder: (context, params) => ResidentsOnTheProperty()), + FFRoute( + name: 'visitsOnThePropertyPage', + path: '/visitsOnThePropertyPage', + builder: (context, params) => VisitsOnTheProperty()), + FFRoute( + name: 'peopleOnThePropertyPage', + path: '/peopleOnThePropertyPage', + builder: (context, params) => PeopleOnThePropertyPage()), FFRoute( name: 'acessHistoryPage', path: '/acessHistoryPage', - builder: (context, params) => AccessHistoryScreen(opt: const {'personType': '.*', 'accessType': '.*', 'search': '.*'})), - FFRoute(name: 'provisionalHistoryPage', path: '/provisionalHistoryPage', builder: (context, params) => ProvisionalHistoryPage()), - FFRoute(name: 'liberationHistory', path: '/liberationHistory', builder: (context, params) => const LiberationHistoryWidget()), - FFRoute(name: 'signInPage', path: '/signInPage', builder: (context, params) => const SignInPageWidget()), - FFRoute(name: 'signUpPage', path: '/signUpPage', builder: (context, params) => const SignUpPageWidget()), - FFRoute(name: 'welcomePage', path: '/welcomePage', builder: (context, params) => const WelcomePageWidget()), - FFRoute(name: 'qrCodePage', path: '/qrCodePage', builder: (context, params) => const QrCodePageWidget()), - FFRoute(name: 'preferencesPage', path: '/preferencesPage', builder: (context, params) => PreferencesPageWidget()), - FFRoute(name: 'packageOrder', path: '/packageOrder', builder: (context, params) => const PackageOrderPage()), - FFRoute(name: 'reservation', path: '/reservation', builder: (context, params) => ReservationPageWidget()), + builder: (context, params) => AccessHistoryScreen(opt: const { + 'personType': '.*', + 'accessType': '.*', + 'search': '.*' + })), + FFRoute( + name: 'provisionalHistoryPage', + path: '/provisionalHistoryPage', + builder: (context, params) => ProvisionalHistoryPage()), + FFRoute( + name: 'liberationHistory', + path: '/liberationHistory', + builder: (context, params) => const LiberationHistoryWidget()), + FFRoute( + name: 'signInPage', + path: '/signInPage', + builder: (context, params) => const SignInPageWidget()), + FFRoute( + name: 'signUpPage', + path: '/signUpPage', + builder: (context, params) => const SignUpPageWidget()), + FFRoute( + name: 'welcomePage', + path: '/welcomePage', + builder: (context, params) => const WelcomePageWidget()), + FFRoute( + name: 'qrCodePage', + path: '/qrCodePage', + builder: (context, params) => const QrCodePageWidget()), + FFRoute( + name: 'preferencesPage', + path: '/preferencesPage', + builder: (context, params) => PreferencesPageWidget()), + FFRoute( + name: 'packageOrder', + path: '/packageOrder', + builder: (context, params) => const PackageOrderPage()), + FFRoute( + name: 'reservation', + path: '/reservation', + builder: (context, params) => ReservationPageWidget()), FFRoute( name: 'petsPage', path: '/petsPage', @@ -213,7 +305,9 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) { extension NavParamExtensions on Map { Map get withoutNulls => Map.fromEntries( - entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value!)), + entries + .where((e) => e.value != null) + .map((e) => MapEntry(e.key, e.value!)), ); } @@ -227,18 +321,23 @@ extension NavigationExtensions on BuildContext { } extension _GoRouterStateExtensions on GoRouterState { - Map get extraMap => extra != null ? extra as Map : {}; + Map get extraMap => + extra != null ? extra as Map : {}; Map get allParams => {} ..addAll(pathParameters) ..addAll(uri.queryParameters) ..addAll(extraMap); - TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey) ? extraMap[kTransitionInfoKey] as TransitionInfo : TransitionInfo.appDefault(); + TransitionInfo get transitionInfo => extraMap.containsKey(kTransitionInfoKey) + ? extraMap[kTransitionInfoKey] as TransitionInfo + : TransitionInfo.appDefault(); } extension GoRouterLocationExtension on GoRouter { String getCurrentLocation() { final RouteMatch lastMatch = routerDelegate.currentConfiguration.last; - final RouteMatchList matchList = lastMatch is ImperativeRouteMatch ? lastMatch.matches : routerDelegate.currentConfiguration; + final RouteMatchList matchList = lastMatch is ImperativeRouteMatch + ? lastMatch.matches + : routerDelegate.currentConfiguration; return matchList.uri.toString(); } } @@ -250,13 +349,18 @@ class FFParameters { final Map Function(String)> asyncParams; Map futureParamValues = {}; - bool get isEmpty => state.allParams.isEmpty || (state.allParams.length == 1 && state.extraMap.containsKey(kTransitionInfoKey)); - bool isAsyncParam(MapEntry param) => asyncParams.containsKey(param.key) && param.value is String; + bool get isEmpty => + state.allParams.isEmpty || + (state.allParams.length == 1 && + state.extraMap.containsKey(kTransitionInfoKey)); + bool isAsyncParam(MapEntry param) => + asyncParams.containsKey(param.key) && param.value is String; bool get hasFutures => state.allParams.entries.any(isAsyncParam); Future completeFutures() => Future.wait( state.allParams.entries.where(isAsyncParam).map( (param) async { - final doc = await asyncParams[param.key]!(param.value).onError((_, __) => null); + final doc = await asyncParams[param.key]!(param.value) + .onError((_, __) => null); if (doc != null) { futureParamValues[param.key] = doc; return true; @@ -266,12 +370,15 @@ class FFParameters { ), ).onError((_, __) => [false]).then((v) => v.every((e) => e)); - dynamic getParam(String paramName, ParamType type, {bool isList = false, StructBuilder? structBuilder}) { - if (futureParamValues.containsKey(paramName)) return futureParamValues[paramName]; + dynamic getParam(String paramName, ParamType type, + {bool isList = false, StructBuilder? structBuilder}) { + if (futureParamValues.containsKey(paramName)) + return futureParamValues[paramName]; if (!state.allParams.containsKey(paramName)) return null; final param = state.allParams[paramName]; if (param is! String) return param; - return deserializeParam(param, type, isList, structBuilder: structBuilder); + return deserializeParam(param, type, isList, + structBuilder: structBuilder); } } @@ -311,13 +418,16 @@ class FFRoute { key: state.pageKey, child: child, transitionDuration: transitionInfo.duration, - transitionsBuilder: (context, animation, secondaryAnimation, child) => PageTransition( + transitionsBuilder: + (context, animation, secondaryAnimation, child) => + PageTransition( type: transitionInfo.transitionType, duration: transitionInfo.duration, reverseDuration: transitionInfo.duration, alignment: transitionInfo.alignment, child: child, - ).buildTransitions(context, animation, secondaryAnimation, child), + ).buildTransitions( + context, animation, secondaryAnimation, child), ) : MaterialPage(key: state.pageKey, child: child); }, @@ -338,7 +448,8 @@ class TransitionInfo { final Duration duration; final Alignment? alignment; - static TransitionInfo appDefault() => const TransitionInfo(hasTransition: false); + static TransitionInfo appDefault() => + const TransitionInfo(hasTransition: false); } class RootPageContext { @@ -350,8 +461,11 @@ class RootPageContext { final rootPageContext = context.read(); final isRootPage = rootPageContext?.isRootPage ?? false; final location = GoRouterState.of(context).uri.toString(); - return isRootPage && location != '/' && location != rootPageContext?.errorRoute; + return isRootPage && + location != '/' && + location != rootPageContext?.errorRoute; } - static Widget wrap(Widget child, {String? errorRoute}) => Provider.value(value: RootPageContext(true, errorRoute), child: child); + static Widget wrap(Widget child, {String? errorRoute}) => + Provider.value(value: RootPageContext(true, errorRoute), child: child); } diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart index 97a91ecf..a4d36fd0 100644 --- a/lib/flutter_flow/nav/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -25,7 +25,8 @@ String placeToString(FFPlace place) => jsonEncode({ 'zipCode': place.zipCode, }); -String uploadedFileToString(FFUploadedFile uploadedFile) => uploadedFile.serialize(); +String uploadedFileToString(FFUploadedFile uploadedFile) => + uploadedFile.serialize(); String? serializeParam( dynamic param, @@ -37,7 +38,11 @@ String? serializeParam( return null; } if (isList) { - final serializedValues = (param as Iterable).map((p) => serializeParam(p, paramType, isList: false)).where((p) => p != null).map((p) => p!).toList(); + final serializedValues = (param as Iterable) + .map((p) => serializeParam(p, paramType, isList: false)) + .where((p) => p != null) + .map((p) => p!) + .toList(); return json.encode(serializedValues); } String? data; @@ -109,7 +114,9 @@ LatLng? latLngFromString(String? latLngStr) { FFPlace placeFromString(String placeStr) { final serializedData = jsonDecode(placeStr) as Map; final data = { - 'latLng': serializedData.containsKey('latLng') ? latLngFromString(serializedData['latLng'] as String) : const LatLng(0.0, 0.0), + 'latLng': serializedData.containsKey('latLng') + ? latLngFromString(serializedData['latLng'] as String) + : const LatLng(0.0, 0.0), 'name': serializedData['name'] ?? '', 'address': serializedData['address'] ?? '', 'city': serializedData['city'] ?? '', @@ -128,7 +135,8 @@ FFPlace placeFromString(String placeStr) { ); } -FFUploadedFile uploadedFileFromString(String uploadedFileStr) => FFUploadedFile.deserialize(uploadedFileStr); +FFUploadedFile uploadedFileFromString(String uploadedFileStr) => + FFUploadedFile.deserialize(uploadedFileStr); enum ParamType { int, @@ -188,7 +196,9 @@ dynamic deserializeParam( return param == 'true'; case ParamType.DateTime: final milliseconds = int.tryParse(param); - return milliseconds != null ? DateTime.fromMillisecondsSinceEpoch(milliseconds) : null; + return milliseconds != null + ? DateTime.fromMillisecondsSinceEpoch(milliseconds) + : null; case ParamType.DateTimeRange: return dateTimeRangeFromString(param); case ParamType.LatLng: diff --git a/lib/flutter_flow/permissions_util.dart b/lib/flutter_flow/permissions_util.dart index 31c0ad28..08009e6e 100644 --- a/lib/flutter_flow/permissions_util.dart +++ b/lib/flutter_flow/permissions_util.dart @@ -13,4 +13,5 @@ Future getPermissionStatus(Permission setting) async { return kPermissionStateToBool[status]!; } -Future requestPermission(Permission setting) async => await setting.request(); +Future requestPermission(Permission setting) async => + await setting.request(); diff --git a/lib/flutter_flow/random_data_util.dart b/lib/flutter_flow/random_data_util.dart index c3e508f7..6599e5a6 100644 --- a/lib/flutter_flow/random_data_util.dart +++ b/lib/flutter_flow/random_data_util.dart @@ -29,14 +29,16 @@ String randomString( if (digits) { chars += '0123456789'; } - return List.generate(randomInteger(minLength, maxLength), (index) => chars[_random.nextInt(chars.length)]).join(); + return List.generate(randomInteger(minLength, maxLength), + (index) => chars[_random.nextInt(chars.length)]).join(); } // Random date between 1970 and 2025. DateTime randomDate() { // Random max must be in range 0 < max <= 2^32. // So we have to generate the time in seconds and then convert to milliseconds. - return DateTime.fromMillisecondsSinceEpoch(randomInteger(0, 1735689600) * 1000); + return DateTime.fromMillisecondsSinceEpoch( + randomInteger(0, 1735689600) * 1000); } String randomImageUrl(int width, int height) { @@ -44,5 +46,6 @@ String randomImageUrl(int width, int height) { } Color randomColor() { - return Color.fromARGB(255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); + return Color.fromARGB( + 255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); } diff --git a/lib/flutter_flow/request_manager.dart b/lib/flutter_flow/request_manager.dart index d130fb08..f26ed03b 100644 --- a/lib/flutter_flow/request_manager.dart +++ b/lib/flutter_flow/request_manager.dart @@ -24,7 +24,8 @@ class FutureRequestManager { } // Remove the first cached result if we have reached the specified limit, // since we will be adding another. - if (!_requests.containsKey(uniqueQueryKey) && _requests.length >= cacheLimit) { + if (!_requests.containsKey(uniqueQueryKey) && + _requests.length >= cacheLimit) { _requests.remove(_requests.keys.first); } // Return the cached query result or set it to the new value. @@ -68,8 +69,9 @@ class StreamRequestManager { // Create a subscription that stores the latest result in the behavior subject. final streamSubject = BehaviorSubject(); - _requestSubscriptions[uniqueQueryKey] = - requestFn().asBroadcastStream().listen((result) => streamSubject.add(result)); + _requestSubscriptions[uniqueQueryKey] = requestFn() + .asBroadcastStream() + .listen((result) => streamSubject.add(result)); _streamSubjects[uniqueQueryKey] = streamSubject; return streamSubject.stream; @@ -87,4 +89,5 @@ class StreamRequestManager { }.forEach(clearRequest); } -String _requestKey(String? key) => key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; +String _requestKey(String? key) => + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index de53d20f..55bccc25 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -66,7 +66,9 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ enableLandmarks: true, ), ); - createUploadMediaListTile(String label, MediaSource mediaSource, IconData icon) => ListTile( + createUploadMediaListTile( + String label, MediaSource mediaSource, IconData icon) => + ListTile( title: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -109,12 +111,15 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), child: ListTile( title: Text( - FFLocalizations.of(context) - .getVariableText(ptText: "Escolha uma das opções", enText: "Choose one of the options"), + FFLocalizations.of(context).getVariableText( + ptText: "Escolha uma das opções", + enText: "Choose one of the options"), textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 14, ), @@ -130,35 +135,40 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ if (allowPhoto && allowVideo) ...[ Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context) - .getVariableText(ptText: "Galeria (Foto)", enText: "Gallery (Photo)"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Foto)", + enText: "Gallery (Photo)"), MediaSource.photoGallery, Icons.camera), ), Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context) - .getVariableText(ptText: "Galeria (Video)", enText: "Gallery (Video)"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Video)", + enText: "Gallery (Video)"), MediaSource.videoGallery, Icons.videocam), ) ] else if (allowPhoto) Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), MediaSource.photoGallery, Icons.photo)) else Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), MediaSource.videoGallery, Icons.videocam), ), if (!kIsWeb) ...[ Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Camera", enText: "Camera"), + FFLocalizations.of(context).getVariableText( + ptText: "Camera", enText: "Camera"), MediaSource.camera, Icons.camera_alt), ) @@ -177,8 +187,8 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ maxWidth: maxWidth, maxHeight: maxHeight, imageQuality: imageQuality, - isVideo: - mediaSource == MediaSource.videoGallery || (mediaSource == MediaSource.camera && allowVideo && !allowPhoto), + isVideo: mediaSource == MediaSource.videoGallery || + (mediaSource == MediaSource.camera && allowVideo && !allowPhoto), mediaSource: mediaSource, includeDimensions: includeDimensions, includeBlurHash: includeBlurHash, @@ -193,14 +203,16 @@ Future?> selectMediaWithSourceBottomSheetandFaceDetection({ final inputImage = InputImage.fromFilePath(media.filePath!); final faces = await faceDetector.processImage(inputImage); if (faces.isEmpty) { - final String message = FFLocalizations.of(context) - .getVariableText(ptText: "Nenhuma face detectada na imagem", enText: "No face detected in the image"); + final String message = FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma face detectada na imagem", + enText: "No face detected in the image"); await DialogUtil.error(context, message); return null; } if (faces.length > 1) { final String message = FFLocalizations.of(context).getVariableText( - ptText: "Mais de uma face detectada na imagem", enText: "More than one face detected in the image"); + ptText: "Mais de uma face detectada na imagem", + enText: "More than one face detected in the image"); await DialogUtil.error(context, message); return null; } @@ -223,7 +235,9 @@ Future?> selectMediaWithSourceBottomSheet({ bool includeDimensions = false, bool includeBlurHash = false, }) async { - createUploadMediaListTile(String label, MediaSource mediaSource, IconData icon) => ListTile( + createUploadMediaListTile( + String label, MediaSource mediaSource, IconData icon) => + ListTile( title: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -267,12 +281,15 @@ Future?> selectMediaWithSourceBottomSheet({ padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), child: ListTile( title: Text( - FFLocalizations.of(context) - .getVariableText(ptText: "Escolha uma das opções", enText: "Choose one of the options"), + FFLocalizations.of(context).getVariableText( + ptText: "Escolha uma das opções", + enText: "Choose one of the options"), textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65), + color: FlutterFlowTheme.of(context) + .primaryText + .withOpacity(0.65), fontWeight: FontWeight.w500, fontSize: 14, ), @@ -288,35 +305,40 @@ Future?> selectMediaWithSourceBottomSheet({ if (allowPhoto && allowVideo) ...[ Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context) - .getVariableText(ptText: "Galeria (Foto)", enText: "Gallery (Photo)"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Foto)", + enText: "Gallery (Photo)"), MediaSource.photoGallery, Icons.camera), ), Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context) - .getVariableText(ptText: "Galeria (Video)", enText: "Gallery (Video)"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Video)", + enText: "Gallery (Video)"), MediaSource.videoGallery, Icons.videocam), ) ] else if (allowPhoto) Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), MediaSource.photoGallery, Icons.photo)) else Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Galeria", enText: "Gallery"), + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), MediaSource.videoGallery, Icons.videocam), ), if (!kIsWeb) ...[ Expanded( child: createUploadMediaListTile( - FFLocalizations.of(context).getVariableText(ptText: "Camera", enText: "Camera"), + FFLocalizations.of(context).getVariableText( + ptText: "Camera", enText: "Camera"), MediaSource.camera, Icons.camera_alt), ) @@ -335,8 +357,8 @@ Future?> selectMediaWithSourceBottomSheet({ maxWidth: maxWidth, maxHeight: maxHeight, imageQuality: imageQuality, - isVideo: - mediaSource == MediaSource.videoGallery || (mediaSource == MediaSource.camera && allowVideo && !allowPhoto), + isVideo: mediaSource == MediaSource.videoGallery || + (mediaSource == MediaSource.camera && allowVideo && !allowPhoto), mediaSource: mediaSource, includeDimensions: includeDimensions, includeBlurHash: includeBlurHash, @@ -386,7 +408,9 @@ Future?> selectMedia({ })); } - final source = mediaSource == MediaSource.camera ? ImageSource.camera : ImageSource.gallery; + final source = mediaSource == MediaSource.camera + ? ImageSource.camera + : ImageSource.gallery; final pickedMediaFuture = isVideo ? picker.pickVideo(source: source) : picker.pickImage( @@ -457,7 +481,8 @@ Future?> selectFiles({ return Future.wait(pickedFiles.files.asMap().entries.map((e) async { final index = e.key; final file = e.value; - final storagePath = _getStoragePath(storageFolderPath, file.name, false, index); + final storagePath = + _getStoragePath(storageFolderPath, file.name, false, index); return SelectedFile( storagePath: storagePath, filePath: isWeb ? null : file.path, @@ -554,7 +579,8 @@ void showUploadMessage( padding: const EdgeInsetsDirectional.only(end: 10.0), child: CircularProgressIndicator( valueColor: Theme.of(context).brightness == Brightness.dark - ? AlwaysStoppedAnimation(FlutterFlowTheme.of(context).info) + ? AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).info) : null, ), ), @@ -572,10 +598,12 @@ void showUploadMessage( topRight: Radius.circular(15), ), ), - duration: showLoading ? const Duration(days: 1) : const Duration(seconds: 4), + duration: + showLoading ? const Duration(days: 1) : const Duration(seconds: 4), ), ); } -String? _removeTrailingSlash(String? path) => - path != null && path.endsWith('/') ? path.substring(0, path.length - 1) : path; +String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/') + ? path.substring(0, path.length - 1) + : path; diff --git a/lib/main.dart b/lib/main.dart index 23e155e3..f2565331 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -32,7 +32,10 @@ Future _foregroundHandlerMessage(RemoteMessage message) async { } if (!Platform.isIOS) { - NotificationService.show(title: message.notification!.title!, body: message.notification!.body!, payload: Map.from(message.data)); + NotificationService.show( + title: message.notification!.title!, + body: message.notification!.body!, + payload: Map.from(message.data)); } } @@ -49,7 +52,8 @@ class App extends StatefulWidget { @override State createState() => _AppState(); - static _AppState of(BuildContext context) => context.findAncestorStateOfType<_AppState>()!; + static _AppState of(BuildContext context) => + context.findAncestorStateOfType<_AppState>()!; } class _AppState extends State { @@ -91,7 +95,8 @@ class _AppState extends State { }), ), ); - final Iterable>? localizationsDelegates = const [ + final Iterable>? localizationsDelegates = + const [ FFLocalizationsDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, @@ -133,7 +138,8 @@ class _AppState extends State { await StorageHelper().set(SecureStorageKey.haveLocal.value, true); log('onMessageOpenedApp'); } else { - onMessageReceived(message.data, message.notification!.body, message.data['click_action']); + onMessageReceived(message.data, message.notification!.body, + message.data['click_action']); } }); FirebaseMessaging.instance.getInitialMessage().then((message) async { diff --git a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart index 148a4220..43872127 100644 --- a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart +++ b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart @@ -50,7 +50,8 @@ class _DeliveryScheduleState extends State { }, ), title: Text( - FFLocalizations.of(context).getVariableText(enText: 'Delivery Schedule', ptText: 'Agendar Entregas'), + FFLocalizations.of(context).getVariableText( + enText: 'Delivery Schedule', ptText: 'Agendar Entregas'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -64,6 +65,7 @@ class _DeliveryScheduleState extends State { centerTitle: true, elevation: 0.0, ), - body: const SafeArea(top: true, child: ScheduleProvisionalVisitPageWidget())); + body: const SafeArea( + top: true, child: ScheduleProvisionalVisitPageWidget())); } } diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart index 5c88e7a7..6cc9a845 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -24,11 +24,16 @@ class _FastPassPageWidgetState extends State { late InAppWebViewController _controllerIOS; Future> initVariables() async { - final email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; - final name = (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final email = + (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; + final name = + (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const createdAt = '0000-00-00 00:00:00'; final url = 'https://hub.freaccess.com.br/hub/fast-pass/$cliUUID'; final freUserData = @@ -54,14 +59,20 @@ class _FastPassPageWidgetState extends State { builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return const Center(child: CircularProgressIndicator()); - } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { - return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); + } else if (snapshot.hasError || + !snapshot.hasData || + snapshot.data!.isEmpty) { + return Center( + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'Unexpected error', ptText: 'Erro inesperado'))); } else { final data = snapshot.data!; final url = data['url']!; final userUUID = data['userUUID']!; final freUserData = data['freUserData']!; - return Platform.isIOS ? _buildIOSWebView(url, userUUID, freUserData) : _buildAndroidWebView(url, userUUID, freUserData); + return Platform.isIOS + ? _buildIOSWebView(url, userUUID, freUserData) + : _buildAndroidWebView(url, userUUID, freUserData); } }, ), @@ -79,9 +90,14 @@ class _FastPassPageWidgetState extends State { ), onWebViewCreated: (controller) async => _controllerIOS = controller, onLoadStop: (controller, url) async { - await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-token', '\"$userUUID\"')"); - await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-user-data', '$freUserData')"); - await controller.evaluateJavascript(source: "window.localStorage.setItem('enableBackButton', 'true')"); + await controller.evaluateJavascript( + source: + "window.localStorage.setItem('fre-token', '\"$userUUID\"')"); + await controller.evaluateJavascript( + source: + "window.localStorage.setItem('fre-user-data', '$freUserData')"); + await controller.evaluateJavascript( + source: "window.localStorage.setItem('enableBackButton', 'true')"); }, onUpdateVisitedHistory: (controller, uri, isVisited) { if (uri.toString().contains('/hub/home')) context.pop(); @@ -99,23 +115,30 @@ class _FastPassPageWidgetState extends State { ..setNavigationDelegate( NavigationDelegate( onPageStarted: (String url) { - final String token = "localStorage.setItem('fre-token', '\"$userUUID\"');"; - final String data = "localStorage.setItem('fre-user-data', '$freUserData');"; - const String backNavigation = "localStorage.setItem('enableBackButton', 'true');"; + final String token = + "localStorage.setItem('fre-token', '\"$userUUID\"');"; + final String data = + "localStorage.setItem('fre-user-data', '$freUserData');"; + const String backNavigation = + "localStorage.setItem('enableBackButton', 'true');"; _controllerAndroid.runJavaScript(token); _controllerAndroid.runJavaScript(data); _controllerAndroid.runJavaScript(backNavigation); }, onPageFinished: (String url) { - bool isDarkMode = SchedulerBinding.instance.platformDispatcher.platformBrightness == Brightness.dark; + bool isDarkMode = SchedulerBinding + .instance.platformDispatcher.platformBrightness == + Brightness.dark; if (isDarkMode) { _controllerAndroid.runJavaScript(WebviewUtil.jsEnableDarkMode); } }, onNavigationRequest: (NavigationRequest request) { - if (request.url.startsWith('http') || request.url.startsWith('https://api.whatsapp.com/send') || request.url.startsWith('https://wa.me')) { + if (request.url.startsWith('http') || + request.url.startsWith('https://api.whatsapp.com/send') || + request.url.startsWith('https://wa.me')) { launchUrlString(request.url); return NavigationDecision.prevent; } diff --git a/lib/pages/forgot_password_page/forgot_password_model.dart b/lib/pages/forgot_password_page/forgot_password_model.dart index 56580cac..dc6cab21 100644 --- a/lib/pages/forgot_password_page/forgot_password_model.dart +++ b/lib/pages/forgot_password_page/forgot_password_model.dart @@ -10,8 +10,10 @@ class ForgotPasswordScreenModel extends FlutterFlowModel { FocusNode? passwordRegisterFormFocusNode; TextEditingController? passwordRegisterFormTextController; late bool passwordRegisterFormVisibility; - String? Function(BuildContext, String?)? passwordRegisterFormTextControllerValidator; - String? _passwordRegisterFormTextControllerValidator(BuildContext context, String? val) { + String? Function(BuildContext, String?)? + passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getVariableText( ptText: 'Campo é necessário', @@ -29,8 +31,10 @@ class ForgotPasswordScreenModel extends FlutterFlowModel { FocusNode? passwordConfirmFormFocusNode; TextEditingController? passwordConfirmFormTextController; late bool passwordConfirmFormVisibility; - String? Function(BuildContext, String?)? passwordConfirmFormTextControllerValidator; - String? _passwordConfirmFormTextControllerValidator(BuildContext context, String? val) { + String? Function(BuildContext, String?)? + passwordConfirmFormTextControllerValidator; + String? _passwordConfirmFormTextControllerValidator( + BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getVariableText( ptText: 'Campo é necessário', @@ -66,9 +70,11 @@ class ForgotPasswordScreenModel extends FlutterFlowModel { @override void initState(BuildContext context) { passwordRegisterFormVisibility = false; - passwordRegisterFormTextControllerValidator = _passwordRegisterFormTextControllerValidator; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; passwordConfirmFormVisibility = false; - passwordConfirmFormTextControllerValidator = _passwordConfirmFormTextControllerValidator; + passwordConfirmFormTextControllerValidator = + _passwordConfirmFormTextControllerValidator; } @override diff --git a/lib/pages/forgot_password_page/forgot_password_screen.dart b/lib/pages/forgot_password_page/forgot_password_screen.dart index e5742371..617b46d3 100644 --- a/lib/pages/forgot_password_page/forgot_password_screen.dart +++ b/lib/pages/forgot_password_page/forgot_password_screen.dart @@ -15,7 +15,8 @@ import '../../flutter_flow/internationalization.dart'; import 'forgot_password_model.dart'; class ForgotPasswordScreen extends StatefulWidget { - const ForgotPasswordScreen({super.key, required this.email, required this.token}); + const ForgotPasswordScreen( + {super.key, required this.email, required this.token}); final String email; final String token; @@ -23,7 +24,8 @@ class ForgotPasswordScreen extends StatefulWidget { State createState() => _ForgotPasswordScreenState(); } -class _ForgotPasswordScreenState extends State with TickerProviderStateMixin { +class _ForgotPasswordScreenState extends State + with TickerProviderStateMixin { late ForgotPasswordScreenModel _model; final animationsMap = {}; @@ -147,7 +149,8 @@ class _ForgotPasswordScreenState extends State with Ticker width: MediaQuery.of(context).size.width, child: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0, bottom: 0.0), + padding: const EdgeInsets.only( + left: 15.0, right: 15.0, top: 10.0, bottom: 0.0), child: Container( width: double.infinity, constraints: const BoxConstraints(maxWidth: 570.0), @@ -156,7 +159,8 @@ class _ForgotPasswordScreenState extends State with Ticker borderRadius: BorderRadius.circular(12.0), ), child: Padding( - padding: const EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0, bottom: 0.0), + padding: const EdgeInsets.only( + left: 20.0, right: 20.0, top: 10.0, bottom: 0.0), child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -170,20 +174,25 @@ class _ForgotPasswordScreenState extends State with Ticker fontSize: 24.0, fontWeight: FontWeight.bold, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), ), )), Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(20.0, 24.0, 0.0, 30.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), child: Text( message, textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), ), ), @@ -199,26 +208,42 @@ class _ForgotPasswordScreenState extends State with Ticker controller: _model.passwordRegisterFormTextController, focusNode: _model.passwordRegisterFormFocusNode, visibility: _model.passwordRegisterFormVisibility, - onVisibilityToggle: () => setState(() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility), - label: FFLocalizations.of(context).getVariableText(ptText: 'Nova Senha', enText: 'New Password'), - hint: FFLocalizations.of(context).getVariableText(ptText: 'Insira sua senha', enText: 'Enter your password'), - asValidator: _model.passwordRegisterFormTextControllerValidator.asValidator(context), + onVisibilityToggle: () => setState(() => + _model.passwordRegisterFormVisibility = + !_model.passwordRegisterFormVisibility), + label: FFLocalizations.of(context).getVariableText( + ptText: 'Nova Senha', enText: 'New Password'), + hint: FFLocalizations.of(context).getVariableText( + ptText: 'Insira sua senha', + enText: 'Enter your password'), + asValidator: _model + .passwordRegisterFormTextControllerValidator + .asValidator(context), ), _buildPasswordField( context, controller: _model.passwordConfirmFormTextController, focusNode: _model.passwordConfirmFormFocusNode, visibility: _model.passwordConfirmFormVisibility, - onVisibilityToggle: () => setState(() => _model.passwordConfirmFormVisibility = !_model.passwordConfirmFormVisibility), - label: FFLocalizations.of(context).getVariableText(ptText: 'Confirme a Senha', enText: 'Confirm Password'), - hint: FFLocalizations.of(context).getVariableText(ptText: 'Confirme sua senha', enText: 'Confirm your password'), - asValidator: _model.passwordConfirmFormTextControllerValidator.asValidator(context), + onVisibilityToggle: () => setState(() => + _model.passwordConfirmFormVisibility = + !_model.passwordConfirmFormVisibility), + label: FFLocalizations.of(context).getVariableText( + ptText: 'Confirme a Senha', + enText: 'Confirm Password'), + hint: FFLocalizations.of(context).getVariableText( + ptText: 'Confirme sua senha', + enText: 'Confirm your password'), + asValidator: _model + .passwordConfirmFormTextControllerValidator + .asValidator(context), ), ], ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( key: const ValueKey('SubmitButtonWidget'), onPressed: _model.isFormInvalid() @@ -240,16 +265,22 @@ class _ForgotPasswordScreenState extends State with Ticker width: double.infinity, height: 44.0, color: FlutterFlowTheme.of(context).accent1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 16.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')), + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of(context).secondaryText, + fontSize: 16.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans')), elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), + borderSide: const BorderSide( + color: Colors.transparent, width: 1.0), borderRadius: BorderRadius.circular(12.0), - disabledColor: FlutterFlowTheme.of(context).customColor5, + disabledColor: + FlutterFlowTheme.of(context).customColor5, disabledTextColor: Colors.white, ), showLoadingIndicator: true, @@ -297,22 +328,28 @@ class _ForgotPasswordScreenState extends State with Ticker color: FlutterFlowTheme.of(context).primaryText, fontSize: 16.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: FlutterFlowTheme.of(context).customColor1, width: 0.25), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).customColor1, + width: 0.25), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), + borderSide: + const BorderSide(color: Color(0xFF1AAB5F), width: 0.25), borderRadius: BorderRadius.circular(12.0), ), errorBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), + borderSide: + const BorderSide(color: Color(0xFFFF5963), width: 0.25), borderRadius: BorderRadius.circular(12.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: const BorderSide(color: Color(0xFFFF5963), width: 0.25), + borderSide: + const BorderSide(color: Color(0xFFFF5963), width: 0.25), borderRadius: BorderRadius.circular(12.0), ), filled: true, @@ -322,7 +359,9 @@ class _ForgotPasswordScreenState extends State with Ticker onTap: onVisibilityToggle, focusNode: FocusNode(skipTraversal: true), child: Icon( - visibility ? Icons.visibility_outlined : Icons.visibility_off_outlined, + visibility + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, color: FlutterFlowTheme.of(context).accent1, size: 24.0, ), @@ -333,7 +372,8 @@ class _ForgotPasswordScreenState extends State with Ticker color: FlutterFlowTheme.of(context).primaryText, fontSize: 16.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), ), validator: asValidator, ), diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart index f51d5d65..dc93f26b 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -27,7 +27,8 @@ class LiberationHistoryModel extends FlutterFlowModel { requestFn: requestFn, ); void clearGetLiberationsCache() => _getLiberationsManager.clear(); - void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey); + void clearGetLiberationsCacheKey(String? uniqueKey) => + _getLiberationsManager.clearRequest(uniqueKey); @override void initState(BuildContext context) { @@ -36,11 +37,18 @@ class LiberationHistoryModel extends FlutterFlowModel { Future init() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } - Future answersRequest({required BuildContext context, required String? ref, required String? task, required String? response, required String? id}) async { + Future answersRequest( + {required BuildContext context, + required String? ref, + required String? task, + required String? response, + required String? id}) async { final ApiCallResponse? respondeSolicitacaoCall; final RespondeSolicitacaoCall callback = PhpGroup.respondeSolicitacaoCall; diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 50f060d4..53c22e26 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -19,7 +19,8 @@ class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @override - State createState() => _LiberationHistoryWidgetState(); + State createState() => + _LiberationHistoryWidgetState(); } class _LiberationHistoryWidgetState extends State { @@ -54,22 +55,35 @@ class _LiberationHistoryWidgetState extends State { Map _labelsHashMap(dynamic request, bool details) { return Map.from({ - '${FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name')}:': request['VTE_NOME'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name')}:': + request['VTE_NOME'], '${FFLocalizations.of(context).getVariableText(ptText: 'Dt. Envio', enText: 'Date Send')}:': - request['NOT_DTENVIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', request['NOT_DTENVIO']) : '', - '${FFLocalizations.of(context).getVariableText(ptText: 'Motivo', enText: 'Reason')}:': request['NOT_MOTIVO'], - if (details == true) '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': request['NOT_MSGENVIO'], + request['NOT_DTENVIO'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', request['NOT_DTENVIO']) + : '', + '${FFLocalizations.of(context).getVariableText(ptText: 'Motivo', enText: 'Reason')}:': + request['NOT_MOTIVO'], + if (details == true) + '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': + request['NOT_MSGENVIO'], }); } Map _statusHashMap(dynamic request) { return Map.from({ if (request['NOT_STATUS'] == 'L') - FFLocalizations.of(context).getVariableText(ptText: 'Finalizado', enText: 'Finished'): FlutterFlowTheme.of(context).success + FFLocalizations.of(context).getVariableText( + ptText: 'Finalizado', + enText: 'Finished'): FlutterFlowTheme.of(context).success else if (request['NOT_STATUS'] == 'B') - FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked'): FlutterFlowTheme.of(context).error else - FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).warning + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active'): FlutterFlowTheme.of(context).warning }); } @@ -135,12 +149,16 @@ class _LiberationHistoryWidgetState extends State { mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhuma solicitação encontrada!", enText: "No requests found")), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma solicitação encontrada!", + enText: "No requests found")), ) ], ), ) - else if (_hasData == true && _loading == false && _requestWrap.isNotEmpty) + else if (_hasData == true && + _loading == false && + _requestWrap.isNotEmpty) Expanded(child: _listItems(context)), if (_loading == true) Container( @@ -197,7 +215,8 @@ class _LiberationHistoryWidgetState extends State { buttons: [ if (liberationHistoryItem['NOT_STATUS'] == 'S') FFButtonWidget( - text: FFLocalizations.of(context).getVariableText(ptText: "Aceitar", enText: "Accept"), + text: FFLocalizations.of(context) + .getVariableText(ptText: "Aceitar", enText: "Accept"), options: FFButtonOptions( width: 130, height: 40, @@ -252,7 +271,8 @@ class _LiberationHistoryWidgetState extends State { ), if (liberationHistoryItem['NOT_STATUS'] == 'S') FFButtonWidget( - text: FFLocalizations.of(context).getVariableText(ptText: "Bloquear", enText: "Block"), + text: FFLocalizations.of(context) + .getVariableText(ptText: "Bloquear", enText: "Block"), options: FFButtonOptions( width: 130, height: 40, @@ -335,7 +355,8 @@ class _LiberationHistoryWidgetState extends State { return null; } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Solicitações", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Solicitações", e, s); setState(() { _hasData = false; _loading = false; @@ -348,7 +369,8 @@ class _LiberationHistoryWidgetState extends State { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/message_history_page/message_history_page_model.dart index 81ec3075..68efb77d 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -5,7 +5,8 @@ import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/flutter_flow/request_manager.dart'; import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; -class MessageHistoryPageModel extends FlutterFlowModel { +class MessageHistoryPageModel + extends FlutterFlowModel { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -16,7 +17,8 @@ class MessageHistoryPageModel extends FlutterFlowModel String? Function(BuildContext, String?)? textControllerValidator; TabController? tabBarController; - int get tabBarCurrentIndex => tabBarController != null ? tabBarController!.index : 0; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; final _getLiberationsManager = StreamRequestManager(); Stream getLiberations({ @@ -30,7 +32,8 @@ class MessageHistoryPageModel extends FlutterFlowModel requestFn: requestFn, ); void clearGetLiberationsCache() => _getLiberationsManager.clear(); - void clearGetLiberationsCacheKey(String? uniqueKey) => _getLiberationsManager.clearRequest(uniqueKey); + void clearGetLiberationsCacheKey(String? uniqueKey) => + _getLiberationsManager.clearRequest(uniqueKey); @override void initState(BuildContext context) { @@ -39,8 +42,10 @@ class MessageHistoryPageModel extends FlutterFlowModel Future init() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 74682ac9..98f1effd 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -14,10 +14,12 @@ class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @override - State createState() => _MessageHistoryPageWidgetState(); + State createState() => + _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { +class _MessageHistoryPageWidgetState extends State + with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -43,25 +45,27 @@ class _MessageHistoryPageWidgetState extends State wit _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); - _model.tabBarController = TabController(vsync: this, length: 3, initialIndex: 0) - ..addListener(() { - if (_model.tabBarController?.index == 0) { - _destinyType = "P"; - } else if (_model.tabBarController?.index == 1) { - _destinyType = "A"; - } else { - _destinyType = "T"; - } + _model.tabBarController = + TabController(vsync: this, length: 3, initialIndex: 0) + ..addListener(() { + if (_model.tabBarController?.index == 0) { + _destinyType = "P"; + } else if (_model.tabBarController?.index == 1) { + _destinyType = "A"; + } else { + _destinyType = "T"; + } - _pageNumber = 1; - _messageWrap = []; - _messageFuture = fetchMessage(); - }); + _pageNumber = 1; + _messageWrap = []; + _messageFuture = fetchMessage(); + }); _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); @@ -120,7 +124,8 @@ class _MessageHistoryPageWidgetState extends State wit return null; } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Mensagems", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Mensagems", e, s); setState(() { _hasData = false; _loading = false; @@ -175,7 +180,8 @@ class _MessageHistoryPageWidgetState extends State wit Widget _body(BuildContext context) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedSubHeaderFontSize = + LimitedFontSizeUtil.getSubHeaderFontSize(context); return SafeArea( top: true, child: Column( @@ -191,7 +197,8 @@ class _MessageHistoryPageWidgetState extends State wit fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, fontSize: limitedBodyFontSize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), ), unselectedLabelStyle: const TextStyle(), indicatorColor: FlutterFlowTheme.of(context).primary, @@ -226,7 +233,10 @@ class _MessageHistoryPageWidgetState extends State wit mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhuma mensagem encontrada!", enText: "No message found"), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma mensagem encontrada!", + enText: "No message found"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedSubHeaderFontSize, @@ -272,7 +282,8 @@ class _MessageHistoryPageWidgetState extends State wit ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -286,7 +297,8 @@ class _MessageHistoryPageWidgetState extends State wit Widget _item(BuildContext context, dynamic jsonBody) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); - double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedSubHeaderFontSize = + LimitedFontSizeUtil.getSubHeaderFontSize(context); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Card( @@ -337,7 +349,8 @@ class _MessageHistoryPageWidgetState extends State wit padding: const EdgeInsets.only(left: 5), child: Icon( Icons.history, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, size: 15, ), ), @@ -347,7 +360,8 @@ class _MessageHistoryPageWidgetState extends State wit style: TextStyle( fontWeight: FontWeight.bold, fontSize: limitedBodyFontSize, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, ), overflow: TextOverflow.ellipsis, ), @@ -362,7 +376,8 @@ class _MessageHistoryPageWidgetState extends State wit padding: const EdgeInsets.only(left: 5), child: Icon( Icons.message, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, size: 15, ), ), @@ -371,7 +386,8 @@ class _MessageHistoryPageWidgetState extends State wit jsonBody['MSG_TEXTO'].toString(), style: TextStyle( fontSize: limitedBodyFontSize, - color: FlutterFlowTheme.of(context).customColor6, + color: + FlutterFlowTheme.of(context).customColor6, ), ), ), diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 0ac4b95d..8bbbd340 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -56,7 +56,8 @@ class _PackageOrderPage extends State { _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMoreOrders(); } }); @@ -64,7 +65,8 @@ class _PackageOrderPage extends State { } Future initDatabase() async { - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''); + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''); } @override @@ -79,7 +81,8 @@ class _PackageOrderPage extends State { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -96,7 +99,10 @@ class _PackageOrderPage extends State { setState(() => _loading = true); var response = await PhpGroup.buscaEnconcomendas.call( - pageSize: _pageSize.toString(), page: _pageNumber.toString(), adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType, status: _status == '.*' ? 'all' : _status); + pageSize: _pageSize.toString(), + page: _pageNumber.toString(), + adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType, + status: _status == '.*' ? 'all' : _status); final List orders = response.jsonBody['value']['list'] ?? []; @@ -160,25 +166,30 @@ class _PackageOrderPage extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.of(context).pop(), - child: Container( - color: Colors.transparent, - child: GestureDetector( - onTap: () {}, - child: OrderFilterModalWidget( - defaultAdresseeType: _selectedTypeSubject.value['adresseeType'] ?? '.*', - defaultStatus: _selectedTypeSubject.value['status'] ?? '.*', + final Map? selectedFilter = + await showModalBottomSheet>( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + color: Colors.transparent, + child: GestureDetector( + onTap: () {}, + child: OrderFilterModalWidget( + defaultAdresseeType: _selectedTypeSubject + .value['adresseeType'] ?? + '.*', + defaultStatus: + _selectedTypeSubject.value['status'] ?? + '.*', + ), + ), ), - ), - ), - ); - }); + ); + }); if (selectedFilter != null) { _updateFilterAction(selectedFilter); @@ -221,7 +232,9 @@ class _PackageOrderPage extends State { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(enText: 'Orders', ptText: 'Encomendas'), + title: Text( + FFLocalizations.of(context) + .getVariableText(enText: 'Orders', ptText: 'Encomendas'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -252,7 +265,9 @@ class _PackageOrderPage extends State { children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText(ptText: "Nenhuma encomenda encontrada!", enText: "No orders found!"), + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma encomenda encontrada!", + enText: "No orders found!"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), @@ -302,26 +317,48 @@ class _PackageOrderPage extends State { Map _labelsHashMap(dynamic order) { return Map.from({ - if (order['isPending'] == true) '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(), - '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']), + if (order['isPending'] == true) + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': + order['id'].toString(), + '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': + order['customCategory'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtReceive']), if (order['isPending'] == false) - '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']), + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtPickUp']), }); } Map _labelsHashMapDialog(dynamic order) { return Map.from({ - if (order['isPending'] == true) '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(), - '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'], - if (order['code'] != null) '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:': order['code'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:': order['sendedBy'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:': order['receivedBy'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']), - if (order['isPending'] == false) '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:': order['pickedUpBy'], + if (order['isPending'] == true) + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': + order['id'].toString(), + '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': + order['customCategory'], + if (order['code'] != null) + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:': + order['code'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:': + order['sendedBy'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:': + order['receivedBy'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtReceive']), if (order['isPending'] == false) - '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']), - if (order['message'] != null) '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': order['message'] + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:': + order['pickedUpBy'], + if (order['isPending'] == false) + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtPickUp']), + if (order['message'] != null) + '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': + order['message'] }); } @@ -329,11 +366,15 @@ class _PackageOrderPage extends State { return [ if (order['isPending'] == true) Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, + FFLocalizations.of(context).getVariableText( + ptText: 'Aguardando Retirada', + enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, }) else Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary, + FFLocalizations.of(context).getVariableText( + ptText: 'Retirado', + enText: 'Picked up'): FlutterFlowTheme.of(context).primary, }), if (order['adresseeType'] == 'PRO') Map.from({ @@ -369,11 +410,16 @@ class _PackageOrderPage extends State { statusHashMap: [ if (order['isPending'] == true) Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, + FFLocalizations.of(context).getVariableText( + ptText: 'Aguardando Retirada', + enText: 'Waiting Pick up'): + FlutterFlowTheme.of(context).warning, }) else Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary, + FFLocalizations.of(context).getVariableText( + ptText: 'Retirado', enText: 'Picked up'): + FlutterFlowTheme.of(context).primary, }), ], buttons: const [], diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index de07033f..90228bc3 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -2,7 +2,8 @@ import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart'; -class PeopleOnThePropertyPageModel extends FlutterFlowModel { +class PeopleOnThePropertyPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. final unfocusNode = FocusNode(); diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 1c4b13ec..09a545b1 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -15,7 +15,8 @@ class PeopleOnThePropertyPage extends StatefulWidget { const PeopleOnThePropertyPage({super.key}); @override - State createState() => _PeopleOnThePropertyPageState(); + State createState() => + _PeopleOnThePropertyPageState(); } class _PeopleOnThePropertyPageState extends State { @@ -97,7 +98,12 @@ class _PeopleOnThePropertyPageState extends State { if (snapshot.hasError || snapshot.data?.exception != null) { if (snapshot.error != null && snapshot.stackTrace != null) { - LogUtil.requestAPIFailed('getPessoasLocal.php', "", 'Busca Pessoas no Local', snapshot.error, snapshot.stackTrace!); + LogUtil.requestAPIFailed( + 'getPessoasLocal.php', + "", + 'Busca Pessoas no Local', + snapshot.error, + snapshot.stackTrace!); } return Center( @@ -105,7 +111,9 @@ class _PeopleOnThePropertyPageState extends State { width: double.infinity, height: 100, child: Text( - FFLocalizations.of(context).getVariableText(ptText: "Pessoas não encontradas", enText: "Persons not found"), + FFLocalizations.of(context).getVariableText( + ptText: "Pessoas não encontradas", + enText: "Persons not found"), textAlign: TextAlign.center, ), ), @@ -154,13 +162,17 @@ class _PeopleOnThePropertyPageState extends State { r'''$.USU_NOME''', ).toString(), style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: 14.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), - ].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 40.0)), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 40.0)), ); }, ); diff --git a/lib/pages/pets_on_the_property_page/pets_history_screen.dart b/lib/pages/pets_on_the_property_page/pets_history_screen.dart index d66ff2b8..98ad75cb 100644 --- a/lib/pages/pets_on_the_property_page/pets_history_screen.dart +++ b/lib/pages/pets_on_the_property_page/pets_history_screen.dart @@ -23,7 +23,8 @@ class PetsHistoryScreen extends StatefulWidget { _PetsHistoryScreenState createState() => _PetsHistoryScreenState(); } -class _PetsHistoryScreenState extends State with TickerProviderStateMixin { +class _PetsHistoryScreenState extends State + with TickerProviderStateMixin { late ScrollController _scrollController; int _pageNumber = 1; @@ -38,11 +39,13 @@ class _PetsHistoryScreenState extends State with TickerProvid @override void initState() { super.initState(); - model = widget.model ?? createModel(context, () => PetsPageModel(isInteractive: false)); + model = widget.model ?? + createModel(context, () => PetsPageModel(isInteractive: false)); _petsFuture = _fetch(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -125,7 +128,8 @@ class _PetsHistoryScreenState extends State with TickerProvid return null; } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Pets", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Pets", e, s); setState(() { _hasData = false; _loading = false; @@ -146,7 +150,8 @@ class _PetsHistoryScreenState extends State with TickerProvid ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -160,8 +165,10 @@ class _PetsHistoryScreenState extends State with TickerProvid @override Widget build(BuildContext context) { - late final double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); - late final double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + late final double limitedBodyTextSize = + LimitedFontSizeUtil.getBodyFontSize(context); + late final double limitedHeaderTextSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return Scaffold( appBar: widget.isApp ? _appBar(context) : null, @@ -177,7 +184,10 @@ class _PetsHistoryScreenState extends State with TickerProvid mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum Pet encontrado!", + enText: "No pets found"), style: TextStyle( fontFamily: 'Nunito', fontSize: limitedHeaderTextSize, @@ -203,7 +213,8 @@ class _PetsHistoryScreenState extends State with TickerProvid padding: const EdgeInsets.only(right: 30, top: 10), child: Text( model.petAmountRegister == '0' - ? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited") + ? FFLocalizations.of(context).getVariableText( + ptText: "Ilimitado", enText: "Unlimited") : "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${model.petAmountRegister}", textAlign: TextAlign.right, style: TextStyle( @@ -240,9 +251,12 @@ class _PetsHistoryScreenState extends State with TickerProvid imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=consultaFotoPet&petId=${uItem['id'] ?? ''}', labelsHashMap: { - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': uItem['name'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:': uItem['species'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Raça", enText: "Breed")}:': uItem['breed'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + uItem['name'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:': + uItem['species'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Raça", enText: "Breed")}:': + uItem['breed'] ?? '', }, statusHashMap: [ if (uItem['size'] == "MIN") @@ -282,7 +296,8 @@ class _PetsHistoryScreenState extends State with TickerProvid }, if (uItem['gender'] == "MAC") { - FFLocalizations.of(context).getVariableText(ptText: 'Macho', enText: 'Male'): const Color(0xFF094CB0), + FFLocalizations.of(context).getVariableText( + ptText: 'Macho', enText: 'Male'): const Color(0xFF094CB0), }, if (uItem['gender'] == "FEM") { @@ -293,10 +308,14 @@ class _PetsHistoryScreenState extends State with TickerProvid } ], onTapCardItemAction: () async { - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - final cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; await showDialog( useSafeArea: true, context: context, @@ -318,11 +337,13 @@ class _PetsHistoryScreenState extends State with TickerProvid safeSetState(() { _pageNumber = 1; _petsWrap = []; - _petsFuture = _fetch().then((value) => value!.jsonBody['pets'] ?? []); + _petsFuture = + _fetch().then((value) => value!.jsonBody['pets'] ?? []); }); }).catchError((e, s) async { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Pets", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Pets", e, s); safeSetState(() { _hasData = false; _loading = false; diff --git a/lib/pages/pets_page/pets_page_model.dart b/lib/pages/pets_page/pets_page_model.dart index 0b1f93b0..b59a975a 100644 --- a/lib/pages/pets_page/pets_page_model.dart +++ b/lib/pages/pets_page/pets_page_model.dart @@ -114,8 +114,10 @@ class PetsPageModel extends FlutterFlowModel { enText: 'Select an option', ptText: 'Selecione uma opção', ); - dropDownValueController1 = FormFieldController(dropDownValue1 ??= defaultDropDownText); - dropDownValueController2 = FormFieldController(dropDownValue2 ??= defaultDropDownText); + dropDownValueController1 = + FormFieldController(dropDownValue1 ??= defaultDropDownText); + dropDownValueController2 = + FormFieldController(dropDownValue2 ??= defaultDropDownText); safeSetState?.call(); } @@ -148,9 +150,12 @@ class PetsPageModel extends FlutterFlowModel { WidgetsBinding.instance.addPostFrameCallback((_) async { devUUID = await StorageHelper().get(ProfileStorageKey.devUUID.key) ?? ''; - userUUID = await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; - cliUUID = await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''; - petAmountRegister = await StorageHelper().get(LocalsStorageKey.petAmount.key) ?? ''; + userUUID = + await StorageHelper().get(ProfileStorageKey.userUUID.key) ?? ''; + cliUUID = + await StorageHelper().get(ProfileStorageKey.clientUUID.key) ?? ''; + petAmountRegister = + await StorageHelper().get(LocalsStorageKey.petAmount.key) ?? ''; }); } @@ -159,23 +164,27 @@ class PetsPageModel extends FlutterFlowModel { // updateImage!(); (() async { - Response response = - await get(Uri.parse('https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId')); + Response response = await get(Uri.parse( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId')); String base64 = base64Encode(response.bodyBytes); uploadedTempFile = await ImageUtils.convertToUploadFile(base64); updateImage?.call(); })(); - textControllerName = TextEditingController(text: item != null ? item['name'] ?? '' : ''); + textControllerName = + TextEditingController(text: item != null ? item['name'] ?? '' : ''); textFieldFocusName = FocusNode(); - textControllerSpecies = TextEditingController(text: item != null ? item['species'] ?? '' : ''); + textControllerSpecies = + TextEditingController(text: item != null ? item['species'] ?? '' : ''); textFieldFocusSpecies = FocusNode(); - textControllerRace = TextEditingController(text: item != null ? item['breed'] ?? '' : ''); + textControllerRace = + TextEditingController(text: item != null ? item['breed'] ?? '' : ''); textFieldFocusRace = FocusNode(); - textControllerColor = TextEditingController(text: item != null ? item['color'] ?? '' : ''); + textControllerColor = + TextEditingController(text: item != null ? item['color'] ?? '' : ''); textFieldFocusColor = FocusNode(); textControllerData = TextEditingController( @@ -187,7 +196,8 @@ class PetsPageModel extends FlutterFlowModel { textFieldFocusData = FocusNode(); - textControllerObservation = TextEditingController(text: item != null ? item['notes'] ?? '' : ''); + textControllerObservation = + TextEditingController(text: item != null ? item['notes'] ?? '' : ''); textFieldFocusObservation = FocusNode(); item != null ? dropDownValue1 = item['gender'] ?? '' : dropDownValue1 = ''; @@ -227,28 +237,39 @@ class PetsPageModel extends FlutterFlowModel { if (uploadedLocalFile == null || uploadedLocalFile!.bytes!.isEmpty) { return false; } - if (textControllerName.text.isEmpty || textControllerName.text.length > 80 || textControllerName.text == '') { + if (textControllerName.text.isEmpty || + textControllerName.text.length > 80 || + textControllerName.text == '') { return false; } - if (textControllerSpecies.text.isEmpty || textControllerSpecies.text == '') { + if (textControllerSpecies.text.isEmpty || + textControllerSpecies.text == '') { return false; } if (textControllerRace.text.isEmpty || textControllerRace.text == '') { return false; } - if (dropDownValueController1!.value == defaultDropDownText || dropDownValueController1!.value == '' || dropDownValueController1!.value == null) { + if (dropDownValueController1!.value == defaultDropDownText || + dropDownValueController1!.value == '' || + dropDownValueController1!.value == null) { return false; } - if (dropDownValueController2!.value == defaultDropDownText || dropDownValueController2!.value == '' || dropDownValueController2!.value == null) { + if (dropDownValueController2!.value == defaultDropDownText || + dropDownValueController2!.value == '' || + dropDownValueController2!.value == null) { return false; } - if (dropDownValue1 == 'Selecione uma opção' || dropDownValue1 == null || dropDownValue1 == '') { + if (dropDownValue1 == 'Selecione uma opção' || + dropDownValue1 == null || + dropDownValue1 == '') { return false; } - if (dropDownValue2 == 'Selecione uma opção' || dropDownValue2 == null || dropDownValue2 == '') { + if (dropDownValue2 == 'Selecione uma opção' || + dropDownValue2 == null || + dropDownValue2 == '') { return false; } @@ -258,7 +279,8 @@ class PetsPageModel extends FlutterFlowModel { Future updatePet() async { var img = await ImageUtils.convertImageFileToBase64(uploadedLocalFile!); img = "base64;jpeg,$img"; - final url = 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId'; + final url = + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=$petId'; final response = await PhpGroup.updatePet.call( petID: petId, image: img, @@ -287,7 +309,8 @@ class PetsPageModel extends FlutterFlowModel { } else { String errorMessage; try { - errorMessage = jsonDecode(response.jsonBody['error_msg'])[0]['message'].toString(); + errorMessage = + jsonDecode(response.jsonBody['error_msg'])[0]['message'].toString(); } catch (e) { errorMessage = FFLocalizations.of(buildContext!).getVariableText( enText: 'Failed to update pet', @@ -325,10 +348,12 @@ class PetsPageModel extends FlutterFlowModel { } else { String errorMessage; try { - errorMessage = jsonDecode(response.jsonBody['error_msg'])[0]['message'].toString(); + errorMessage = + jsonDecode(response.jsonBody['error_msg'])[0]['message'].toString(); await DialogUtil.error(buildContext!, errorMessage); } catch (e) { - if (response.jsonBody['error_msg'] == "Limite de Cadastro de Pet Atingido.") { + if (response.jsonBody['error_msg'] == + "Limite de Cadastro de Pet Atingido.") { errorMessage = FFLocalizations.of(buildContext!).getVariableText( enText: 'Pet registration limit reached', ptText: 'Limite de cadastro de pets atingido', @@ -501,31 +526,48 @@ class PetsPageModel extends FlutterFlowModel { : [], labelsHashMap: Map.from({ if (item['species'] != null && item['species'] != '') - '${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:': item['species'].toString().toUpperCase(), + '${FFLocalizations.of(context).getVariableText(ptText: "Espécie", enText: "Species")}:': + item['species'].toString().toUpperCase(), if (item['breed'] != null && item['breed'] != '') - '${FFLocalizations.of(context).getVariableText(ptText: "Raça", enText: "Breed")}:': item['breed'].toString().toUpperCase(), - if (item['color'] != null && item['color'] != '') '${FFLocalizations.of(context).getVariableText(ptText: "Cor", enText: "Color")}:': item['color'].toString().toUpperCase(), + '${FFLocalizations.of(context).getVariableText(ptText: "Raça", enText: "Breed")}:': + item['breed'].toString().toUpperCase(), + if (item['color'] != null && item['color'] != '') + '${FFLocalizations.of(context).getVariableText(ptText: "Cor", enText: "Color")}:': + item['color'].toString().toUpperCase(), if (item['birthdayDate'] != null && item['birthdayDate'] != '') - '${FFLocalizations.of(context).getVariableText(ptText: "Data de Nascimento", enText: "Date of Birth")}:': ValidatorUtil.formatDateTimePicker(item['birthdayDate']), + '${FFLocalizations.of(context).getVariableText(ptText: "Data de Nascimento", enText: "Date of Birth")}:': + ValidatorUtil.formatDateTimePicker(item['birthdayDate']), if (item['gender'] != null && item['gender'] != '') - '${FFLocalizations.of(context).getVariableText(ptText: "Gênero", enText: "Gender")}:': item['gender'] == 'MAC' - ? FFLocalizations.of(context).getVariableText(ptText: 'MACHO', enText: 'MALE') - : FFLocalizations.of(context).getVariableText(enText: 'FEMALE', ptText: 'FÊMEA'), + '${FFLocalizations.of(context).getVariableText(ptText: "Gênero", enText: "Gender")}:': + item['gender'] == 'MAC' + ? FFLocalizations.of(context) + .getVariableText(ptText: 'MACHO', enText: 'MALE') + : FFLocalizations.of(context) + .getVariableText(enText: 'FEMALE', ptText: 'FÊMEA'), if (item['size'] != null && item['size'] != '') - '${FFLocalizations.of(context).getVariableText(ptText: "Porte", enText: "Size")}:': item['size'] == 'MIN' - ? FFLocalizations.of(context).getVariableText(ptText: 'MINI', enText: 'MINI') - : item['size'] == 'PEQ' - ? FFLocalizations.of(context).getVariableText(ptText: 'PEQUENO', enText: 'SMALL') - : item['size'] == 'MED' - ? FFLocalizations.of(context).getVariableText(ptText: 'MÉDIO', enText: 'MEDIUM') - : item['size'] == 'GRD' - ? FFLocalizations.of(context).getVariableText(ptText: 'GRANDE', enText: 'LARGE') - : item['size'] == 'GIG' - ? FFLocalizations.of(context).getVariableText(ptText: 'GIGANTE', enText: 'GIANT') - : '', - if (item['notes'] != null && item['notes'] != '') '${FFLocalizations.of(context).getVariableText(ptText: "Observação", enText: "Notes")}:': item['notes'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Porte", enText: "Size")}:': + item['size'] == 'MIN' + ? FFLocalizations.of(context) + .getVariableText(ptText: 'MINI', enText: 'MINI') + : item['size'] == 'PEQ' + ? FFLocalizations.of(context) + .getVariableText(ptText: 'PEQUENO', enText: 'SMALL') + : item['size'] == 'MED' + ? FFLocalizations.of(context).getVariableText( + ptText: 'MÉDIO', enText: 'MEDIUM') + : item['size'] == 'GRD' + ? FFLocalizations.of(context).getVariableText( + ptText: 'GRANDE', enText: 'LARGE') + : item['size'] == 'GIG' + ? FFLocalizations.of(context).getVariableText( + ptText: 'GIGANTE', enText: 'GIANT') + : '', + if (item['notes'] != null && item['notes'] != '') + '${FFLocalizations.of(context).getVariableText(ptText: "Observação", enText: "Notes")}:': + item['notes'] ?? '', }), - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=${item['id'] ?? ''}', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=consultaFotoPet&petId=${item['id'] ?? ''}', statusHashMap: [ if (item['gender'] == "MAC") Map.from({ diff --git a/lib/pages/pets_page/pets_page_widget.dart b/lib/pages/pets_page/pets_page_widget.dart index a2d7c1f7..b1214838 100644 --- a/lib/pages/pets_page/pets_page_widget.dart +++ b/lib/pages/pets_page/pets_page_widget.dart @@ -28,7 +28,8 @@ class PetsPageWidget extends StatefulWidget { State createState() => _PetsPageWidgetState(); } -class _PetsPageWidgetState extends State with SingleTickerProviderStateMixin { +class _PetsPageWidgetState extends State + with SingleTickerProviderStateMixin { late PetsPageModel _model; @override @@ -78,7 +79,7 @@ class _PetsPageWidgetState extends State with SingleTickerProvid title: FFLocalizations.of(context).getVariableText( ptText: 'Cadastrar Pets', enText: 'Pets Register', - ), + ), onBackButtonPressed: () => context.pop(), ); } @@ -94,11 +95,16 @@ class _PetsPageWidgetState extends State with SingleTickerProvid context: context, model: _model, labelTab1: _model.isEditing - ? FFLocalizations.of(context).getVariableText(ptText: 'Editar', enText: 'Edit') - : FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register'), - labelTab2: FFLocalizations.of(context).getVariableText(ptText: 'Consultar', enText: 'History'), + ? FFLocalizations.of(context) + .getVariableText(ptText: 'Editar', enText: 'Edit') + : FFLocalizations.of(context) + .getVariableText(ptText: 'Cadastrar', enText: 'Register'), + labelTab2: FFLocalizations.of(context) + .getVariableText(ptText: 'Consultar', enText: 'History'), controller: _model.tabBarController, - widget1: _model.isEditing ? _buildEditForm(context) : _buildRegisterForm(context), + widget1: _model.isEditing + ? _buildEditForm(context) + : _buildRegisterForm(context), widget2: PetsHistoryScreen(model: _model, isApp: false), onEditingChanged: onEditingChanged, ); @@ -106,8 +112,10 @@ class _PetsPageWidgetState extends State with SingleTickerProvid Widget _buildRegisterForm(BuildContext context) { double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); - double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedHeaderFontSize = + LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedSubHeaderFontSize = + LimitedFontSizeUtil.getSubHeaderFontSize(context); return SingleChildScrollView( child: Column( @@ -126,7 +134,8 @@ class _PetsPageWidgetState extends State with SingleTickerProvid style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), fontSize: limitedHeaderFontSize, ), ), @@ -135,326 +144,437 @@ class _PetsPageWidgetState extends State with SingleTickerProvid Form( key: _model.registerFormKey, autovalidateMode: AutovalidateMode.onUserInteraction, - child: - Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), - child: MediaUploadButtonUtil( - onUploadComplete: _model.handleUploadComplete, - isUploading: _model.isDataUploading, - uploadedFiles: _model.uploadedLocalFile, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Clique para adicionar a foto de seu Pet', enText: 'Click to add your Pet\'s photo'), - ), - ), - CustomInputUtil( - controller: _model.textControllerName, - validator: _model.textControllerNameValidator.asValidator(context), - focusNode: _model.textFieldFocusName, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), - hintText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), - suffixIcon: Symbols.format_color_text, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerSpecies, - validator: _model.textControllerSpeciesValidator.asValidator(context), - focusNode: _model.textFieldFocusSpecies, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Espécie', enText: 'Species'), - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Ex: Cachorro, Gato, Papagaio', enText: 'e.g. Dog, Cat, Parrot'), - suffixIcon: Symbols.sound_detection_dog_barking, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerRace, - validator: _model.textControllerRaceValidator.asValidator(context), - focusNode: _model.textFieldFocusRace, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Raça', enText: 'Race'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Labrador, Poodle, Siamês, Persa', enText: 'e.g. Labrador, Poodle, Siamese, Persian'), - suffixIcon: Icons.pets_outlined, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - CustomInputUtil( - controller: _model.textControllerColor, - validator: _model.textControllerColorValidator.asValidator(context), - focusNode: _model.textFieldFocusColor, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cor', enText: 'Color'), - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Ex: Preto, Amarelo, Branco', enText: 'e.g. Black, Yellow, White'), - suffixIcon: Symbols.palette, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 60.0, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textControllerData, - focusNode: _model.textFieldFocusData, - cursorColor: FlutterFlowTheme.of(context).primary, - readOnly: true, - autovalidateMode: AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedInputFontSize, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), + child: MediaUploadButtonUtil( + onUploadComplete: _model.handleUploadComplete, + isUploading: _model.isDataUploading, + uploadedFiles: _model.uploadedLocalFile, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Clique para adicionar a foto de seu Pet', + enText: 'Click to add your Pet\'s photo'), + ), + ), + CustomInputUtil( + controller: _model.textControllerName, + validator: _model.textControllerNameValidator + .asValidator(context), + focusNode: _model.textFieldFocusName, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Nome', enText: 'Name'), + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Nome', enText: 'Name'), + suffixIcon: Symbols.format_color_text, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerSpecies, + validator: _model.textControllerSpeciesValidator + .asValidator(context), + focusNode: _model.textFieldFocusSpecies, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Espécie', enText: 'Species'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Cachorro, Gato, Papagaio', + enText: 'e.g. Dog, Cat, Parrot'), + suffixIcon: Symbols.sound_detection_dog_barking, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerRace, + validator: _model.textControllerRaceValidator + .asValidator(context), + focusNode: _model.textFieldFocusRace, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Raça', enText: 'Race'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Labrador, Poodle, Siamês, Persa', + enText: 'e.g. Labrador, Poodle, Siamese, Persian'), + suffixIcon: Icons.pets_outlined, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + CustomInputUtil( + controller: _model.textControllerColor, + validator: _model.textControllerColorValidator + .asValidator(context), + focusNode: _model.textFieldFocusColor, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Cor', enText: 'Color'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Preto, Amarelo, Branco', + enText: 'e.g. Black, Yellow, White'), + suffixIcon: Symbols.palette, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textControllerData, + focusNode: _model.textFieldFocusData, + cursorColor: + FlutterFlowTheme.of(context).primary, + readOnly: true, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + fontSize: limitedInputFontSize, + ), + hintText: FFLocalizations.of(context) + .getVariableText( + ptText: 'Data de Nascimento', + enText: 'Date of Birth', ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Data de Nascimento', - enText: 'Date of Birth', - ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), - lineHeight: 1.0, - fontSize: limitedInputFontSize, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + fontSize: limitedInputFontSize, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .customColor6, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context) + .accent1, ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedInputFontSize, + ), + textAlign: TextAlign.start, + validator: _model + .textControllerDataValidator + .asValidator(context), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - lineHeight: 1.8, - fontSize: limitedInputFontSize, - ), - textAlign: TextAlign.start, - validator: _model.textControllerDataValidator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final pickedDate = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: DateTime(1990), - lastDate: DateTime.now(), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: FlutterFlowTheme.of(context).primary, - headerForegroundColor: FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override( - fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: limitedInputFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground, - pickerForegroundColor: FlutterFlowTheme.of(context).primaryText, - selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, - iconSize: 24.0, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final pickedDate = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: DateTime(1990), + lastDate: DateTime.now(), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context) + .info, + headerTextStyle: + FlutterFlowTheme.of(context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme + .of(context) + .headlineLargeFamily, + fontSize: + limitedInputFontSize, + letterSpacing: 0.0, + fontWeight: + FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, ); + + if (pickedDate != null) { + setState(() { + _model.selectedDate = DateTime( + pickedDate.year, + pickedDate.month, + pickedDate.day, + ); + + _model.textControllerData = + TextEditingController( + text: dateTimeFormat( + 'dd/MM/yyyy', + _model.selectedDate, + locale: FFLocalizations.of(context) + .languageCode, + )); + _model.textControllerData?.selection = + TextSelection.collapsed( + offset: _model.textControllerData! + .text.length, + ); + }); + } }, - ); - - if (pickedDate != null) { - setState(() { - _model.selectedDate = DateTime( - pickedDate.year, - pickedDate.month, - pickedDate.day, - ); - - _model.textControllerData = TextEditingController( - text: dateTimeFormat( - 'dd/MM/yyyy', - _model.selectedDate, - locale: FFLocalizations.of(context).languageCode, - )); - _model.textControllerData?.selection = TextSelection.collapsed( - offset: _model.textControllerData!.text.length, - ); - }); - } - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(10.0), + ), + ), ), ), - ), + ], ), - ], + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Selecione as opções disponíveis', + enText: 'Select the available options', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, + ), ), ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Selecione as opções disponíveis', - enText: 'Select the available options', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedSubHeaderFontSize, - ), ), - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MAC', 'FEM'], - controller: _model.dropDownValueController1 ??= - FormFieldController(_model.dropDownValue1 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue1 = val; - }), - dropDownValue: _model.dropDownValue1, - optionsLabel: [ - FFLocalizations.of(context).getVariableText(ptText: 'Macho', enText: 'Male'), - FFLocalizations.of(context).getVariableText(ptText: 'Fêmea', enText: 'Female') - ], - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Gênero do Pet', enText: 'Gender of the Pet')), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], - controller: _model.dropDownValueController2 ??= - FormFieldController(_model.dropDownValue2 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue2 = val; - }), - dropDownValue: _model.dropDownValue2, - optionsLabel: [ - FFLocalizations.of(context).getVariableText(ptText: 'Mini', enText: 'Mini'), - FFLocalizations.of(context).getVariableText(ptText: 'Pequeno', enText: 'Small'), - FFLocalizations.of(context).getVariableText(ptText: 'Médio', enText: 'Medium'), - FFLocalizations.of(context).getVariableText(ptText: 'Grande', enText: 'Big'), - FFLocalizations.of(context).getVariableText(ptText: 'Gigante', enText: 'Giant'), - ], - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Porte do Pet', enText: 'Size of the Pet')), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Você tem alguma observação sobre o seu Pet?', - enText: 'Do you have any observations about your Pet?', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedInputFontSize, - ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MAC', 'FEM'], + controller: _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue1 = val; + }), + dropDownValue: _model.dropDownValue1, + optionsLabel: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Macho', enText: 'Male'), + FFLocalizations.of(context).getVariableText( + ptText: 'Fêmea', enText: 'Female') + ], + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Gênero do Pet', + enText: 'Gender of the Pet')), ), - ), - ), - CustomInputUtil( - controller: _model.textControllerObservation, - validator: _model.textControllerObservationValidator.asValidator(context), - focusNode: _model.textFieldFocusObservation, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), - suffixIcon: Icons.text_fields, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 250, - ), - Padding( - padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), - child: SubmitButtonUtil( - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cadastrar', enText: 'Register'), - onPressed: _model.isFormValid(context) ? _model.registerPet : null), - ), - ])), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], + controller: _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue2 = val; + }), + dropDownValue: _model.dropDownValue2, + optionsLabel: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Mini', enText: 'Mini'), + FFLocalizations.of(context).getVariableText( + ptText: 'Pequeno', enText: 'Small'), + FFLocalizations.of(context).getVariableText( + ptText: 'Médio', enText: 'Medium'), + FFLocalizations.of(context).getVariableText( + ptText: 'Grande', enText: 'Big'), + FFLocalizations.of(context).getVariableText( + ptText: 'Gigante', enText: 'Giant'), + ], + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Porte do Pet', + enText: 'Size of the Pet')), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem alguma observação sobre o seu Pet?', + enText: + 'Do you have any observations about your Pet?', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + fontSize: limitedInputFontSize, + ), + ), + ), + ), + CustomInputUtil( + controller: _model.textControllerObservation, + validator: _model.textControllerObservationValidator + .asValidator(context), + focusNode: _model.textFieldFocusObservation, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Escreva as suas observações aqui...', + enText: 'Write your observations here...'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Escreva as suas observações aqui...', + enText: 'Write your observations here...'), + suffixIcon: Icons.text_fields, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 250, + ), + Padding( + padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), + child: SubmitButtonUtil( + labelText: FFLocalizations.of(context) + .getVariableText( + ptText: 'Cadastrar', enText: 'Register'), + onPressed: _model.isFormValid(context) + ? _model.registerPet + : null), + ), + ])), ], ), ); @@ -478,7 +598,8 @@ class _PetsPageWidgetState extends State with SingleTickerProvid style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -486,331 +607,442 @@ class _PetsPageWidgetState extends State with SingleTickerProvid Form( key: _model.updateFormKey, autovalidateMode: AutovalidateMode.onUserInteraction, - child: - Column(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Padding( - padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), - child: MediaUploadButtonUtil( - onUploadComplete: _model.handleUploadComplete, - isUploading: _model.isDataUploading, - uploadedFiles: _model.uploadedLocalFile, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Clique para adicionar a foto de seu Pet', enText: 'Click to add your Pet\'s photo'), - ), - ), - CustomInputUtil( - controller: _model.textControllerName, - validator: _model.textControllerNameValidator.asValidator(context), - focusNode: _model.textFieldFocusName, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), - hintText: FFLocalizations.of(context).getVariableText(ptText: 'Nome', enText: 'Name'), - suffixIcon: Symbols.format_color_text, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomInputUtil( - controller: _model.textControllerSpecies, - validator: _model.textControllerSpeciesValidator.asValidator(context), - focusNode: _model.textFieldFocusSpecies, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Espécie', enText: 'Species'), - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Ex: Cachorro, Gato, Papagaio', enText: 'e.g. Dog, Cat, Parrot'), - suffixIcon: Symbols.sound_detection_dog_barking, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomInputUtil( - controller: _model.textControllerRace, - validator: _model.textControllerRaceValidator.asValidator(context), - focusNode: _model.textFieldFocusRace, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Raça', enText: 'Race'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Labrador, Poodle, Siamês, Persa', - enText: 'e.g. Labrador, Poodle, Siamese, Persian'), - suffixIcon: Icons.pets_outlined, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomInputUtil( - controller: _model.textControllerColor, - validator: _model.textControllerColorValidator.asValidator(context), - focusNode: _model.textFieldFocusColor, - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Cor', enText: 'Color'), - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Ex: Preto, Amarelo, Branco', enText: 'e.g. Black, Yellow, White'), - suffixIcon: Symbols.palette, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 60.0, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textControllerData, - focusNode: _model.textFieldFocusData, - cursorColor: FlutterFlowTheme.of(context).primary, - readOnly: true, - autovalidateMode: AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 0, 20), + child: MediaUploadButtonUtil( + onUploadComplete: _model.handleUploadComplete, + isUploading: _model.isDataUploading, + uploadedFiles: _model.uploadedLocalFile, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Clique para adicionar a foto de seu Pet', + enText: 'Click to add your Pet\'s photo'), + ), + ), + CustomInputUtil( + controller: _model.textControllerName, + validator: _model.textControllerNameValidator + .asValidator(context), + focusNode: _model.textFieldFocusName, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Nome', enText: 'Name'), + hintText: FFLocalizations.of(context) + .getVariableText(ptText: 'Nome', enText: 'Name'), + suffixIcon: Symbols.format_color_text, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomInputUtil( + controller: _model.textControllerSpecies, + validator: _model.textControllerSpeciesValidator + .asValidator(context), + focusNode: _model.textFieldFocusSpecies, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Espécie', enText: 'Species'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Cachorro, Gato, Papagaio', + enText: 'e.g. Dog, Cat, Parrot'), + suffixIcon: Symbols.sound_detection_dog_barking, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomInputUtil( + controller: _model.textControllerRace, + validator: _model.textControllerRaceValidator + .asValidator(context), + focusNode: _model.textFieldFocusRace, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Raça', enText: 'Race'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Labrador, Poodle, Siamês, Persa', + enText: 'e.g. Labrador, Poodle, Siamese, Persian'), + suffixIcon: Icons.pets_outlined, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomInputUtil( + controller: _model.textControllerColor, + validator: _model.textControllerColorValidator + .asValidator(context), + focusNode: _model.textFieldFocusColor, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Cor', enText: 'Color'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Preto, Amarelo, Branco', + enText: 'e.g. Black, Yellow, White'), + suffixIcon: Symbols.palette, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: 60.0, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model.textControllerData, + focusNode: _model.textFieldFocusData, + cursorColor: + FlutterFlowTheme.of(context).primary, + readOnly: true, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context) + .getVariableText( + ptText: 'Data de Nascimento', + enText: 'Date of Birth', ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Data de Nascimento', - enText: 'Date of Birth', - ), - hintStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).labelMediumFamily), - lineHeight: 1.0, + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .customColor6, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context) + .accent1, ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).customColor6, - width: 0.5, ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + ), + textAlign: TextAlign.start, + validator: _model + .textControllerDataValidator + .asValidator(context), ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - lineHeight: 1.8, - ), - textAlign: TextAlign.start, - validator: _model.textControllerDataValidator.asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final pickedDate = await showDatePicker( - context: context, - initialDate: DateFormat('dd/MM/yyyy').tryParse(_model.textControllerData.text), - firstDate: DateTime(1990), - lastDate: DateTime.now(), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: FlutterFlowTheme.of(context).primary, - headerForegroundColor: FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of(context).headlineLarge.override( - fontFamily: FlutterFlowTheme.of(context).headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context).headlineLargeFamily), - ), - pickerBackgroundColor: FlutterFlowTheme.of(context).primaryBackground, - pickerForegroundColor: FlutterFlowTheme.of(context).primaryText, - selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, - iconSize: 24.0, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final pickedDate = await showDatePicker( + context: context, + initialDate: DateFormat('dd/MM/yyyy') + .tryParse( + _model.textControllerData.text), + firstDate: DateTime(1990), + lastDate: DateTime.now(), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context) + .info, + headerTextStyle: + FlutterFlowTheme.of(context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme + .of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, ); + + if (pickedDate != null) { + setState(() { + _model.selectedDate = DateTime( + pickedDate.year, + pickedDate.month, + pickedDate.day, + ); + + _model.textControllerData = + TextEditingController( + text: dateTimeFormat( + 'dd/MM/yyyy', + _model.selectedDate, + locale: FFLocalizations.of(context) + .languageCode, + )); + _model.textControllerData?.selection = + TextSelection.collapsed( + offset: _model.textControllerData! + .text.length, + ); + }); + } }, - ); - - if (pickedDate != null) { - setState(() { - _model.selectedDate = DateTime( - pickedDate.year, - pickedDate.month, - pickedDate.day, - ); - - _model.textControllerData = TextEditingController( - text: dateTimeFormat( - 'dd/MM/yyyy', - _model.selectedDate, - locale: FFLocalizations.of(context).languageCode, - )); - _model.textControllerData?.selection = TextSelection.collapsed( - offset: _model.textControllerData!.text.length, - ); - }); - } - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(10.0), + ), + ), ), ), - ), + ], ), - ], + ), + ], + ), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Selecione as opções disponíveis', + enText: 'Select the available options', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), - ], - ), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Selecione as opções disponíveis', - enText: 'Select the available options', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), ), - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MAC', 'FEM'], - controller: _model.dropDownValueController1 ??= - FormFieldController(_model.dropDownValue1 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue1 = val; - }), - dropDownValue: _model.dropDownValue1, - optionsLabel: [ - FFLocalizations.of(context).getVariableText(ptText: 'Macho', enText: 'Male'), - FFLocalizations.of(context).getVariableText(ptText: 'Fêmea', enText: 'Female') - ], + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MAC', 'FEM'], + controller: _model.dropDownValueController1 ??= + FormFieldController( + _model.dropDownValue1 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue1 = val; + }), + dropDownValue: _model.dropDownValue1, + optionsLabel: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Macho', enText: 'Male'), + FFLocalizations.of(context).getVariableText( + ptText: 'Fêmea', enText: 'Female') + ], + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Selecione o gênero do Pet', + enText: 'Select the gender of the Pet')), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), + child: CustomSelect( + options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], + controller: _model.dropDownValueController2 ??= + FormFieldController( + _model.dropDownValue2 ??= ''), + isRequired: true, + changed: (val) => safeSetState(() { + _model.dropDownValue2 = val; + }), + dropDownValue: _model.dropDownValue1, + optionsLabel: [ + FFLocalizations.of(context).getVariableText( + ptText: 'Mini', enText: 'Mini'), + FFLocalizations.of(context).getVariableText( + ptText: 'Pequeno', enText: 'Small'), + FFLocalizations.of(context).getVariableText( + ptText: 'Médio', enText: 'Medium'), + FFLocalizations.of(context).getVariableText( + ptText: 'Grande', enText: 'Big'), + FFLocalizations.of(context).getVariableText( + ptText: 'Gigante', enText: 'Giant'), + ], + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Selecione o porte do Pet', + enText: 'Select the size of the Pet')), + ), + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0, 0.0, 15), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: + 'Você tem alguma observação sobre o seu Pet?', + enText: + 'Do you have any observations about your Pet?', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodySmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodySmallFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + CustomInputUtil( + controller: _model.textControllerObservation, + validator: _model.textControllerObservationValidator + .asValidator(context), + focusNode: _model.textFieldFocusObservation, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Escreva as suas observações aqui...', + enText: 'Write your observations here...'), hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Selecione o gênero do Pet', enText: 'Select the gender of the Pet')), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomSelect( - options: const ['MIN', 'PEQ', 'MED', 'GRA', 'GIG'], - controller: _model.dropDownValueController2 ??= - FormFieldController(_model.dropDownValue2 ??= ''), - isRequired: true, - changed: (val) => safeSetState(() { - _model.dropDownValue2 = val; - }), - dropDownValue: _model.dropDownValue1, - optionsLabel: [ - FFLocalizations.of(context).getVariableText(ptText: 'Mini', enText: 'Mini'), - FFLocalizations.of(context).getVariableText(ptText: 'Pequeno', enText: 'Small'), - FFLocalizations.of(context).getVariableText(ptText: 'Médio', enText: 'Medium'), - FFLocalizations.of(context).getVariableText(ptText: 'Grande', enText: 'Big'), - FFLocalizations.of(context).getVariableText(ptText: 'Gigante', enText: 'Giant'), - ], - hintText: FFLocalizations.of(context) - .getVariableText(ptText: 'Selecione o porte do Pet', enText: 'Select the size of the Pet')), - ), - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0, 0.0, 15), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Você tem alguma observação sobre o seu Pet?', - enText: 'Do you have any observations about your Pet?', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodySmall.override( - fontFamily: FlutterFlowTheme.of(context).bodySmallFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - ), + ptText: 'Escreva as suas observações aqui...', + enText: 'Write your observations here...'), + suffixIcon: Icons.text_fields, + haveMaxLength: true, + maxLength: 250, + onChanged: (value) => setState(() {}), ), - ), - ), - CustomInputUtil( - controller: _model.textControllerObservation, - validator: _model.textControllerObservationValidator.asValidator(context), - focusNode: _model.textFieldFocusObservation, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Escreva as suas observações aqui...', enText: 'Write your observations here...'), - suffixIcon: Icons.text_fields, - haveMaxLength: true, - maxLength: 250, - onChanged: (value) => setState(() {}), - ), - Padding( - padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), - child: SubmitButtonUtil( - labelText: FFLocalizations.of(context).getVariableText(ptText: 'Salvar', enText: 'Save'), - onPressed: _model.isFormValid(context) ? _model.updatePet : null), - ), - ])), + Padding( + padding: const EdgeInsets.fromLTRB(70, 20, 70, 30), + child: SubmitButtonUtil( + labelText: FFLocalizations.of(context) + .getVariableText( + ptText: 'Salvar', enText: 'Save'), + onPressed: _model.isFormValid(context) + ? _model.updatePet + : null), + ), + ])), ], ), ); diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index dec63120..c99d439f 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -24,7 +24,8 @@ class PreferencesPageModel with ChangeNotifier { late bool isPanic = false; Future _initialize() async { - isFingerprint = await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; + isFingerprint = + await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; isPerson = await StorageHelper().get(LocalsStorageKey.person.key) == 'true'; isNotify = await StorageHelper().get(LocalsStorageKey.notify.key) == 'true'; isAccess = await StorageHelper().get(LocalsStorageKey.access.key) == 'true'; @@ -37,7 +38,8 @@ class PreferencesPageModel with ChangeNotifier { } Future enablePerson(BuildContext context) async { - final String userDevUUID = (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; + final String userDevUUID = + (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; notifyListeners(); Share.share( FFLocalizations.of(context).getVariableText( @@ -64,7 +66,8 @@ class PreferencesPageModel with ChangeNotifier { .call(notifica: value) .then((value) async { if (value.jsonBody['error'] == false) { - await StorageHelper().set(LocalsStorageKey.notify.key, isNotify ? 'false' : 'true'); + await StorageHelper().set( + LocalsStorageKey.notify.key, isNotify ? 'false' : 'true'); content = FFLocalizations.of(context).getVariableText( enText: 'Notification changed successfully', ptText: 'Notificação alterada com sucesso', @@ -86,7 +89,8 @@ class PreferencesPageModel with ChangeNotifier { ); SnackBarUtil.showSnackBar(context, content, isError: true); }) - .then((_) async => isNotify = await StorageHelper().get(LocalsStorageKey.notify.key) == 'true') + .then((_) async => isNotify = + await StorageHelper().get(LocalsStorageKey.notify.key) == 'true') .whenComplete(() => notifyListeners()); context.pop(); } @@ -110,7 +114,8 @@ class PreferencesPageModel with ChangeNotifier { if (value.jsonBody['error'] == false) { notifyListeners(); content = FFLocalizations.of(context).getVariableText( - ptText: 'Atualização do identificador de acesso realizada com sucesso', + ptText: + 'Atualização do identificador de acesso realizada com sucesso', enText: 'Access identifier updated successfully', ); SnackBarUtil.showSnackBar(context, content); @@ -142,7 +147,8 @@ class PreferencesPageModel with ChangeNotifier { .then((value) async { final String content; if (jsonDecode(value.jsonBody['error'].toString()) == false) { - await StorageHelper().set(LocalsStorageKey.access.key, isAccess ? 'false' : 'true'); + await StorageHelper().set( + LocalsStorageKey.access.key, isAccess ? 'false' : 'true'); notifyListeners(); content = FFLocalizations.of(context).getVariableText( enText: 'Access pass changed successfully', @@ -164,7 +170,8 @@ class PreferencesPageModel with ChangeNotifier { ); SnackBarUtil.showSnackBar(context, content, isError: true); }) - .then((_) async => isAccess = await StorageHelper().get(LocalsStorageKey.access.key) == 'true') + .then((_) async => isAccess = + await StorageHelper().get(LocalsStorageKey.access.key) == 'true') .whenComplete(() => notifyListeners()); } @@ -179,7 +186,8 @@ class PreferencesPageModel with ChangeNotifier { .then((value) async { final String content; if (jsonDecode(value.jsonBody['error'].toString()) == false) { - await StorageHelper().set(LocalsStorageKey.panic.key, isPanic ? 'false' : 'true'); + await StorageHelper() + .set(LocalsStorageKey.panic.key, isPanic ? 'false' : 'true'); notifyListeners(); content = FFLocalizations.of(context).getVariableText( enText: 'Panic password changed successfully', @@ -201,7 +209,8 @@ class PreferencesPageModel with ChangeNotifier { ); SnackBarUtil.showSnackBar(context, content, isError: true); }) - .then((_) async => isPanic = await StorageHelper().get(LocalsStorageKey.panic.key) == 'true') + .then((_) async => isPanic = + await StorageHelper().get(LocalsStorageKey.panic.key) == 'true') .whenComplete(() => notifyListeners()); } @@ -216,11 +225,14 @@ class PreferencesPageModel with ChangeNotifier { onChange(String? key) async { isFingerprint = !isFingerprint; - await StorageHelper().set(SecureStorageKey.fingerprintPass.value, key ?? ''); - await StorageHelper().set(LocalsStorageKey.fingerprint.key, isFingerprint ? 'true' : 'false'); + await StorageHelper() + .set(SecureStorageKey.fingerprintPass.value, key ?? ''); + await StorageHelper().set( + LocalsStorageKey.fingerprint.key, isFingerprint ? 'true' : 'false'); notifyListeners(); SnackBarUtil.showSnackBar(context, content); - isFingerprint = await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; + isFingerprint = + await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; } isFingerprint ? onChange(null) : _showPassKey(context, onChange); @@ -258,7 +270,8 @@ class PreferencesPageModel with ChangeNotifier { showAlertDialog(context, title, content, onConfirm); } - void _showPassKey(BuildContext context, void Function(String) onChange) async { + void _showPassKey( + BuildContext context, void Function(String) onChange) async { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 227c953d..7cf47f3b 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -29,7 +29,9 @@ class _PreferencesPageWidgetState extends State { create: (_) => PreferencesPageModel(), child: Consumer( builder: (context, model, child) => GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Scaffold( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, appBar: AppBar( @@ -91,7 +93,8 @@ class _PreferencesPageWidgetState extends State { ); } - Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + Widget _buildIconButton( + BuildContext context, int index, PreferencesPageModel model) { IconData icon; Function() onPressed = () => {}; bool isEnabled; @@ -203,10 +206,14 @@ class _PreferencesPageWidgetState extends State { child: Row( children: [ CircleAvatar( - backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + backgroundColor: isEnabled + ? FlutterFlowTheme.of(context).primary + : FlutterFlowTheme.of(context).alternate, child: Icon( icon, - color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + color: isEnabled + ? FlutterFlowTheme.of(context).primaryBackground + : FlutterFlowTheme.of(context).primary, ), ), const SizedBox(width: 8.0), diff --git a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart index 96d35366..022822ed 100644 --- a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart +++ b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart @@ -67,6 +67,7 @@ class _ProvisionalScheduleState extends State { centerTitle: true, elevation: 0.0, ), - body: const SafeArea(top: true, child: ScheduleProvisionalVisitPageWidget())); + body: const SafeArea( + top: true, child: ScheduleProvisionalVisitPageWidget())); } } diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart index 857728c9..bec899f0 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -29,8 +29,10 @@ class QrCodePageModel extends FlutterFlowModel { } Future initVariable() async { - isFingerprint = await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; - userDevUUID = await StorageHelper().get(ProfileStorageKey.userDevUUID.key) ?? ''; + isFingerprint = + await StorageHelper().get(LocalsStorageKey.fingerprint.key) == 'true'; + userDevUUID = + await StorageHelper().get(ProfileStorageKey.userDevUUID.key) ?? ''; safeSetState?.call(); } @@ -39,7 +41,8 @@ class QrCodePageModel extends FlutterFlowModel { unfocusNode.dispose(); } - Uint8List assembleQRPacket(int direction, String identifier, String password) { + Uint8List assembleQRPacket( + int direction, String identifier, String password) { List packet = [direction]; String paddedBadge = identifier.padLeft(30, '0'); @@ -57,7 +60,8 @@ class QrCodePageModel extends FlutterFlowModel { int sum = year + month + day + hour + minute; - if (sum == int.parse('0D', radix: 16) || sum == int.parse('0A', radix: 16)) { + if (sum == int.parse('0D', radix: 16) || + sum == int.parse('0A', radix: 16)) { packet.add(int.parse('FF', radix: 16)); } else { packet.add(sum); @@ -75,7 +79,8 @@ class QrCodePageModel extends FlutterFlowModel { check ^= b; } - if (check == int.parse('0D', radix: 16) || check == int.parse('0A', radix: 16)) { + if (check == int.parse('0D', radix: 16) || + check == int.parse('0A', radix: 16)) { packet.add(int.parse('FF', radix: 16)); } else { packet.add(check); @@ -88,25 +93,35 @@ class QrCodePageModel extends FlutterFlowModel { int len = s.length; Uint8List data = Uint8List(len ~/ 2); for (int i = 0; i < len; i += 2) { - data[i ~/ 2] = ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); + data[i ~/ 2] = + ((int.parse(s[i], radix: 16) << 4) + int.parse(s[i + 1], radix: 16)); } return data; } String byteToHexa(Uint8List pDados) { - return pDados.map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()).join(); + return pDados + .map((byte) => byte.toRadixString(16).padLeft(2, '0').toUpperCase()) + .join(); } Future byteToString(Uint8List bytes) async { return String.fromCharCodes(bytes); } - Widget buildQrCode({required int errorCorrectLevel, required double dimension, required String identifier, required String pass, required int direction}) { + Widget buildQrCode( + {required int errorCorrectLevel, + required double dimension, + required String identifier, + required String pass, + required int direction}) { try { const Color backgroundColor = Colors.white; const Color foregroundColor = Colors.black; return QrImageView.withQr( - qr: QrCode.fromUint8List(data: assembleQRPacket(direction, identifier, pass), errorCorrectLevel: errorCorrectLevel), + qr: QrCode.fromUint8List( + data: assembleQRPacket(direction, identifier, pass), + errorCorrectLevel: errorCorrectLevel), size: dimension, padding: const EdgeInsets.all(10), backgroundColor: backgroundColor, diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index f71f9b5c..0fa56484 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -32,7 +32,8 @@ class QrCodePageWidget extends StatefulWidget { State createState() => _QrCodePageWidgetState(); } -class _QrCodePageWidgetState extends State with TickerProviderStateMixin { +class _QrCodePageWidgetState extends State + with TickerProviderStateMixin { late QrCodePageModel _model; final scaffoldKey = GlobalKey(); @@ -68,7 +69,9 @@ class _QrCodePageWidgetState extends State with TickerProvider ), }); setupAnimations( - animationsMap.values.where((anim) => anim.trigger == AnimationTrigger.onActionTrigger || !anim.applyInitialState), + animationsMap.values.where((anim) => + anim.trigger == AnimationTrigger.onActionTrigger || + !anim.applyInitialState), this, ); } @@ -77,7 +80,9 @@ class _QrCodePageWidgetState extends State with TickerProvider void dispose() { // Removendo o ouvinte antes de chamar super.dispose para evitar vazamentos de memória if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.removeStatusListener((status) {}); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .removeStatusListener((status) {}); } super.dispose(); @@ -96,10 +101,12 @@ class _QrCodePageWidgetState extends State with TickerProvider Widget buildBody(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; double screenHeight = MediaQuery.of(context).size.height; - double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; + double smallerDimension = + screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; double totalTimeInSeconds = 100.0; - double limitedHeaderTextSize = LimitedFontSizeUtil.getCalculateFontSize(context, 18, 18, 16); + double limitedHeaderTextSize = + LimitedFontSizeUtil.getCalculateFontSize(context, 18, 18, 16); double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); return SafeArea( @@ -120,11 +127,13 @@ class _QrCodePageWidgetState extends State with TickerProvider ), textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: limitedHeaderTextSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -139,7 +148,9 @@ class _QrCodePageWidgetState extends State with TickerProvider _resetAnimationAndToggleAccess(); }); - _model.isFingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + _model.isFingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); }, child: _model.buildQrCode( dimension: dimension, @@ -192,7 +203,9 @@ class _QrCodePageWidgetState extends State with TickerProvider alignment: const AlignmentDirectional(0.0, 0.0), child: FFButtonWidget( onPressed: () async { - _model.isFingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + _model.isFingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); }, text: FFLocalizations.of(context).getVariableText( ptText: 'Gerar QR Code', @@ -200,15 +213,26 @@ class _QrCodePageWidgetState extends State with TickerProvider ), options: FFButtonOptions( height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, color: Colors.white, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), - fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 12, 12, 10), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + fontSize: LimitedFontSizeUtil + .getCalculateFontSize( + context, 12, 12, 10), ), elevation: 3.0, borderSide: const BorderSide( @@ -234,15 +258,20 @@ class _QrCodePageWidgetState extends State with TickerProvider visible: _model.isAccess == true, child: Text( FFLocalizations.of(context).getVariableText( - ptText: 'Certifique-se de que o QRCode está visivel para o leitor', - enText: 'Make sure the QRCode is visible to the reader', + ptText: + 'Certifique-se de que o QRCode está visivel para o leitor', + enText: + 'Make sure the QRCode is visible to the reader', // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, ), textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), fontSize: limitedBodyFontSize, ), ), @@ -266,7 +295,8 @@ class _QrCodePageWidgetState extends State with TickerProvider children: [ Expanded( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(10.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getVariableText( ptText: 'Expirando QR code em', @@ -274,12 +304,20 @@ class _QrCodePageWidgetState extends State with TickerProvider // 'wkjkxd2e' /* Trocando QR code em */, ), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + fontSize: + LimitedFontSizeUtil.getNoResizeFont( + context, 14), ), ), ), @@ -287,11 +325,13 @@ class _QrCodePageWidgetState extends State with TickerProvider Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 20.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 20.0, 0.0), child: StreamBuilder( stream: getProgressValue(), builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { + if (snapshot.connectionState == + ConnectionState.waiting) { return const CircularProgressIndicator(); } else if (snapshot.hasError) { return Text('Error: ${snapshot.error}'); @@ -310,15 +350,26 @@ class _QrCodePageWidgetState extends State with TickerProvider onAnimationEnd: () { _resetAnimationAndToggleAccess(); }, - progressColor: FlutterFlowTheme.of(context).primary, - backgroundColor: FlutterFlowTheme.of(context).primaryText, + progressColor: + FlutterFlowTheme.of(context).primary, + backgroundColor: + FlutterFlowTheme.of(context) + .primaryText, center: Text( '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', - style: FlutterFlowTheme.of(context).headlineSmall.override( - fontFamily: FlutterFlowTheme.of(context).headlineSmallFamily, - fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), + style: FlutterFlowTheme.of(context) + .headlineSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineSmallFamily, + fontSize: LimitedFontSizeUtil + .getNoResizeFont(context, 14), letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineSmallFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineSmallFamily), ), ), startAngle: 20.0, @@ -341,14 +392,21 @@ class _QrCodePageWidgetState extends State with TickerProvider Future _showBiometricsAuth(BuildContext context) async { await BiometricHelper.checkBiometrics() - .then((value) async => await BiometricHelper.authenticateBiometric().then((value) async { - if (value == false) throw Exception('Biometric authentication failed'); - final key = await StorageHelper().get(SecureStorageKey.fingerprintPass.value); + .then((value) async => + await BiometricHelper.authenticateBiometric().then((value) async { + if (value == false) + throw Exception('Biometric authentication failed'); + final key = await StorageHelper() + .get(SecureStorageKey.fingerprintPass.value); if (key == null || key.isEmpty) throw Exception('No key found'); safeSetState(() { if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .stop(); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .reverse(); } _model.isAccess = !_model.isAccess; _model.key = key; @@ -368,15 +426,22 @@ class _QrCodePageWidgetState extends State with TickerProvider context: context, builder: (context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { safeSetState(() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + if (animationsMap['barcodeOnActionTriggerAnimation'] != + null) { + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .stop(); + animationsMap['barcodeOnActionTriggerAnimation']! + .controller + .reverse(); } _model.isAccess = !_model.isAccess; _model.key = key; @@ -386,7 +451,8 @@ class _QrCodePageWidgetState extends State with TickerProvider ), ); }, - ).catchError((error) => safeSetState(() => _resetAnimationAndToggleAccess())); + ).catchError( + (error) => safeSetState(() => _resetAnimationAndToggleAccess())); unawaited( () async { await _model.qrCodeEncoder(context, key: _model.key); @@ -430,7 +496,8 @@ class _QrCodePageWidgetState extends State with TickerProvider fontSize: 15.0, fontWeight: FontWeight.bold, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), ), ), actions: const [], diff --git a/lib/pages/reception_page/reception_page_model.dart b/lib/pages/reception_page/reception_page_model.dart index c4834564..e72e9b96 100644 --- a/lib/pages/reception_page/reception_page_model.dart +++ b/lib/pages/reception_page/reception_page_model.dart @@ -5,7 +5,8 @@ import 'package:share_plus/share_plus.dart'; class ReceptionPageModel with ChangeNotifier { Future getIdenfifier(BuildContext context) async { - final String userDevUUID = (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; + final String userDevUUID = + (await StorageHelper().get(ProfileStorageKey.userDevUUID.key)) ?? ''; notifyListeners(); Share.share( diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index d48c10cf..7a6d41d7 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -25,7 +25,8 @@ class ReceptionPageWidget extends StatefulWidget { State createState() => _ReceptionPageWidgetState(); } -class _ReceptionPageWidgetState extends State with WidgetsBindingObserver { +class _ReceptionPageWidgetState extends State + with WidgetsBindingObserver { @override void initState() { super.initState(); @@ -55,7 +56,8 @@ class _ReceptionPageWidgetState extends State with WidgetsB @override Widget build(BuildContext context) { - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedHeaderFontSize = + LimitedFontSizeUtil.getHeaderFontSize(context); double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); @@ -75,34 +77,46 @@ class _ReceptionPageWidgetState extends State with WidgetsB Padding( padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0), child: Text( - FFLocalizations.of(context) - .getVariableText(ptText: 'Falta pouco para você utilizar o FRE Access Hub...', enText: 'You are close to using the FRE Access Hub...'), + FFLocalizations.of(context).getVariableText( + ptText: + 'Falta pouco para você utilizar o FRE Access Hub...', + enText: + 'You are close to using the FRE Access Hub...'), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).displayLarge.override( + style: FlutterFlowTheme.of(context) + .displayLarge + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).accent1, fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w700, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), ), ), - const AtomImageSvgTheme(filename: 'reception', width: 180, height: 180), + const AtomImageSvgTheme( + filename: 'reception', width: 180, height: 180), Padding( padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40), child: Text( FFLocalizations.of(context).getVariableText( - ptText: 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', - enText: 'Send your identifier to your condominium to link your account to our systems.'), + ptText: + 'Envie seu identificador para seu condomínio para vincularem sua conta aos nossos sistemas.', + enText: + 'Send your identifier to your condominium to link your account to our systems.'), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).displaySmall.override( + style: FlutterFlowTheme.of(context) + .displaySmall + .override( fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedBodyFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), ), ), @@ -113,32 +127,48 @@ class _ReceptionPageWidgetState extends State with WidgetsB Padding( padding: const EdgeInsets.fromLTRB(60, 0, 60, 10), child: Tooltip( - message: FFLocalizations.of(context) - .getVariableText(ptText: 'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.', enText: 'My Identifier'), - textStyle: FlutterFlowTheme.of(context).labelSmall.override( + message: FFLocalizations.of(context).getVariableText( + ptText: + 'Seu identificador é utilizado para efetuar\no vínculo do seu APP com o condominio.', + enText: 'My Identifier'), + textStyle: FlutterFlowTheme.of(context) + .labelSmall + .override( fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context).secondaryText, + color: FlutterFlowTheme.of(context) + .secondaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), child: FFButtonWidget( onPressed: () => model.getIdenfifier(context), - text: FFLocalizations.of(context).getVariableText(ptText: 'Meu Identificador', enText: 'My Identifier'), + text: FFLocalizations.of(context) + .getVariableText( + ptText: 'Meu Identificador', + enText: 'My Identifier'), options: FFButtonOptions( width: double.infinity, height: 30, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context).info, + color: + FlutterFlowTheme.of(context).info, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( @@ -159,20 +189,29 @@ class _ReceptionPageWidgetState extends State with WidgetsB AuthenticationService.signOut(context); setState(() {}); }, - text: FFLocalizations.of(context).getVariableText(ptText: 'Sair da Conta', enText: 'Logout'), + text: FFLocalizations.of(context).getVariableText( + ptText: 'Sair da Conta', enText: 'Logout'), options: FFButtonOptions( width: double.infinity, height: 30, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of(context).customColor1, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context).primaryBackground, + color: FlutterFlowTheme.of(context) + .primaryBackground, fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index e6db1afb..9c813fc5 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -4,10 +4,12 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'register_visitor_page_widget.dart' show RegisterVisitorPageWidget; import 'package:flutter/material.dart'; -class RegisterVisitorPageModel extends FlutterFlowModel { +class RegisterVisitorPageModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. - late RegisiterVistorTemplateComponentModel regisiterVistorTemplateComponentModel; + late RegisiterVistorTemplateComponentModel + regisiterVistorTemplateComponentModel; @override void initState(BuildContext context) {} diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index 50e11f96..483364bf 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -14,7 +14,8 @@ class RegisterVisitorPageWidget extends StatefulWidget { const RegisterVisitorPageWidget({super.key}); @override - State createState() => _RegisterVisitorPageWidgetState(); + State createState() => + _RegisterVisitorPageWidgetState(); } class _RegisterVisitorPageWidgetState extends State { @@ -65,7 +66,8 @@ class _RegisterVisitorPageWidgetState extends State { fontSize: 15.0, fontWeight: FontWeight.bold, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).headlineMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).headlineMediumFamily), ), ), actions: const [], diff --git a/lib/pages/reservation_page/reservation_page_widget.dart b/lib/pages/reservation_page/reservation_page_widget.dart index 0a388062..a75cd567 100644 --- a/lib/pages/reservation_page/reservation_page_widget.dart +++ b/lib/pages/reservation_page/reservation_page_widget.dart @@ -22,11 +22,16 @@ class _ReservationPageWidgetState extends State { late WebViewController _controllerAll; Future> initVariables() async { - final email = (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; - final name = (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final clientId = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final email = + (await StorageHelper().get(SecureStorageKey.email.value)) ?? ''; + final name = + (await StorageHelper().get(ProfileStorageKey.userName.key)) ?? ''; + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final clientId = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; const createdAt = '0000-00-00 00:00:00'; final url = 'https://hub.freaccess.com.br/hub/reservation/$clientId'; final freUserData = @@ -52,14 +57,20 @@ class _ReservationPageWidgetState extends State { builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return const Center(child: CircularProgressIndicator()); - } else if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) { - return Center(child: Text(FFLocalizations.of(context).getVariableText(enText: 'Unexpected error', ptText: 'Erro inesperado'))); + } else if (snapshot.hasError || + !snapshot.hasData || + snapshot.data!.isEmpty) { + return Center( + child: Text(FFLocalizations.of(context).getVariableText( + enText: 'Unexpected error', ptText: 'Erro inesperado'))); } else { final data = snapshot.data!; final url = data['url']!; final userUUID = data['userUUID']!; final freUserData = data['freUserData']!; - return Platform.isIOS ? _buildIOSWebView(url, userUUID, freUserData) : _buildAndroidWebView(url, userUUID, freUserData); + return Platform.isIOS + ? _buildIOSWebView(url, userUUID, freUserData) + : _buildAndroidWebView(url, userUUID, freUserData); } }, ), @@ -76,9 +87,14 @@ class _ReservationPageWidgetState extends State { ), onWebViewCreated: (controller) async {}, onLoadStop: (controller, url) async { - await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-token', '\"$userUUID\"')"); - await controller.evaluateJavascript(source: "window.localStorage.setItem('fre-user-data', '$freUserData')"); - await controller.evaluateJavascript(source: "window.localStorage.setItem('enableBackButton', 'true')"); + await controller.evaluateJavascript( + source: + "window.localStorage.setItem('fre-token', '\"$userUUID\"')"); + await controller.evaluateJavascript( + source: + "window.localStorage.setItem('fre-user-data', '$freUserData')"); + await controller.evaluateJavascript( + source: "window.localStorage.setItem('enableBackButton', 'true')"); }, onUpdateVisitedHistory: (controller, uri, isVisited) { if (uri.toString().contains('/hub/home')) context.pop(); @@ -96,23 +112,30 @@ class _ReservationPageWidgetState extends State { ..setNavigationDelegate( NavigationDelegate( onPageStarted: (String url) { - final String token = "localStorage.setItem('fre-token', '\"$userUUID\"');"; - final String data = "localStorage.setItem('fre-user-data', '$freUserData');"; - const String backNavigation = "localStorage.setItem('enableBackButton', 'true');"; + final String token = + "localStorage.setItem('fre-token', '\"$userUUID\"');"; + final String data = + "localStorage.setItem('fre-user-data', '$freUserData');"; + const String backNavigation = + "localStorage.setItem('enableBackButton', 'true');"; _controllerAll.runJavaScript(token); _controllerAll.runJavaScript(data); _controllerAll.runJavaScript(backNavigation); }, onPageFinished: (String url) { - bool isDarkMode = SchedulerBinding.instance.platformDispatcher.platformBrightness == Brightness.dark; + bool isDarkMode = SchedulerBinding + .instance.platformDispatcher.platformBrightness == + Brightness.dark; if (isDarkMode) { _controllerAll.runJavaScript(WebviewUtil.jsEnableDarkMode); } }, onNavigationRequest: (NavigationRequest request) { - if (request.url.startsWith('http') || request.url.startsWith('https://api.whatsapp.com/send') || request.url.startsWith('https://wa.me')) { + if (request.url.startsWith('http') || + request.url.startsWith('https://api.whatsapp.com/send') || + request.url.startsWith('https://wa.me')) { launchUrlString(request.url); return NavigationDecision.prevent; } diff --git a/lib/pages/residents_on_the_property/residents_on_the_property_model.dart b/lib/pages/residents_on_the_property/residents_on_the_property_model.dart index cf0e1966..02c42ef4 100644 --- a/lib/pages/residents_on_the_property/residents_on_the_property_model.dart +++ b/lib/pages/residents_on_the_property/residents_on_the_property_model.dart @@ -3,7 +3,8 @@ import 'package:hub/features/storage/index.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; import 'package:hub/pages/residents_on_the_property/residents_on_the_property_screen.dart'; -class ResidentsOnThePropertyModel extends FlutterFlowModel { +class ResidentsOnThePropertyModel + extends FlutterFlowModel { ResidentsOnThePropertyModel({this.onRefresh}); late final VoidCallback? onRefresh; @@ -18,7 +19,8 @@ class ResidentsOnThePropertyModel extends FlutterFlowModel _ResidentsOnThePropertyState(); } -class _ResidentsOnThePropertyState extends State with TickerProviderStateMixin { +class _ResidentsOnThePropertyState extends State + with TickerProviderStateMixin { late ScrollController _scrollController; int _pageNumber = 1; @@ -33,12 +34,16 @@ class _ResidentsOnThePropertyState extends State with Ti @override void initState() { super.initState(); - model = createModel(context, () => ResidentsOnThePropertyModel(onRefresh: () => safeSetState(() {}))); + model = createModel( + context, + () => + ResidentsOnThePropertyModel(onRefresh: () => safeSetState(() {}))); _future = _fetch(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -52,7 +57,8 @@ class _ResidentsOnThePropertyState extends State with Ti @override Widget build(BuildContext context) { - late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + late final limitedHeaderTextSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return Scaffold( appBar: _appBar(context), @@ -129,7 +135,9 @@ class _ResidentsOnThePropertyState extends State with Ti return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(ptText: 'Moradores', enText: 'Residents'), + title: Text( + FFLocalizations.of(context) + .getVariableText(ptText: 'Moradores', enText: 'Residents'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -164,7 +172,8 @@ class _ResidentsOnThePropertyState extends State with Ti try { setState(() => _loading = true); - var response = await PhpGroup.getResidentsByProperty.call(_pageNumber.toString()); + var response = + await PhpGroup.getResidentsByProperty.call(_pageNumber.toString()); final List residents = response.jsonBody['residents'] ?? []; safeSetState(() => count = response.jsonBody['total_rows'] ?? 0); @@ -189,7 +198,8 @@ class _ResidentsOnThePropertyState extends State with Ti return null; } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de moradores", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de moradores", e, s); setState(() { _hasData = false; _loading = false; @@ -227,19 +237,22 @@ class _ResidentsOnThePropertyState extends State with Ti Widget _item(BuildContext context, dynamic uItem) { return CardItemTemplateComponentWidget( - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['documento']}&tipo=Z', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['documento']}&tipo=Z', labelsHashMap: { - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': uItem['nome'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + uItem['nome'] ?? '', //statusweb - '${FFLocalizations.of(context).getVariableText(ptText: "Possui App", enText: "Has App")}:': uItem['statusweb'] == "A" - ? FFLocalizations.of(context).getVariableText( - ptText: 'Sim', - enText: 'Yes', - ) - : FFLocalizations.of(context).getVariableText( - ptText: 'Não', - enText: 'No', - ), + '${FFLocalizations.of(context).getVariableText(ptText: "Possui App", enText: "Has App")}:': + uItem['statusweb'] == "A" + ? FFLocalizations.of(context).getVariableText( + ptText: 'Sim', + enText: 'Yes', + ) + : FFLocalizations.of(context).getVariableText( + ptText: 'Não', + enText: 'No', + ), }, statusHashMap: [], onTapCardItemAction: () async {}, diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 18276cc3..f7248d93 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -16,7 +16,8 @@ import 'package:share_plus/share_plus.dart'; import '../../shared/utils/validator_util.dart'; -class ScheduleCompleteVisitPageModel extends FlutterFlowModel { +class ScheduleCompleteVisitPageModel + extends FlutterFlowModel { ScheduleCompleteVisitPageModel({this.safeSetState}); late VoidCallback? safeSetState; @@ -44,14 +45,16 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel requestFn: requestFn, ); void clearVisitHistoryCache() => _visitHistoryManager.clear(); - void clearVisitHistoryCacheKey(String? uniqueKey) => _visitHistoryManager.clearRequest(uniqueKey); + void clearVisitHistoryCacheKey(String? uniqueKey) => + _visitHistoryManager.clearRequest(uniqueKey); String convertDateFormat(String dateStr) { try { DateFormat originalFormat = DateFormat('dd/MM/yyyy HH:mm:ss'); DateFormat newFormat = DateFormat('y-M-d H:mm:ss'); - if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$').hasMatch(dateStr)) { + if (!RegExp(r'^\d{1,2}/\d{1,2}/\d{4} \d{1,2}:\d{2}:\d{2}$') + .hasMatch(dateStr)) { return 'Invalid date format'; } @@ -66,12 +69,20 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel void addToVisitorJsonList(dynamic item) => visitorJsonList.add(item); void removeFromVisitorJsonList(dynamic item) => visitorJsonList.remove(item); - void removeAtIndexFromVisitorJsonList(int index) => visitorJsonList.removeAt(index); - void insertAtIndexInVisitorJsonList(int index, dynamic item) => visitorJsonList.insert(index, item); - void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => visitorJsonList[index] = updateFn(visitorJsonList[index]); + void removeAtIndexFromVisitorJsonList(int index) => + visitorJsonList.removeAt(index); + void insertAtIndexInVisitorJsonList(int index, dynamic item) => + visitorJsonList.insert(index, item); + void updateVisitorJsonListAtIndex(int index, Function(dynamic) updateFn) => + visitorJsonList[index] = updateFn(visitorJsonList[index]); bool isValid() { - if (textController1!.text.isEmpty || textController2!.text.isEmpty || dropDownValue1 == null || dropDownValue1!.isEmpty || dropDownValue2 == null || dropDownValue2!.isEmpty) { + if (textController1!.text.isEmpty || + textController2!.text.isEmpty || + dropDownValue1 == null || + dropDownValue1!.isEmpty || + dropDownValue2 == null || + dropDownValue2!.isEmpty) { return false; } @@ -84,11 +95,14 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel DateTime selectedDateTime1; DateTime selectedDateTime2; - DateTime currentDateTime = DateTime.now().subtract(const Duration(minutes: 10)); + DateTime currentDateTime = + DateTime.now().subtract(const Duration(minutes: 10)); try { - selectedDateTime1 = DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController1.text); - selectedDateTime2 = DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController2.text); + selectedDateTime1 = + DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController1.text); + selectedDateTime2 = + DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController2.text); } catch (e) { return false; } @@ -110,7 +124,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel final unfocusNode = FocusNode(); TabController? tabBarController; - int get tabBarCurrentIndex => tabBarController != null ? tabBarController!.index : 0; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; FocusNode? textFieldFocusNode1; TextEditingController? textController1; @@ -125,14 +140,16 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel if (val != '0') { try { DateTime startDate = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val); - DateTime endDate = DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController2!.text); + DateTime endDate = + DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController2!.text); if (startDate.isAfter(endDate)) { return FFLocalizations.of(context).getVariableText( ptText: 'A data de início deve ser anterior à data de término.', enText: 'Start date must be before end date.', ); } - if (startDate.isBefore(DateTime.now().subtract(const Duration(minutes: 10)))) { + if (startDate + .isBefore(DateTime.now().subtract(const Duration(minutes: 10)))) { return FFLocalizations.of(context).getVariableText( enText: 'Start date must be after current date.', ptText: 'A data de início deve ser posterior à data atual.', @@ -145,7 +162,9 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel ); } } catch (e) { - return FFLocalizations.of(context).getVariableText(ptText: 'Preencha corretamente o campo de término da visita!', enText: 'Fill in the end of visit field correctly!'); + return FFLocalizations.of(context).getVariableText( + ptText: 'Preencha corretamente o campo de término da visita!', + enText: 'Fill in the end of visit field correctly!'); } } return null; @@ -165,7 +184,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel if (val != '0') { try { DateTime endDate = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val); - DateTime startDate = DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController1!.text); + DateTime startDate = + DateFormat('dd/MM/yyyy HH:mm:ss').parse(textController1!.text); if (endDate.isBefore(startDate)) { return FFLocalizations.of(context).getVariableText( @@ -173,7 +193,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel ptText: 'A data de término deve ser posterior à data de início.', ); } - if (startDate.isBefore(DateTime.now().subtract(const Duration(minutes: 10)))) { + if (startDate + .isBefore(DateTime.now().subtract(const Duration(minutes: 10)))) { return FFLocalizations.of(context).getVariableText( enText: 'End date must be after current date.', ptText: 'A data de término deve ser posterior à data atual.', @@ -186,7 +207,9 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel ); } } catch (e) { - return FFLocalizations.of(context).getVariableText(ptText: 'Preencha corretamente o campo de início da visita!', enText: 'Fill in the visit start field correctly!'); + return FFLocalizations.of(context).getVariableText( + ptText: 'Preencha corretamente o campo de início da visita!', + enText: 'Fill in the visit start field correctly!'); } } return null; @@ -208,8 +231,10 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel Future _initVariables() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override @@ -240,8 +265,10 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel textController3 = TextEditingController(); textController3Validator = _textController3Validator; - dropDownValueController1 ??= FormFieldController(dropDownValue1 ??= ''); - dropDownValueController2 ??= FormFieldController(dropDownValue2 ??= ''); + dropDownValueController1 ??= + FormFieldController(dropDownValue1 ??= ''); + dropDownValueController2 ??= + FormFieldController(dropDownValue2 ??= ''); } // Updated variables for dropdowns @@ -257,8 +284,11 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel void processDropDown1(List reasonsJsonList) { if (dropDownValue1 != null && dropDownValue1!.isNotEmpty) { String value = dropDownValue1!; - if (!(value.contains('{') && value.contains('}') && value.contains(':'))) { - var item = reasonsJsonList.where((reason) => reason['MOT_DESCRICAO'].toString().contains(dropDownValue1!)); + if (!(value.contains('{') && + value.contains('}') && + value.contains(':'))) { + var item = reasonsJsonList.where((reason) => + reason['MOT_DESCRICAO'].toString().contains(dropDownValue1!)); dropDownValue1 = item.firstOrNull?.toString() ?? ''; dropDownValueController1?.value = dropDownValue1!; } @@ -270,8 +300,11 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel void processDropDown2(List lavelList) { if (dropDownValue2 != null && dropDownValue2!.isNotEmpty) { String value = dropDownValue2!; - if (!(value.contains('{') && value.contains('}') && value.contains(':'))) { - var item = lavelList.where((level) => level['NAC_DESCRICAO'].toString().contains(dropDownValue2!)); + if (!(value.contains('{') && + value.contains('}') && + value.contains(':'))) { + var item = lavelList.where((level) => + level['NAC_DESCRICAO'].toString().contains(dropDownValue2!)); dropDownValue2 = item.firstOrNull?.toString() ?? ''; dropDownValueController2?.value = dropDownValue2!; } @@ -322,7 +355,11 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel } } - Future visitCancelAction(BuildContext context, {required int? idDestino, required int? idVisita, required String? accessKey, required String? email}) async { + Future visitCancelAction(BuildContext context, + {required int? idDestino, + required int? idVisita, + required String? accessKey, + required String? email}) async { final ApiCallResponse? response; final CancelaVisita callback = PhpGroup.cancelaVisita; @@ -394,7 +431,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel Widget buildVisitDetails({ required dynamic item, required BuildContext context, - required Future Function(BuildContext, int, int, String, String) changeStatusAction, + required Future Function(BuildContext, int, int, String, String) + changeStatusAction, required String devUUID, required String userUUID, required String cliUUID, @@ -402,7 +440,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel }) { return DetailsComponentWidget( buttons: [ - if (Status.getStatus(item['VAW_STATUS']) == StatusEnum.active) // REJECT ACTION + if (Status.getStatus(item['VAW_STATUS']) == + StatusEnum.active) // REJECT ACTION FFButtonWidget( text: FFLocalizations.of(context).getVariableText( ptText: 'Cancelar', @@ -481,7 +520,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel // borderRadius: 12, ), ), - if (Status.getStatus(item['VAW_STATUS']) != StatusEnum.active) // RECALL ACTION + if (Status.getStatus(item['VAW_STATUS']) != + StatusEnum.active) // RECALL ACTION FFButtonWidget( text: FFLocalizations.of(context).getVariableText( ptText: 'Reagendar', @@ -516,7 +556,8 @@ class ScheduleCompleteVisitPageModel extends FlutterFlowModel // borderRadius: 12, ), ), - if (Status.getStatus(item['VAW_STATUS']) == StatusEnum.active) // SHARE ACTION + if (Status.getStatus(item['VAW_STATUS']) == + StatusEnum.active) // SHARE ACTION FFButtonWidget( text: FFLocalizations.of(context).getVariableText( ptText: 'Compartilhar', @@ -553,13 +594,21 @@ URL do Convite: https://visita.freaccess.com.br/${item['VAW_ID']}/$cliUUID/${ite ), ], labelsHashMap: Map.from({ - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': item['VTE_NOME'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + item['VTE_NOME'] ?? '', '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': - item['VAW_DTINICIO'] != '' && item['VAW_DTINICIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', item['VAW_DTINICIO']) : '', + item['VAW_DTINICIO'] != '' && item['VAW_DTINICIO'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', item['VAW_DTINICIO']) + : '', '${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': - item['VAW_DTFIM'] != '' && item['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', item['VAW_DTFIM']) : '', + item['VAW_DTFIM'] != '' && item['VAW_DTFIM'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', item['VAW_DTFIM']) + : '', }), - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=${item['VTE_DOCUMENTO'] ?? ''}&tipo=E', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=$cliUUID&atividade=getFoto&Documento=${item['VTE_DOCUMENTO'] ?? ''}&tipo=E', statusHashMap: [ if (Status.getStatus(item['VAW_STATUS']) == StatusEnum.active) Map.from({ diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 71050c2d..d5b8aea4 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -32,10 +32,13 @@ class ScheduleCompleteVisitPageWidget extends ScheduleComplete { const ScheduleCompleteVisitPageWidget({super.key}); @override - State createState() => _ScheduleCompleteVisitPageWidgetState(); + State createState() => + _ScheduleCompleteVisitPageWidgetState(); } -class _ScheduleCompleteVisitPageWidgetState extends State with TickerProviderStateMixin { +class _ScheduleCompleteVisitPageWidgetState + extends State + with TickerProviderStateMixin { bool _isLoading = false; late ScheduleCompleteVisitPageModel _model; int _visitHistoryLoadingIdx = 0; @@ -48,7 +51,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState(() {}))); + _model = createModel( + context, + () => ScheduleCompleteVisitPageModel( + safeSetState: () => safeSetState(() {}))); _model.updateState = (Function fn) => safeSetState(fn()); _model.tabBarController = TabController( @@ -74,7 +80,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State newItems = await fetchVisitHistory(start, _visitHistoryLoadingCount); + final List newItems = + await fetchVisitHistory(start, _visitHistoryLoadingCount); if (newItems.isNotEmpty) { _visitHistoryList.addAll(newItems); @@ -84,7 +91,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -147,7 +157,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State 16.0 ? 100 : 80; return SingleChildScrollView( @@ -227,17 +243,21 @@ class _ScheduleCompleteVisitPageWidgetState extends State e).toList(); + final visitorListView = + model.visitorJsonList.map((e) => e).toList(); return ListView.separated( padding: const EdgeInsets.fromLTRB( 0, @@ -647,16 +827,20 @@ class _ScheduleCompleteVisitPageWidgetState extends State const SizedBox(height: 5.0), + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = visitorListView[visitorListViewIndex]; + final visitorListViewItem = + visitorListView[visitorListViewIndex]; return Padding( - padding: const EdgeInsets.symmetric(horizontal: 30), + padding: + const EdgeInsets.symmetric(horizontal: 30), child: Container( width: MediaQuery.of(context).size.width, height: 70.0, decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, + color: FlutterFlowTheme.of(context) + .primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -670,8 +854,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), child: SizedBox( - height: MediaQuery.of(context).size.height * 0.8, + height: MediaQuery.of(context).size.height * + 0.8, width: MediaQuery.of(context).size.width, child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: VisitorSearchModalTemplateComponentWidget( + child: + VisitorSearchModalTemplateComponentWidget( getVisitors: (visitorsParam) async { - model.visitorJsonList = visitorsParam!.toList().cast(); + model.visitorJsonList = visitorsParam! + .toList() + .cast(); safeSetState(() {}); }, getDocs: (docsParam) async { - model.visitorStrList = strListToStr(docsParam!.toList()); + model.visitorStrList = + strListToStr(docsParam!.toList()); safeSetState(() {}); }, ), @@ -757,7 +966,8 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - FlutterFlowTheme.of(context).primary, + valueColor: + AlwaysStoppedAnimation( + FlutterFlowTheme.of(context) + .primary, ), ), ) : Icon( Icons.add, - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context) + .primary, size: 30.0, ), Padding( - padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), + padding: + const EdgeInsets.fromLTRB(0, 15, 0, 0), child: Text( FFLocalizations.of(context).getText( 'r8soavtz', ), textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).primaryText, + style: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, fontSize: limitedInputFontSize, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), ), ), ) @@ -811,17 +1033,23 @@ class _ScheduleCompleteVisitPageWidgetState extends State( @@ -848,43 +1078,69 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - fillColor: FlutterFlowTheme.of(context).primaryBackground, - controller: model.dropDownValueController1, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + controller: + model.dropDownValueController1, options: model.reasonsDropDown1, optionLabels: reasonsOptionLabels, - onChanged: (val) => safeSetState(() => model.dropDownValue1 = val), + onChanged: (val) => safeSetState( + () => model.dropDownValue1 = val), width: double.infinity, height: double.infinity, - textStyle: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), fontSize: limitedInputFontSize, ), - hintText: FFLocalizations.of(context).getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita'), + hintText: FFLocalizations.of(context) + .getVariableText( + enText: 'Reason for Visit', + ptText: 'Motivo da Visita'), icon: Icon( Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, size: 24.0, ), elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).customColor6, + borderColor: + FlutterFlowTheme.of(context) + .customColor6, borderWidth: 0.5, borderRadius: 10.0, - margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0), + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), hidesUnderline: true, isOverButton: true, isSearchable: false, @@ -904,15 +1160,20 @@ class _ScheduleCompleteVisitPageWidgetState extends State( - controller: model.dropDownValueController2, + controller: + model.dropDownValueController2, options: model.lavelsDropDown2, optionLabels: lavelsOptionLabels, - onChanged: (val) => safeSetState(() => model.dropDownValue2 = val), + onChanged: (val) => safeSetState( + () => model.dropDownValue2 = val), width: double.infinity, height: double.infinity, - textStyle: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), fontSize: limitedInputFontSize, ), - hintText: FFLocalizations.of(context).getVariableText( + hintText: FFLocalizations.of(context) + .getVariableText( enText: 'Level of access', ptText: 'Nível de acesso', ), icon: Icon( Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context) + .accent1, size: 24.0, ), elevation: 2.0, - borderColor: FlutterFlowTheme.of(context).customColor6, + borderColor: + FlutterFlowTheme.of(context) + .customColor6, borderWidth: 0.5, borderRadius: 10.0, - margin: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 0.0), + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), hidesUnderline: true, - fillColor: FlutterFlowTheme.of(context).primaryBackground, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, isOverButton: true, isSearchable: false, isMultiSelect: false, @@ -998,15 +1284,20 @@ class _ScheduleCompleteVisitPageWidgetState extends State await DialogUtil.errorDefault(context)) + .catchError((e) async => + await DialogUtil.errorDefault(context)) .then((value) async { if (PhpGroup.postScheduleVisitCall.error( (value.jsonBody ?? ''), @@ -1240,16 +1579,22 @@ class _ScheduleCompleteVisitPageWidgetState extends State(''); - model.dropDownValueController2 = FormFieldController(''); + model.dropDownValueController1 = + FormFieldController(''); + model.dropDownValueController2 = + FormFieldController(''); model.visitorStrList = ''; model.visitorJsonList = []; ToastUtil.showToast( - message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'), + message: FFLocalizations.of(context) + .getVariableText( + ptText: 'Visitante já adicionado!', + enText: 'Visitor already added!'), gravity: ToastGravity.TOP, backgroundColor: Colors.green, - fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + fontSize: + LimitedFontSizeUtil.getBodyFontSize(context), ); await ShareUtil.showShare(value.jsonBody); @@ -1268,9 +1613,12 @@ class _ScheduleCompleteVisitPageWidgetState extends State model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Dialog( alignment: Alignment.topCenter, child: SizedBox( child: DetailsComponentWidget( buttons: [ FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( + text: FFLocalizations.of(context) + .getVariableText( enText: 'Done', ptText: 'Confirmar', ), @@ -1295,14 +1647,19 @@ class _ScheduleCompleteVisitPageWidgetState extends State.from({ - FFLocalizations.of(context).getVariableText( + FFLocalizations.of(context) + .getVariableText( ptText: 'Inativo', enText: 'Inactive', ): FlutterFlowTheme.of(context).success, diff --git a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart index b75dd4b3..bafb04bb 100644 --- a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart @@ -20,7 +20,8 @@ class VisitHistoryWidget extends ScheduleComplete { _VisitHistoryWidgetState createState() => _VisitHistoryWidgetState(); } -class _VisitHistoryWidgetState extends State with TickerProviderStateMixin, Status { +class _VisitHistoryWidgetState extends State + with TickerProviderStateMixin, Status { late final String devUUID; late final String userUUID; late final String cliUUID; @@ -36,21 +37,27 @@ class _VisitHistoryWidgetState extends State with TickerProv Future _initVariables() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; } @override void initState() { super.initState(); - _model = createModel(context, () => ScheduleCompleteVisitPageModel(safeSetState: () => safeSetState(() {}))); + _model = createModel( + context, + () => ScheduleCompleteVisitPageModel( + safeSetState: () => safeSetState(() {}))); _initVariables(); _visitFuture = _fetchVisits(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -95,7 +102,8 @@ class _VisitHistoryWidgetState extends State with TickerProv return null; } catch (e, s) { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Visitas", e, s); setState(() { _hasData = false; _loading = false; @@ -115,7 +123,8 @@ class _VisitHistoryWidgetState extends State with TickerProv ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -129,7 +138,8 @@ class _VisitHistoryWidgetState extends State with TickerProv @override Widget build(BuildContext context) { - double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedHeaderFontSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return Column( mainAxisSize: MainAxisSize.max, @@ -142,8 +152,14 @@ class _VisitHistoryWidgetState extends State with TickerProv mainAxisSize: MainAxisSize.max, children: [ Center( - child: Text(FFLocalizations.of(context).getVariableText(ptText: "Nenhuma visita encontrada!", enText: "No visit found"), - style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize, fontWeight: FontWeight.bold)), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma visita encontrada!", + enText: "No visit found"), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedHeaderFontSize, + fontWeight: FontWeight.bold)), ) ], ), @@ -184,12 +200,20 @@ class _VisitHistoryWidgetState extends State with TickerProv imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=$devUUID&userUUID=$userUUID&cliID=$cliUUID&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', labelsHashMap: { - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': visitaWrapItem['VTE_NOME'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': visitaWrapItem['VAW_DTINICIO'] != '' && visitaWrapItem['VAW_DTINICIO'] != null - ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) - : '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + visitaWrapItem['VTE_NOME'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': + visitaWrapItem['VAW_DTINICIO'] != '' && + visitaWrapItem['VAW_DTINICIO'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) + : '', '${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': - visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '', + visitaWrapItem['VAW_DTFIM'] != '' && + visitaWrapItem['VAW_DTFIM'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) + : '', }, statusHashMap: [ if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.active) @@ -199,35 +223,40 @@ class _VisitHistoryWidgetState extends State with TickerProv enText: 'Active', ): FlutterFlowTheme.of(context).warning, }, - if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.finished) + if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == + StatusEnum.finished) { FFLocalizations.of(context).getVariableText( ptText: 'Finalizado', enText: 'Finished', ): FlutterFlowTheme.of(context).success, }, - if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.unknown) + if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == + StatusEnum.unknown) { FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', ): FlutterFlowTheme.of(context).alternate, }, - if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.canceled) + if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == + StatusEnum.canceled) { FFLocalizations.of(context).getVariableText( ptText: 'Cancelado', enText: 'Canceled', ): FlutterFlowTheme.of(context).error, }, - if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.blocked) + if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == + StatusEnum.blocked) { FFLocalizations.of(context).getVariableText( ptText: 'Bloqueado', enText: 'Blocked', ): FlutterFlowTheme.of(context).error, }, - if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == StatusEnum.inactive) + if (Status.getStatus(visitaWrapItem['VAW_STATUS']) == + StatusEnum.inactive) { FFLocalizations.of(context).getVariableText( ptText: 'Inativo', @@ -236,10 +265,14 @@ class _VisitHistoryWidgetState extends State with TickerProv }, ], onTapCardItemAction: () async { - final devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - final userUUID = (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; - final cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; - final cliName = (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; + final devUUID = + (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; + final userUUID = + (await StorageHelper().get(ProfileStorageKey.userUUID.key)) ?? ''; + final cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + final cliName = + (await StorageHelper().get(ProfileStorageKey.clientName.key)) ?? ''; await showDialog( useSafeArea: true, @@ -266,7 +299,8 @@ class _VisitHistoryWidgetState extends State with TickerProv }); }).catchError((e, s) async { await DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Visitas", e, s); safeSetState(() { _hasData = false; _loading = false; diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index 8642b98d..e8b945bd 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -12,7 +12,8 @@ class SignInPageModel extends FlutterFlowModel { @override void initState(BuildContext context) { - signInTemplateComponentModel = createModel(context, () => SignInTemplateComponentModel()); + signInTemplateComponentModel = + createModel(context, () => SignInTemplateComponentModel()); } @override diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index 7e0dd2da..e632670a 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -35,7 +35,9 @@ class _SignInPageWidgetState extends State { Widget build(BuildContext context) { StorageHelper().context = context; return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index ff69d9b5..938a3b46 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -12,7 +12,8 @@ class SignUpPageModel extends FlutterFlowModel { @override void initState(BuildContext context) { - signUpTemplateComponentModel = createModel(context, () => SignUpTemplateComponentModel()); + signUpTemplateComponentModel = + createModel(context, () => SignUpTemplateComponentModel()); } @override diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index b1811ffe..e91ac753 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -38,7 +38,9 @@ class _SignUpPageWidgetState extends State { Widget build(BuildContext context) { StorageHelper().context = context; return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart index b1ee15d5..6d3e51e0 100644 --- a/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart +++ b/lib/pages/vehicles_on_the_property/vehicles_on_the_property.dart @@ -17,7 +17,8 @@ class VehicleOnTheProperty extends StatefulWidget { _VehicleOnThePropertyState createState() => _VehicleOnThePropertyState(); } -class _VehicleOnThePropertyState extends State with TickerProviderStateMixin { +class _VehicleOnThePropertyState extends State + with TickerProviderStateMixin { late ScrollController _scrollController; int _pageNumber = 1; @@ -36,7 +37,8 @@ class _VehicleOnThePropertyState extends State with Ticker _future = _fetchVisits(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -50,7 +52,8 @@ class _VehicleOnThePropertyState extends State with Ticker @override Widget build(BuildContext context) { - late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + late final limitedHeaderTextSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return Scaffold( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -127,7 +130,9 @@ class _VehicleOnThePropertyState extends State with Ticker return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(enText: 'Vehicles', ptText: 'Veículos'), + title: Text( + FFLocalizations.of(context) + .getVariableText(enText: 'Vehicles', ptText: 'Veículos'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -162,7 +167,8 @@ class _VehicleOnThePropertyState extends State with Ticker try { setState(() => _loading = true); - var response = await PhpGroup.getVehiclesByProperty.call(_pageNumber.toString()); + var response = + await PhpGroup.getVehiclesByProperty.call(_pageNumber.toString()); final List vehicles = response.jsonBody['vehicles'] ?? []; safeSetState(() => count = response.jsonBody['total_rows'] ?? 0); @@ -187,7 +193,8 @@ class _VehicleOnThePropertyState extends State with Ticker return null; } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Veículo", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Veículo", e, s); setState(() { _hasData = false; _loading = false; @@ -227,9 +234,12 @@ class _VehicleOnThePropertyState extends State with Ticker return CardItemTemplateComponentWidget( imagePath: null, labelsHashMap: { - '${FFLocalizations.of(context).getVariableText(ptText: "Placa", enText: "License Plate")}:': uItem['licensePlate'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Modelo", enText: "Model")}:': uItem['model'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:': uItem['tag'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Placa", enText: "License Plate")}:': + uItem['licensePlate'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Modelo", enText: "Model")}:': + uItem['model'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Tag", enText: "Tag")}:': + uItem['tag'] ?? '', }, statusHashMap: [], onTapCardItemAction: () async { @@ -250,11 +260,13 @@ class _VehicleOnThePropertyState extends State with Ticker safeSetState(() { _pageNumber = 1; _wrap = []; - _future = _fetchVisits().then((value) => value!.jsonBody['vehicles'] ?? []); + _future = _fetchVisits() + .then((value) => value!.jsonBody['vehicles'] ?? []); }); }).catchError((e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Veículos", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Veículos", e, s); safeSetState(() { _hasData = false; _loading = false; diff --git a/lib/pages/visits_on_the_property/model.dart b/lib/pages/visits_on_the_property/model.dart index 4c0e3770..2ddcd047 100644 --- a/lib/pages/visits_on_the_property/model.dart +++ b/lib/pages/visits_on_the_property/model.dart @@ -9,7 +9,8 @@ import 'package:hub/pages/vehicles_on_the_property/vehicles_on_the_property.dart class VisitsModel extends FlutterFlowModel { static VisitsModel? _instance; VisitsModel._internal({this.onRefresh}); - factory VisitsModel({VoidCallback? onRefresh}) => _instance ??= VisitsModel._internal(onRefresh: onRefresh); + factory VisitsModel({VoidCallback? onRefresh}) => + _instance ??= VisitsModel._internal(onRefresh: onRefresh); static void resetInstance() => _instance = null; late final VoidCallback? onRefresh; @@ -30,7 +31,8 @@ class VisitsModel extends FlutterFlowModel { Future initAsync() async { devUUID = (await StorageHelper().get(ProfileStorageKey.devUUID.key)) ?? ''; - cliUUID = (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; + cliUUID = + (await StorageHelper().get(ProfileStorageKey.clientUUID.key)) ?? ''; onRefresh?.call(); } @@ -76,14 +78,17 @@ class VisitsModel extends FlutterFlowModel { enText: "No", ), }), - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${devUUID}&cliID=${cliUUID}&atividade=getFoto&Documento=${item['VDO_DOCUMENTO']}&tipo=E', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${devUUID}&cliID=${cliUUID}&atividade=getFoto&Documento=${item['VDO_DOCUMENTO']}&tipo=E', statusHashMap: [ Map.from({ if (item['VTA_FIXA'] != null) FFLocalizations.of(context).getVariableText( ptText: item['VTA_FIXA'] ? "Entrada Única" : "Entrada Recorrente", enText: item['VTA_FIXA'] ? "Single Entry" : "Recurrent Entry", - ): item['VTA_FIXA'] == true ? FlutterFlowTheme.of(context).success : FlutterFlowTheme.of(context).warning, + ): item['VTA_FIXA'] == true + ? FlutterFlowTheme.of(context).success + : FlutterFlowTheme.of(context).warning, }) ], ); diff --git a/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart b/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart index 95a154a0..3a2b6950 100644 --- a/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart +++ b/lib/pages/visits_on_the_property/visits_on_the_property_screen.dart @@ -17,7 +17,8 @@ class VisitsOnTheProperty extends StatefulWidget { _VisitsOnThePropertyState createState() => _VisitsOnThePropertyState(); } -class _VisitsOnThePropertyState extends State with TickerProviderStateMixin { +class _VisitsOnThePropertyState extends State + with TickerProviderStateMixin { late ScrollController _scrollController; int _pageNumber = 1; @@ -32,12 +33,14 @@ class _VisitsOnThePropertyState extends State with TickerPr @override void initState() { super.initState(); - model = createModel(context, () => VisitsModel(onRefresh: () => safeSetState(() {}))); + model = createModel( + context, () => VisitsModel(onRefresh: () => safeSetState(() {}))); _future = _fetchVisits(); _scrollController = ScrollController() ..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMore(); } }); @@ -51,8 +54,10 @@ class _VisitsOnThePropertyState extends State with TickerPr @override Widget build(BuildContext context) { - late final limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); - late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + late final limitedBodyTextSize = + LimitedFontSizeUtil.getBodyFontSize(context); + late final limitedHeaderTextSize = + LimitedFontSizeUtil.getHeaderFontSize(context); return Scaffold( appBar: _appBar(context), @@ -69,7 +74,9 @@ class _VisitsOnThePropertyState extends State with TickerPr children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText(ptText: "Nenhuma visita em aberto encontrada!", enText: "No opened visits found"), + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma visita em aberto encontrada!", + enText: "No opened visits found"), style: TextStyle( fontFamily: 'Nunito', fontSize: limitedHeaderTextSize, @@ -126,7 +133,9 @@ class _VisitsOnThePropertyState extends State with TickerPr return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - title: Text(FFLocalizations.of(context).getVariableText(ptText: 'Visitas em aberto', enText: 'Opened visits'), + title: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Visitas em aberto', enText: 'Opened visits'), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, @@ -161,7 +170,8 @@ class _VisitsOnThePropertyState extends State with TickerPr try { setState(() => _loading = true); - var response = await PhpGroup.getOpenedVisits.call(_pageNumber.toString()); + var response = + await PhpGroup.getOpenedVisits.call(_pageNumber.toString()); final List visits = response.jsonBody['visitas'] ?? []; safeSetState(() => count = response.jsonBody['total_rows'] ?? 0); @@ -186,7 +196,8 @@ class _VisitsOnThePropertyState extends State with TickerPr return null; } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Visitas", e, s); setState(() { _hasData = false; _loading = false; @@ -207,7 +218,8 @@ class _VisitsOnThePropertyState extends State with TickerPr ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), @@ -221,12 +233,16 @@ class _VisitsOnThePropertyState extends State with TickerPr Widget _item(BuildContext context, dynamic uItem) { return CardItemTemplateComponentWidget( - imagePath: 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['VDO_DOCUMENTO']}&tipo=E', + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['VDO_DOCUMENTO']}&tipo=E', labelsHashMap: { - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': uItem['VTA_NOME'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Validade", enText: "Valids")}:': uItem['VTA_VALIDADE'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + uItem['VTA_NOME'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Validade", enText: "Valids")}:': + uItem['VTA_VALIDADE'] ?? '', '${FFLocalizations.of(context).getVariableText(ptText: "Motivo", enText: "Reason")}:': - uItem['MOT_DESCRICAO'][0].toUpperCase() + uItem['MOT_DESCRICAO'].substring(1).toLowerCase(), + uItem['MOT_DESCRICAO'][0].toUpperCase() + + uItem['MOT_DESCRICAO'].substring(1).toLowerCase(), }, statusHashMap: [ if (uItem['VTA_FIXA'] == false) @@ -262,11 +278,13 @@ class _VisitsOnThePropertyState extends State with TickerPr safeSetState(() { _pageNumber = 1; _list = []; - _future = _fetchVisits().then((value) => value!.jsonBody['visitas'] ?? []); + _future = _fetchVisits() + .then((value) => value!.jsonBody['visitas'] ?? []); }); }).catchError((e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed("proccessRequest.php", "", "Consulta de Visitas", e, s); + LogUtil.requestAPIFailed( + "proccessRequest.php", "", "Consulta de Visitas", e, s); safeSetState(() { _hasData = false; _loading = false; diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index 7823f2b2..b8a54a7e 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -16,7 +16,8 @@ class WelcomePageModel extends FlutterFlowModel { @override void initState(BuildContext context) { - welcomeTemplateComponentModel = createModel(context, () => WelcomeTemplateComponentModel()); + welcomeTemplateComponentModel = + createModel(context, () => WelcomeTemplateComponentModel()); } @override diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index b665ebe8..5b3f46ea 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -53,7 +53,9 @@ class _WelcomePageWidgetState extends State { Widget build(BuildContext context) { StorageHelper().context = context; return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/shared/constants/keychain_constants.dart b/lib/shared/constants/keychain_constants.dart index 0aac6594..83019a63 100644 --- a/lib/shared/constants/keychain_constants.dart +++ b/lib/shared/constants/keychain_constants.dart @@ -1,6 +1,6 @@ - const String tableKeychain = 'keychain'; +const String tableKeychain = 'keychain'; - String get createKeychainTable => ''' +String get createKeychainTable => ''' CREATE TABLE IF NOT EXISTS $tableKeychain ( key TEXT UNIQUE, value TEXT, @@ -10,4 +10,4 @@ createdAt TEXT ); '''; - String get deleteKeychainTable => 'DROP TABLE IF EXISTS $tableKeychain;'; \ No newline at end of file +String get deleteKeychainTable => 'DROP TABLE IF EXISTS $tableKeychain;'; diff --git a/lib/shared/extensions/dialog_extensions.dart b/lib/shared/extensions/dialog_extensions.dart index 222154dc..b4c4e86b 100644 --- a/lib/shared/extensions/dialog_extensions.dart +++ b/lib/shared/extensions/dialog_extensions.dart @@ -16,7 +16,8 @@ extension DialogUnavailable on DialogUtil { static Future unavailableCredentials(BuildContext context) { final message = FFLocalizations.of(context).getVariableText( - ptText: "Credenciais inválidas. Selecione um local ou faça o login novamente.", + ptText: + "Credenciais inválidas. Selecione um local ou faça o login novamente.", enText: "Invalid credentials. Select a location or log in again.", ); return DialogUtil.warning(context, message); diff --git a/lib/shared/extensions/flutter_secure_storage_extensions.dart b/lib/shared/extensions/flutter_secure_storage_extensions.dart index e689535d..8bba2507 100644 --- a/lib/shared/extensions/flutter_secure_storage_extensions.dart +++ b/lib/shared/extensions/flutter_secure_storage_extensions.dart @@ -6,23 +6,30 @@ import 'package:synchronized/synchronized.dart'; extension FlutterSecureStorageExtensions on FlutterSecureStorage { static final _lock = Lock(); - Future writeSync({required String key, String? value}) async => await _lock.synchronized(() async { + Future writeSync({required String key, String? value}) async => + await _lock.synchronized(() async { await write(key: key, value: value); }); void remove(String key) => delete(key: key); Future getString(String key) async => await read(key: key); - Future setString(String key, String value) async => await writeSync(key: key, value: value); + Future setString(String key, String value) async => + await writeSync(key: key, value: value); Future getBool(String key) async => (await read(key: key)) == 'true'; - Future setBool(String key, bool? value) async => await writeSync(key: key, value: value.toString()); + Future setBool(String key, bool? value) async => + await writeSync(key: key, value: value.toString()); - Future getInt(String key) async => int.tryParse(await read(key: key) ?? ''); - Future setInt(String key, int value) async => await writeSync(key: key, value: value.toString()); + Future getInt(String key) async => + int.tryParse(await read(key: key) ?? ''); + Future setInt(String key, int value) async => + await writeSync(key: key, value: value.toString()); - Future getDouble(String key) async => double.tryParse(await read(key: key) ?? ''); - Future setDouble(String key, double value) async => await writeSync(key: key, value: value.toString()); + Future getDouble(String key) async => + double.tryParse(await read(key: key) ?? ''); + Future setDouble(String key, double value) async => + await writeSync(key: key, value: value.toString()); Future getObject(String key) async { final value = await read(key: key); @@ -32,12 +39,18 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage { return value as BuildContext; } - Future?> getStringList(String key) async => await read(key: key).then((result) { + Future?> getStringList(String key) async => + await read(key: key).then((result) { if (result == null || result.isEmpty) { return null; } - return const CsvToListConverter().convert(result).first.map((e) => e.toString()).toList(); + return const CsvToListConverter() + .convert(result) + .first + .map((e) => e.toString()) + .toList(); }); Future setStringList(String key, List value) async => - await writeSync(key: key, value: const ListToCsvConverter().convert([value])); + await writeSync( + key: key, value: const ListToCsvConverter().convert([value])); } diff --git a/lib/shared/helpers/index.dart b/lib/shared/helpers/index.dart index e69de29b..8b137891 100644 --- a/lib/shared/helpers/index.dart +++ b/lib/shared/helpers/index.dart @@ -0,0 +1 @@ + diff --git a/lib/shared/index.dart b/lib/shared/index.dart index e69de29b..8b137891 100644 --- a/lib/shared/index.dart +++ b/lib/shared/index.dart @@ -0,0 +1 @@ + diff --git a/lib/shared/services/index.dart b/lib/shared/services/index.dart index e69de29b..8b137891 100644 --- a/lib/shared/services/index.dart +++ b/lib/shared/services/index.dart @@ -0,0 +1 @@ + diff --git a/lib/shared/utils/device_util.dart b/lib/shared/utils/device_util.dart index da41877e..24e7f265 100644 --- a/lib/shared/utils/device_util.dart +++ b/lib/shared/utils/device_util.dart @@ -6,7 +6,8 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/services.dart'; class DeviceUtil { - static const MethodChannel _channel = MethodChannel("com.freaccess.hub/getAndroidId"); + static const MethodChannel _channel = + MethodChannel("com.freaccess.hub/getAndroidId"); static Future getAndroidId() async { try { @@ -67,7 +68,8 @@ class DeviceUtil { } else if (Platform.isAndroid) { var androidDeviceInfo = await deviceInfo.androidInfo; - return androidDeviceInfo.version.release; // unique ID on Android. e.g . 11 + return androidDeviceInfo + .version.release; // unique ID on Android. e.g . 11 } return null; diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart index d9f1c64d..6804443a 100644 --- a/lib/shared/utils/dialog_util.dart +++ b/lib/shared/utils/dialog_util.dart @@ -32,7 +32,8 @@ class DialogUtil { height: _height, child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error)))); + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.error)))); }); } @@ -45,7 +46,8 @@ class DialogUtil { height: _height, child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning)))); + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.warning)))); }); } @@ -58,7 +60,8 @@ class DialogUtil { height: _height, child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success)))); + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.success)))); }); } } diff --git a/lib/shared/utils/image_util.dart b/lib/shared/utils/image_util.dart index f180004e..4c55c0dd 100644 --- a/lib/shared/utils/image_util.dart +++ b/lib/shared/utils/image_util.dart @@ -9,7 +9,8 @@ import 'package:path_provider/path_provider.dart'; import '../../flutter_flow/uploaded_file.dart'; class ImageUtils { - static Future convertImageFileToBase64(FFUploadedFile imageFile) async { + static Future convertImageFileToBase64( + FFUploadedFile imageFile) async { List? imageBytes = imageFile.bytes; if (imageBytes != null) { String base64Image = base64Encode(imageBytes); diff --git a/lib/shared/utils/limited_text_size.dart b/lib/shared/utils/limited_text_size.dart index 199dd83b..3356427f 100644 --- a/lib/shared/utils/limited_text_size.dart +++ b/lib/shared/utils/limited_text_size.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; class LimitedFontSizeUtil { - static double getCalculateFontSize( - BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { + static double getCalculateFontSize(BuildContext context, double baseFontSize, + double maxFontSize, double limitedFontSize) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? limitedFontSize : scaledFontSize; @@ -14,8 +14,8 @@ class LimitedFontSizeUtil { return noscaledFontSize; } - static double getScaledSizedBoxSize( - BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { + static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, + double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? sizeIfExceeded : sizeIfNotExceeded; diff --git a/lib/shared/utils/loading_util.dart b/lib/shared/utils/loading_util.dart index d30dfec3..f1fa6e75 100644 --- a/lib/shared/utils/loading_util.dart +++ b/lib/shared/utils/loading_util.dart @@ -3,15 +3,16 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; class LoadingUtil { - static Widget buildLoadingIndicator(BuildContext context) { + static Widget buildLoadingIndicator(BuildContext context) { return Center( child: Padding( padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 10), child: CircularProgressIndicator( - backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!).primaryBackground, + backgroundColor: FlutterFlowTheme.of(navigatorKey.currentContext!) + .primaryBackground, color: FlutterFlowTheme.of(navigatorKey.currentContext!).primary, ), ), ); } -} \ No newline at end of file +} diff --git a/lib/shared/utils/log_util.dart b/lib/shared/utils/log_util.dart index 24a5561d..c9c9526b 100644 --- a/lib/shared/utils/log_util.dart +++ b/lib/shared/utils/log_util.dart @@ -4,7 +4,8 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:hub/features/backend/index.dart'; class LogUtil { - static void requestAPIFailed(String url, String body, String reason, dynamic error, StackTrace stack) async { + static void requestAPIFailed(String url, String body, String reason, + dynamic error, StackTrace stack) async { final fullUrl = "${PhpGroup.getBaseUrl()}/$url"; log("URL: $fullUrl"); log("Body: $body"); @@ -15,6 +16,7 @@ class LogUtil { FirebaseCrashlytics.instance.setCustomKey('URL', fullUrl); FirebaseCrashlytics.instance.setCustomKey('Body', body); - await FirebaseCrashlytics.instance.recordError(error, stack, reason: reason); + await FirebaseCrashlytics.instance + .recordError(error, stack, reason: reason); } } diff --git a/lib/shared/utils/path_util.dart b/lib/shared/utils/path_util.dart index 4692235a..8eda1149 100644 --- a/lib/shared/utils/path_util.dart +++ b/lib/shared/utils/path_util.dart @@ -1,10 +1,8 @@ - import 'package:flutter/material.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; class PathUtil { - static Future nav(String link) async { navigatorKey.currentContext!.push(link, extra: { kTransitionInfoKey: const TransitionInfo( @@ -14,4 +12,4 @@ class PathUtil { ), }); } -} \ No newline at end of file +} diff --git a/lib/shared/utils/snackbar_util.dart b/lib/shared/utils/snackbar_util.dart index 1b8ae0d0..7dff08bf 100644 --- a/lib/shared/utils/snackbar_util.dart +++ b/lib/shared/utils/snackbar_util.dart @@ -5,16 +5,21 @@ import 'package:hub/shared/utils/limited_text_size.dart'; import '../../flutter_flow/flutter_flow_theme.dart'; class SnackBarUtil { - static void showSnackBar(BuildContext context, String text, {bool isError = false}) { + static void showSnackBar(BuildContext context, String text, + {bool isError = false}) { double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( text, overflow: TextOverflow.clip, - style: TextStyle(color: FlutterFlowTheme.of(context).info, fontSize: limitedBodyFontSize), + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + fontSize: limitedBodyFontSize), ), - backgroundColor: isError ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success, + backgroundColor: isError + ? FlutterFlowTheme.of(context).error + : FlutterFlowTheme.of(context).success, duration: const Duration(seconds: 3), behavior: SnackBarBehavior.floating, shape: RoundedRectangleBorder( @@ -28,7 +33,8 @@ class SnackBarUtil { ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( - FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), style: TextStyle( color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context), diff --git a/lib/shared/utils/text_util.dart b/lib/shared/utils/text_util.dart index 344279e9..d2876a0b 100644 --- a/lib/shared/utils/text_util.dart +++ b/lib/shared/utils/text_util.dart @@ -16,8 +16,9 @@ class TextUtil extends StatelessWidget { Widget build(BuildContext context) { var textScale = MediaQuery.textScalerOf(context); var scaledTextSize = textScale.scale(style?.fontSize ?? 14); - double limitedTextSize = - scaledTextSize > (style?.fontSize ?? 14) * 2 ? (style?.fontSize ?? 14) * 2 : scaledTextSize; + double limitedTextSize = scaledTextSize > (style?.fontSize ?? 14) * 2 + ? (style?.fontSize ?? 14) * 2 + : scaledTextSize; return Text( text,