From be8f6b7ae3c82447dab87ea7c94a303c4721e94f Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Wed, 30 Oct 2024 16:46:23 -0300 Subject: [PATCH] FIX: +3 hours in provisional schedule --- .../provisional_shcedule_template_widget.dart | 787 +++++------------- .../delivery_schedule_widget.dart | 8 +- .../schedule_complete_visit_page_widget.dart | 779 +++++------------ 3 files changed, 413 insertions(+), 1161 deletions(-) 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 d5af8a30..53c0577b 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 @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; @@ -16,12 +18,10 @@ 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 @@ -61,25 +61,16 @@ class _ScheduleProvisionalVisitPageWidgetState Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 0.0, 24.0), + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 0.0, 24.0), child: Text( - FFLocalizations.of(context).getText( - 'uj8acuab' /* Preencha os Campos Abaixo: */, - ), + FFLocalizations.of(context).getText('uj8acuab'), textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontSize: 16.0, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -87,41 +78,28 @@ class _ScheduleProvisionalVisitPageWidgetState Container( width: double.infinity, decoration: BoxDecoration( - color: - FlutterFlowTheme.of(context).primaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, ), child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), + alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 0.0, 0.0), child: Text( - FFLocalizations.of(context).getText( - '8d3679lf' /* Propriedade */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, + FFLocalizations.of(context).getText('8d3679lf'), + 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), ), ), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 10.0, 24.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 10.0, 24.0, 10.0), child: Container( width: double.infinity, height: 50.0, @@ -133,16 +111,14 @@ class _ScheduleProvisionalVisitPageWidgetState topRight: Radius.circular(50.0), ), border: Border.all( - color: FlutterFlowTheme.of(context) - .customColor5, + color: FlutterFlowTheme.of(context).customColor5, ), ), child: Padding( padding: const EdgeInsets.all(5.0), child: Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ ClipRRect( borderRadius: const BorderRadius.only( @@ -152,12 +128,9 @@ class _ScheduleProvisionalVisitPageWidgetState topRight: Radius.circular(50.0), ), child: CachedNetworkImage( - fadeInDuration: const Duration( - milliseconds: 200), - fadeOutDuration: const Duration( - milliseconds: 200), - imageUrl: - 'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png', + fadeInDuration: const Duration(milliseconds: 200), + fadeOutDuration: const Duration(milliseconds: 200), + imageUrl: 'https://freaccess.com.br/freaccess/Images/Clients/${model.cliUUID}.png', width: 35.0, height: 35.0, fit: BoxFit.contain, @@ -166,24 +139,13 @@ class _ScheduleProvisionalVisitPageWidgetState ), ), 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: Text( model.cliName, - 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), ), ), ), @@ -203,27 +165,15 @@ class _ScheduleProvisionalVisitPageWidgetState mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Align( - alignment: - const AlignmentDirectional(-1.0, 0.0), + alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 10.0, 0.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB(24.0, 10.0, 0.0, 10.0), child: Text( - FFLocalizations.of(context).getText( - 'z6aawgqa' /* Dados da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, + FFLocalizations.of(context).getText('z6aawgqa'), + 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), ), ), ), @@ -234,149 +184,76 @@ class _ScheduleProvisionalVisitPageWidgetState Container( height: 80.0, decoration: const BoxDecoration(), - alignment: - const AlignmentDirectional(0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), 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: SizedBox( width: double.infinity, child: TextFormField( - controller: - model.personNameTextController, - focusNode: - model.personNameFocusNode, - cursorColor: - FlutterFlowTheme.of(context) - .primary, - onChanged: (_) => - EasyDebounce.debounce( - 'model.personNameTextController', - const Duration(milliseconds: 500), - () => setState(() {}), - ), + 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( - '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), - ), - 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), - ), + labelText: FFLocalizations.of(context).getText('wehvxbz4'), + 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), + ), + hintStyle: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .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), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: null, - validator: model - .personNameTextControllerValidator - .asValidator(context), + validator: model.personNameTextControllerValidator.asValidator(context), ), ), ), @@ -390,199 +267,99 @@ class _ScheduleProvisionalVisitPageWidgetState SizedBox( height: 80.0, child: Stack( - alignment: const AlignmentDirectional( - 0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), 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.dateTimeTextController, - focusNode: - model.dateTimeFocusNode, - cursorColor: - FlutterFlowTheme.of(context) - .primary, - onChanged: (_) => - EasyDebounce.debounce( - 'model.dateTimeTextController', - const Duration( - milliseconds: 500), - () => setState(() {}), - ), + controller: model.dateTimeTextController, + focusNode: model.dateTimeFocusNode, + cursorColor: FlutterFlowTheme.of(context).primary, + onChanged: (_) => EasyDebounce.debounce('model.dateTimeTextController', const Duration(milliseconds: 500), () => setState(() {})), readOnly: true, autofocus: false, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: - FFLocalizations.of(context) - .getText( - '8zgsw5so' /* Data / Hora Limite da Visita */, - ), - labelStyle: - FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - enabledBorder: - OutlineInputBorder( + labelText: FFLocalizations.of(context).getText('8zgsw5so'), + labelStyle: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + ), + enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor5, + color: FlutterFlowTheme.of(context).customColor5, width: 0.5, ), - borderRadius: - BorderRadius.circular( - 8.0), + borderRadius: BorderRadius.circular(8.0), ), - focusedBorder: - OutlineInputBorder( + focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .primary, + color: FlutterFlowTheme.of(context).primary, width: 0.5, ), - borderRadius: - BorderRadius.circular( - 8.0), + 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), + borderRadius: BorderRadius.circular(8.0), ), - focusedErrorBorder: - OutlineInputBorder( + focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, + color: FlutterFlowTheme.of(context).error, width: 0.5, ), - borderRadius: - BorderRadius.circular( - 8.0), + borderRadius: BorderRadius.circular(8.0), ), suffixIcon: Icon( Icons.date_range, - color: FlutterFlowTheme.of( - context) - .accent1, + 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), - ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + ), textAlign: TextAlign.start, - validator: model - .dateTimeTextControllerValidator - .asValidator(context), + validator: model.dateTimeTextControllerValidator.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: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, - highlightColor: - Colors.transparent, + highlightColor: Colors.transparent, onTap: () async { - final datePickedDate = - await showDatePicker( + final datePickedDate = await showDatePicker( context: context, - initialDate: - getCurrentTimestamp, - firstDate: - (getCurrentTimestamp), + initialDate: getCurrentTimestamp, + firstDate: (getCurrentTimestamp), lastDate: DateTime(2050), builder: (context, child) { return wrapInMaterialDatePickerTheme( context, child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, + 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).secondaryBackground, + pickerForegroundColor: FlutterFlowTheme.of(context).primaryText, + selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, + selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, iconSize: 24.0, ); }, @@ -590,77 +367,35 @@ class _ScheduleProvisionalVisitPageWidgetState TimeOfDay? datePickedTime; if (datePickedDate != null) { - datePickedTime = - await showTimePicker( + datePickedTime = await showTimePicker( context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialTime: TimeOfDay.fromDateTime(getCurrentTimestamp), builder: (context, child) { return wrapInMaterialTimePickerTheme( context, child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: - 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of( - context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - pickerDialForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of( - context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, + 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).secondaryBackground, + pickerForegroundColor: FlutterFlowTheme.of(context).info, + selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context).primary, + pickerDialForegroundColor: FlutterFlowTheme.of(context).primaryText, + selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: FlutterFlowTheme.of(context).primaryText, iconSize: 24.0, ); }, ); } - if (datePickedDate != null && - datePickedTime != null) { + if (datePickedDate != null && datePickedTime != null) { safeSetState(() { model.datePicked = DateTime( datePickedDate.year, @@ -672,35 +407,22 @@ class _ScheduleProvisionalVisitPageWidgetState }); } setState(() { - model.dateTimeTextController - ?.text = dateTimeFormat( + model.datePicked = model.datePicked?.add(const Duration(hours: 3)); + model.dateTimeTextController?.text = dateTimeFormat( "dd/MM/yyyy HH:mm:ss", model.datePicked, - locale: FFLocalizations.of( - context) - .languageCode, + locale: FFLocalizations.of(context).languageCode, ); - - model.dateTimeTextController - ?.selection = - TextSelection.collapsed( - offset: model - .dateTimeTextController! - .text - .length); + model.dateTimeTextController?.selection = TextSelection.collapsed(offset: model.dateTimeTextController!.text.length); }); }, child: Container( width: double.infinity, height: 50.0, decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( - 8.0), + borderRadius: BorderRadius.circular(8.0), ), - alignment: - const AlignmentDirectional( - 0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), ), ), ), @@ -710,178 +432,88 @@ class _ScheduleProvisionalVisitPageWidgetState ], ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 10.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 10.0), child: Column( mainAxisSize: MainAxisSize.max, children: [ Align( - alignment: const AlignmentDirectional( - 0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), child: Container( decoration: const BoxDecoration(), - alignment: const AlignmentDirectional( - 0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), child: Align( - alignment: - const AlignmentDirectional( - 0.0, 0.0), + alignment: const AlignmentDirectional(0.0, 0.0), 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: SizedBox( width: double.infinity, child: TextFormField( - controller: - model.notesTextController, - focusNode: - model.notesFocusNode, + controller: model.notesTextController, + focusNode: model.notesFocusNode, autofocus: false, showCursor: true, - cursorColor: - FlutterFlowTheme.of( - context) - .primary, - textInputAction: - TextInputAction.next, + cursorColor: FlutterFlowTheme.of(context).primary, + textInputAction: TextInputAction.next, obscureText: false, decoration: InputDecoration( isDense: true, - labelText: - FFLocalizations.of( - context) - .getText( - 'cw8b3tbb' /* Observação da Visita */, - ), - labelStyle: FlutterFlowTheme - .of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - color: FlutterFlowTheme - .of(context) - .primaryText, + labelText: FFLocalizations.of(context).getText('cw8b3tbb'), + 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), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), - 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( + 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( + 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( + 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.text_fields, - 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), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), textAlign: TextAlign.start, maxLines: 3, maxLength: 100, - maxLengthEnforcement: - MaxLengthEnforcement - .enforced, - validator: model - .notesTextControllerValidator - .asValidator(context), + maxLengthEnforcement: MaxLengthEnforcement.enforced, + validator: model.notesTextControllerValidator.asValidator(context), ), ), ), @@ -900,87 +532,56 @@ class _ScheduleProvisionalVisitPageWidgetState ? null : () async { try { - model.provVisitSchedule = await PhpGroup - .postProvVisitSchedulingCall - .call( + model.provVisitSchedule = await PhpGroup.postProvVisitSchedulingCall.call( data: model.dateTimeTextController.text, motivo: model.notesTextController.text, nome: model.personNameTextController.text, proID: model.ownerUUID, ); - - if (PhpGroup.postProvVisitSchedulingCall - .error((model.provVisitSchedule - ?.jsonBody ?? - '')) == - false) { + if (PhpGroup.postProvVisitSchedulingCall.error((model.provVisitSchedule?.jsonBody ?? '')) == false) { DialogUtil.success( context, FFLocalizations.of(context).getVariableText( - ptText: - "Agendamento Provisório Realizado com Sucesso!", - enText: - "Provisional Scheduling Successfully Completed")); + ptText: "Agendamento Provisório Realizado com Sucesso!", + enText: "Provisional Scheduling Successfully Completed", + )); safeSetState(() { model.dateTimeTextController?.clear(); - model.personNameTextController?.clear(); model.notesTextController?.clear(); }); } else { - var message = PhpGroup - .postProvVisitSchedulingCall - .msg((model.provVisitSchedule - ?.jsonBody ?? - '')); + var message = PhpGroup.postProvVisitSchedulingCall.msg((model.provVisitSchedule?.jsonBody ?? '')); if (message != null) { DialogUtil.error(context, message); } else { DialogUtil.errorDefault(context); } } - setState(() {}); } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed( - "processRequest.php", - "", - "Cadastrar Visita Provisória", - e, - s); + LogUtil.requestAPIFailed("processRequest.php", "", "Cadastrar Visita Provisória", e, s); } }, showLoadingIndicator: true, - text: FFLocalizations.of(context) - .getText('bv5fg9sv' /* Enviar */), + text: FFLocalizations.of(context).getText('bv5fg9sv'), options: FFButtonOptions( width: 150.0, height: 50.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), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), ), elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, - ), + borderSide: const BorderSide(color: Colors.transparent, width: 1.0), borderRadius: BorderRadius.circular(8.0), - disabledColor: - FlutterFlowTheme.of(context).customColor5, + disabledColor: FlutterFlowTheme.of(context).customColor5, disabledTextColor: Colors.white, ), ), @@ -990,9 +591,7 @@ class _ScheduleProvisionalVisitPageWidgetState ), ], ), - ] - .addToStart(const SizedBox(height: 4.0)) - .addToEnd(const SizedBox(height: 40.0)), + ].addToStart(const SizedBox(height: 4.0)).addToEnd(const SizedBox(height: 40.0)), ), ), ); diff --git a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart index 46d3c440..148a4220 100644 --- a/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart +++ b/lib/pages/delivery_schedule_page/delivery_schedule_widget.dart @@ -50,10 +50,7 @@ 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, @@ -67,7 +64,6 @@ 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/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index 8ce47494..86d8b5ab 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1,4 +1,3 @@ - import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -35,13 +34,10 @@ 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 { late ScheduleCompleteVisitPageModel _model; int _visitHistoryLoadingIdx = 0; final int _visitHistoryLoadingCount = 10; @@ -80,8 +76,7 @@ class _ScheduleCompleteVisitPageWidgetState } final int start = _visitHistoryLoadingIdx * _visitHistoryLoadingCount; - final List newItems = - await fetchVisitHistory(start, _visitHistoryLoadingCount); + final List newItems = await fetchVisitHistory(start, _visitHistoryLoadingCount); if (newItems.isNotEmpty) { _visitHistoryList.addAll(newItems); @@ -91,8 +86,7 @@ class _ScheduleCompleteVisitPageWidgetState } void _scrollListener() { - if (_visitHistoryController.position.pixels == - _visitHistoryController.position.maxScrollExtent) { + if (_visitHistoryController.position.pixels == _visitHistoryController.position.maxScrollExtent) { _loadMoreVisitHistory(); } } @@ -107,9 +101,7 @@ class _ScheduleCompleteVisitPageWidgetState @override Widget build(BuildContext 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, @@ -158,8 +150,7 @@ PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { ); } -Widget bodyScheduleCompleteVisit(BuildContext context, - ScheduleCompleteVisitPageModel model, Function safeSetState) { +Widget bodyScheduleCompleteVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Function safeSetState) { return SafeArea( top: true, child: Column( @@ -173,8 +164,7 @@ Widget bodyScheduleCompleteVisit(BuildContext context, fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, fontSize: 13.0, 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, @@ -217,8 +207,7 @@ Widget bodyScheduleCompleteVisit(BuildContext context, ); } -Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, - Function safeSetState) { +Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Function safeSetState) { return SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, @@ -233,20 +222,15 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 24.0), + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 30.0, 0.0, 24.0), child: Text( - FFLocalizations.of(context).getText( - '98evnbbe', - ), + FFLocalizations.of(context).getText('98evnbbe'), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -260,60 +244,40 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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: model.textController1, readOnly: true, focusNode: model.textFieldFocusNode1, - autovalidateMode: - AutovalidateMode.onUserInteraction, + 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, + 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( - '53cbwqh9', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + hintText: FFLocalizations.of(context).getText('53cbwqh9'), + 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( borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent4, + color: FlutterFlowTheme.of(context).accent4, 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), @@ -337,25 +301,17 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, color: FlutterFlowTheme.of(context).accent1, ), ), - 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), lineHeight: 1.8, ), textAlign: TextAlign.start, - validator: model.textController1Validator - .asValidator(context)), + validator: model.textController1Validator.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: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -371,38 +327,20 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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, + 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), + 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, + 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, ); }, @@ -412,58 +350,33 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, if (datePicked1Date != null) { datePicked1Time = await showTimePicker( context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialTime: TimeOfDay.fromDateTime(getCurrentTimestamp), builder: (context, child) { return wrapInMaterialTimePickerTheme( context, child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, + 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), + 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, + 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, iconSize: 24.0, ); }, ); } - if (datePicked1Date != null && - datePicked1Time != null) { + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { model.datePicked1 = DateTime( datePicked1Date.year, @@ -478,13 +391,9 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, model.textController1?.text = dateTimeFormat( 'dd/MM/yyyy HH:mm:ss', model.datePicked1, - locale: FFLocalizations.of(context) - .languageCode, + locale: FFLocalizations.of(context).languageCode, ); - model.textController1?.selection = - TextSelection.collapsed( - offset: model - .textController1!.text.length); + model.textController1?.selection = TextSelection.collapsed(offset: model.textController1!.text.length); }); }, child: Container( @@ -510,46 +419,30 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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( readOnly: true, controller: model.textController2, focusNode: model.textFieldFocusNode2, - autovalidateMode: - AutovalidateMode.onUserInteraction, + 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, + 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( 'xpgc5e8d', ), - 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), lineHeight: 1.0, ), enabledBorder: OutlineInputBorder( @@ -585,26 +478,18 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, color: FlutterFlowTheme.of(context).accent1, ), ), - 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), lineHeight: 1.8, ), textAlign: TextAlign.start, - validator: model.textController2Validator - .asValidator(context), + validator: model.textController2Validator.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: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -620,38 +505,20 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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, + 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), + 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, + 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, ); }, @@ -661,58 +528,33 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, if (datePicked2Date != null) { datePicked2Time = await showTimePicker( context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialTime: TimeOfDay.fromDateTime(getCurrentTimestamp), builder: (context, child) { return wrapInMaterialTimePickerTheme( context, child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, + 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), + 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, + 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, iconSize: 24.0, ); }, ); } - if (datePicked2Date != null && - datePicked2Time != null) { + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { model.datePicked2 = DateTime( datePicked2Date.year, @@ -727,13 +569,9 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, model.textController2?.text = dateTimeFormat( 'dd/MM/yyyy HH:mm:ss', model.datePicked2, - locale: FFLocalizations.of(context) - .languageCode, + locale: FFLocalizations.of(context).languageCode, ); - model.textController2?.selection = - TextSelection.collapsed( - offset: model - .textController2!.text.length); + model.textController2?.selection = TextSelection.collapsed(offset: model.textController2!.text.length); }); }, child: Container( @@ -757,21 +595,17 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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( FFLocalizations.of(context).getText( 'u0jocx7e', ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -779,8 +613,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, if (model.visitorJsonList.isNotEmpty) Builder( builder: (context) { - final visitorListView = - model.visitorJsonList.map((e) => e).toList(); + final visitorListView = model.visitorJsonList.map((e) => e).toList(); return ListView.separated( padding: const EdgeInsets.fromLTRB( 0, @@ -791,20 +624,16 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, shrinkWrap: true, scrollDirection: Axis.vertical, itemCount: visitorListView.length, - separatorBuilder: (_, __) => - 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, @@ -818,36 +647,21 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, shape: BoxShape.circle, ), child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: "https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", fit: BoxFit.cover, ), ), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), + padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Text( - getJsonField(visitorListViewItem, - r'''$.VTE_NOME''') - .toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, + getJsonField(visitorListViewItem, r'''$.VTE_NOME''').toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), overflow: TextOverflow.ellipsis, ), @@ -856,8 +670,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, IconButton( onPressed: () async { safeSetState(() { - model.removeFromVisitorJsonList( - visitorListViewItem); + model.removeFromVisitorJsonList(visitorListViewItem); if (model.visitorJsonList.isEmpty) { model.visitorStrList = ''; } @@ -878,44 +691,30 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(0.01, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), child: FFButtonWidget( onPressed: () async { await showModalBottomSheet( isScrollControlled: true, isDismissible: true, - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, enableDrag: true, context: context, builder: (context) { return GestureDetector( - onTap: () => - model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(model.unfocusNode) : FocusScope.of(context).unfocus(), child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.7, + height: MediaQuery.of(context).size.height * 0.7, width: MediaQuery.of(context).size.width, child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( + padding: MediaQuery.viewInsetsOf(context), + 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(() {}); }, ), @@ -934,25 +733,15 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, options: FFButtonOptions( width: MediaQuery.sizeOf(context).width * 0.8, height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB(14.0, 0.0, 0.0, 20.0), + color: FlutterFlowTheme.of(context).primaryBackground, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 16.0, letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent4, @@ -966,8 +755,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 0.0, 0.0), child: Container( width: MediaQuery.sizeOf(context).width * 0.8, height: 20.0, @@ -978,18 +766,11 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FFLocalizations.of(context).getText( 'r8soavtz', ), - 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), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -1006,21 +787,17 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 24.0, 0.0, 24.0), child: Text( FFLocalizations.of(context).getText( '0meymh6u', ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), @@ -1032,8 +809,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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: 45.0, @@ -1047,65 +823,44 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, width: 50.0, height: 50.0, child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, + color: FlutterFlowTheme.of(context).primary, size: 50.0, ), ), ); } - final reasonsJsonList = - PhpGroup.getDadosCall.reasonsJsonList( - snapshot.data!.jsonBody); - final reasonsOptionLabels = PhpGroup - .getDadosCall - .reasonsMotDescStrList( - snapshot.data!.jsonBody); + final reasonsJsonList = PhpGroup.getDadosCall.reasonsJsonList(snapshot.data!.jsonBody); + final reasonsOptionLabels = PhpGroup.getDadosCall.reasonsMotDescStrList(snapshot.data!.jsonBody); model.processDropDown1(reasonsJsonList!); return FlutterFlowDropDown( - 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), ), - hintText: - FFLocalizations.of(context).getText( + hintText: FFLocalizations.of(context).getText( '6p3e0bzr', ), 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).accent4, + borderColor: FlutterFlowTheme.of(context).accent4, 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, @@ -1124,17 +879,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), + padding: const EdgeInsets.symmetric(horizontal: 30.0, vertical: 5.0), child: Text( FFLocalizations.of(context).getVariableText( enText: 'Field is Required', ptText: 'Campo Obrigatório', ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), + style: TextStyle(color: FlutterFlowTheme.of(context).customColor6, fontSize: 12.0)), ), ], ), @@ -1147,8 +898,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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: 45.0, @@ -1162,64 +912,44 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, width: 50.0, height: 50.0, child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, + color: FlutterFlowTheme.of(context).primary, size: 50.0, ), ), ); } - final lavelsJsonList = PhpGroup.getDadosCall - .levelJsonList(snapshot.data!.jsonBody); - final lavelsOptionLabels = PhpGroup - .getDadosCall - .levelNACDescricaoStrList( - snapshot.data!.jsonBody); + final lavelsJsonList = PhpGroup.getDadosCall.levelJsonList(snapshot.data!.jsonBody); + final lavelsOptionLabels = PhpGroup.getDadosCall.levelNACDescricaoStrList(snapshot.data!.jsonBody); model.processDropDown2(lavelsJsonList!); return FlutterFlowDropDown( - 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), ), - hintText: - FFLocalizations.of(context).getText( + hintText: FFLocalizations.of(context).getText( '2wun8p6c', ), 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).accent4, + borderColor: FlutterFlowTheme.of(context).accent4, 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, @@ -1237,17 +967,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), + padding: const EdgeInsets.symmetric(horizontal: 30.0, vertical: 5.0), child: Text( FFLocalizations.of(context).getVariableText( enText: 'Field is Required', ptText: 'Campo Obrigatório', ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), + style: TextStyle(color: FlutterFlowTheme.of(context).customColor6, fontSize: 12.0)), ), ], ), @@ -1261,28 +987,23 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 24.0, 0.0, 24.0), child: Text( FFLocalizations.of(context).getText( '8rk26eg1', ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, 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( - 30.0, 0.0, 30.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB(30.0, 0.0, 30.0, 20.0), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -1290,23 +1011,16 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, children: [ Flexible( child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 130.0, 0.0), child: Text( FFLocalizations.of(context).getText( 'lgv0q5ht', ), textAlign: TextAlign.start, - 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), ), ), ), @@ -1325,15 +1039,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, return FlutterFlowTheme.of(context).alternate; }, ), - hoverColor: - FlutterFlowTheme.of(context).primaryBackground, + hoverColor: FlutterFlowTheme.of(context).primaryBackground, overlayColor: WidgetStateProperty.resolveWith( (states) { if (states.contains(WidgetState.disabled)) { return FlutterFlowTheme.of(context).accent4; } - return FlutterFlowTheme.of(context) - .primaryBackground; + return FlutterFlowTheme.of(context).primaryBackground; }, ), trackOutlineColor: WidgetStateProperty.resolveWith( @@ -1341,17 +1053,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, if (states.contains(WidgetState.disabled)) { return FlutterFlowTheme.of(context).accent4; } - return FlutterFlowTheme.of(context) - .primaryBackground; + return FlutterFlowTheme.of(context).primaryBackground; }, ), activeColor: FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, + activeTrackColor: FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: FlutterFlowTheme.of(context).error, ), ], ), @@ -1364,28 +1072,23 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), + padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 24.0), child: Text( FFLocalizations.of(context).getText( 'eftcs67c', ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ), ), 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: SizedBox( width: double.infinity, child: TextFormField( @@ -1400,30 +1103,20 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, labelText: FFLocalizations.of(context).getText( 't0q2vuup', ), - 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: FFLocalizations.of(context).getText( 'w18iztdm', ), - 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( @@ -1459,19 +1152,15 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, ), ), 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, maxLength: 80, - validator: - model.textController3Validator.asValidator(context), + validator: model.textController3Validator.asValidator(context), ), ), ), @@ -1495,17 +1184,15 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, Future scheduleVisit() async { await PhpGroup.postScheduleVisitCall .call( - devDesc: model.textController3.text, - idVisitante: model.visitorStrList, - dtInicio: model - .convertDateFormat(model.textController1.text), - dtFim: model - .convertDateFormat(model.textController2.text), - unica: model.switchValue == true ? 'S' : 'N', - idMotivo: extractIdToStr(model.dropDownValue1!), - idNAC: extractIdToStr(model.dropDownValue2!), - obs: model.textController3.text, - ) + devDesc: model.textController3.text, + idVisitante: model.visitorStrList, + dtInicio: model.convertDateFormat(model.textController1.text), + dtFim: model.convertDateFormat(model.textController2.text), + unica: model.switchValue == true ? 'S' : 'N', + idMotivo: extractIdToStr(model.dropDownValue1!), + idNAC: extractIdToStr(model.dropDownValue2!), + obs: model.textController3.text, + ) .catchError((e) async => await DialogUtil.errorDefault(context)) .then((value) async { if (PhpGroup.postScheduleVisitCall.error( @@ -1516,20 +1203,12 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, model.dropDownValue1 = null; model.dropDownValue2 = null; - model.dropDownValueController1 = - FormFieldController(''); - 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!'), - gravity: ToastGravity.TOP, - backgroundColor: Colors.green); + ToastUtil.showToast(message: FFLocalizations.of(context).getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'), gravity: ToastGravity.TOP, backgroundColor: Colors.green); await ShareUtil.showShare(value.jsonBody); } else { @@ -1548,10 +1227,8 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, enText: 'Register Multiple Visitors', ); final content = FFLocalizations.of(context).getVariableText( - ptText: - 'Você deseja agendar uma visita para ${model.visitorJsonList.length} visitantes?', - enText: - 'Do you want to schedule a visit for ${model.visitorJsonList.length} visitors?', + ptText: 'Você deseja agendar uma visita para ${model.visitorJsonList.length} visitantes?', + enText: 'Do you want to schedule a visit for ${model.visitorJsonList.length} visitors?', ); showAlertDialog(context, title, content, scheduleVisit); @@ -1560,18 +1237,14 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, 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: Dialog( alignment: Alignment.topCenter, child: SizedBox( child: DetailsComponentWidget( buttons: [ FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( + text: FFLocalizations.of(context).getVariableText( enText: 'Done', ptText: 'Confirmar', ), @@ -1580,43 +1253,27 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, options: FFButtonOptions( width: 130, height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + color: FlutterFlowTheme.of(context).primaryText, ), borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryBackground, + color: FlutterFlowTheme.of(context).primaryBackground, width: 1, ), ), ), ], - imagePath: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${model.cliUUID}&atividade=getFoto&Documento=${model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', + imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=${model.cliUUID}&atividade=getFoto&Documento=${model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', labelsHashMap: { 'Nome': model.visitorJsonList[0]['VTE_NOME'], 'Start': model.textController1.text, 'End': model.textController2.text, - 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)') - .firstMatch( - model.dropDownValue1.toString()) - ?.group(1) - .toString()) ?? - '', - 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)') - .firstMatch( - model.dropDownValue2.toString()) - ?.group(1) - .toString()) ?? - '', - 'Single Visit': - model.switchValue == true ? 'S' : 'N', - if (model.textController3.text.isNotEmpty) - 'Observation': model.textController3.text, + 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)').firstMatch(model.dropDownValue1.toString())?.group(1).toString()) ?? '', + 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)').firstMatch(model.dropDownValue2.toString())?.group(1).toString()) ?? '', + 'Single Visit': model.switchValue == true ? 'S' : 'N', + if (model.textController3.text.isNotEmpty) 'Observation': model.textController3.text, }, statusHashMap: [ Map.from({