From 8ce59f3f2be9ecfc2832712c5e5b45f2b5464f6c Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 4 Nov 2024 17:30:54 -0300 Subject: [PATCH] =?UTF-8?q?Feat:=20Ajuste=20na=20tela=20de=20home,=20visit?= =?UTF-8?q?a=20provis=C3=B3ria=20e=20visita=20completa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menu_button_item_widget.dart | 46 +- .../menu_card_item/menu_card_item.dart | 33 +- .../local_profile_component_widget.dart | 57 +- .../menu_staggered_view_component_widget.dart | 8 +- .../provisional_shcedule_template_widget.dart | 45 +- lib/flutter_flow/flutter_flow_util.dart | 10 + lib/pages/home_page/home_page_widget.dart | 19 +- .../schedule_complete_visit_page_widget.dart | 2718 +++++++++-------- 8 files changed, 1510 insertions(+), 1426 deletions(-) diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 44724d64..aff8b187 100644 --- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -8,7 +8,6 @@ import 'package:hub/shared/utils/storage_util.dart'; import '../../../shared/extensions/dialog_extensions.dart'; import '../../../shared/services/localization/localization_service.dart'; - class MenuButtonWidget extends MenuEntry { const MenuButtonWidget({ super.key, @@ -32,34 +31,41 @@ class _MenuButtonWidgetState extends State { get action => action; bool _isProcessing = false; - @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 10; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 22 ? 10 : baseFontSize; + return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: _isProcessing ? null : () async { - setState(() { - _isProcessing = true; - }); - await LocalizationService.processLocals(context).then((value) async { - if (value) { - await widget.action?.call(); - } else { - DialogUnavailable.unavailableCredentials(context); - } - }); - setState(() { - _isProcessing = false; - }); - }, + onTap: _isProcessing + ? null + : () async { + setState(() { + _isProcessing = true; + }); + await LocalizationService.processLocals(context) + .then((value) async { + if (value) { + await widget.action?.call(); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); + setState(() { + _isProcessing = false; + }); + }, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), child: Container( - width: 120.0, - height: 100.0, + width: 300, + height: 280, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, boxShadow: [ @@ -107,7 +113,7 @@ class _MenuButtonWidgetState extends State { style: FlutterFlowTheme.of(context).titleLarge.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: limitedFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart index 04398e5c..3f69ba21 100644 --- a/lib/components/atomic_components/menu_card_item/menu_card_item.dart +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -36,21 +36,24 @@ class _MenuCardItemState extends State { focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: _isProcessing ? null : () async { - setState(() { - _isProcessing = true; - }); - await LocalizationService.processLocals(context).then((value) async { - if (value) { - await widget.action?.call(); - } else { - DialogUnavailable.unavailableCredentials(context); - } - }); - setState(() { - _isProcessing = false; - }); - }, + onTap: _isProcessing + ? null + : () async { + setState(() { + _isProcessing = true; + }); + await LocalizationService.processLocals(context) + .then((value) async { + if (value) { + await widget.action?.call(); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); + setState(() { + _isProcessing = false; + }); + }, child: Card( elevation: 0, color: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index e954b417..288d8feb 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -39,8 +39,8 @@ class _LocalProfileComponentWidgetState // // WidgetsBinding.instance // .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null)); - LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null); - + LocalizationService.processLocals(context) + .then((value) => value == true ? onUpdate() : null); } @override @@ -57,10 +57,13 @@ class _LocalProfileComponentWidgetState }); } - - @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 14.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 14.0 ? 9 : scaledFontSize; + return Container( decoration: const BoxDecoration(), child: Align( @@ -90,7 +93,8 @@ class _LocalProfileComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await LocalizationService.selectLocal(context).then((value) => value == true ? onUpdate() : null); + await LocalizationService.selectLocal(context).then( + (value) => value == true ? onUpdate() : null); }, child: ClipRRect( borderRadius: BorderRadius.circular(200.0), @@ -120,23 +124,36 @@ class _LocalProfileComponentWidgetState )), ), ), - Text( - valueOrDefault( - functions.convertToUppercase(_model.cliName), - FFLocalizations.of(context).getVariableText( - ptText: 'SEM LOCAL VINCULADO', - enText: 'NO LINKED LOCAL', + Expanded( + child: Tooltip( + message: valueOrDefault( + functions.convertToUppercase(_model.cliName), + FFLocalizations.of(context).getVariableText( + ptText: 'SEM LOCAL VINCULADO', + enText: 'NO LINKED LOCAL', + ), + ), + child: Text( + valueOrDefault( + functions.convertToUppercase(_model.cliName), + FFLocalizations.of(context).getVariableText( + ptText: 'SEM LOCAL VINCULADO', + enText: 'NO LINKED LOCAL', + ), + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + 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'), + ), ), ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), ), ] .divide(const SizedBox(width: 20.0)) diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index ef9d3f46..e5f916ac 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -52,12 +52,16 @@ class _MenuStaggeredViewComponentWidgetState @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 14 * textScaler.scale(1); + final int crossAxisCount = scaledFontSize > 20 ? 2 : 3; + return Column( children: [ GridView.builder( physics: const NeverScrollableScrollPhysics(), - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: crossAxisCount, crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, childAspectRatio: 1, 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..91a95b09 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 @@ -165,26 +165,31 @@ class _ScheduleProvisionalVisitPageWidgetState memCacheHeight: 35, ), ), - Padding( - 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, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(15.0, 0.0, 0.0, 0.0), + child: Text( + model.cliName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), ), ), ], diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 46f249a2..eab12119 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -193,6 +193,12 @@ Theme wrapInMaterialTimePickerTheme( required double iconSize, }) { final baseTheme = Theme.of(context); + + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 14.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 14.0 ? 8 : scaledFontSize; + return Theme( data: baseTheme.copyWith( focusColor: headerBackgroundColor, @@ -271,6 +277,10 @@ Theme wrapInMaterialTimePickerTheme( dayPeriodBorderSide: BorderSide( color: pickerForegroundColor, ), + dialTextStyle: baseTheme.textTheme.headlineMedium!.copyWith( + color: pickerDialForegroundColor, + fontSize: limitedFontSize, + ), dayPeriodTextColor: WidgetStateColor.resolveWith((states) => states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 93ee9cfd..7b7ca0c3 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,4 +1,3 @@ - import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -20,7 +19,7 @@ class HomePageWidget extends StatefulWidget { State createState() => _HomePageWidgetState(); } -class _HomePageWidgetState extends State { +class _HomePageWidgetState extends State { late HomePageModel _model; final scaffoldKey = GlobalKey(); @@ -30,13 +29,14 @@ class _HomePageWidgetState extends State { _localProfileComponentWidget = LocalProfileComponentWidget(); } - @override void dispose() { - + @override + void dispose() { super.dispose(); _model.dispose(); } - @override void initState() { + @override + void initState() { super.initState(); _model = createModel(context, () => HomePageModel()); @@ -48,9 +48,8 @@ class _HomePageWidgetState extends State { _model.textFieldFocusNode ??= FocusNode(); } - - - @override Widget build(BuildContext context) { + @override + Widget build(BuildContext context) { StorageUtil().context = context; return Scaffold( key: scaffoldKey, @@ -109,10 +108,6 @@ class _HomePageWidgetState extends State { ); } - - - - Container buildPage(BuildContext context) { return Container( decoration: BoxDecoration( 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..613ded1c 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'; @@ -42,6 +41,7 @@ class ScheduleCompleteVisitPageWidget extends ScheduleComplete { class _ScheduleCompleteVisitPageWidgetState extends State with TickerProviderStateMixin { + bool _isLoading = false; late ScheduleCompleteVisitPageModel _model; int _visitHistoryLoadingIdx = 0; final int _visitHistoryLoadingCount = 10; @@ -118,154 +118,423 @@ class _ScheduleCompleteVisitPageWidgetState ), ); } -} -PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - elevation: 0.0, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '61lcxdgm', - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyScheduleCompleteVisit(BuildContext context, - ScheduleCompleteVisitPageModel model, Function safeSetState) { - return SafeArea( - top: true, - child: Column( - children: [ - Align( - alignment: const Alignment(0.0, 0), - child: TabBar( - labelColor: FlutterFlowTheme.of(context).primaryText, - unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, - labelStyle: FlutterFlowTheme.of(context).titleMedium.override( - fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleMediumFamily), - ), - unselectedLabelStyle: const TextStyle(), - indicatorColor: FlutterFlowTheme.of(context).primary, - padding: const EdgeInsets.all(4.0), - tabs: [ - Tab( - text: FFLocalizations.of(context).getText( - 'ueth1f4g', - ), - ), - Tab( - text: FFLocalizations.of(context).getText( - 'k4uraqam', - ), - ), - ], - controller: model.tabBarController, - onTap: (i) async { - [() async {}, () async {}][i](); - }, - ), + PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + elevation: 0.0, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - Expanded( - child: TabBarView( - controller: model.tabBarController, - children: [ - scheduleVisit(context, model, safeSetState), - wrapWithModel( - model: model, - child: const VisitHistoryWidget(), - updateCallback: () { - safeSetState(() {}); - }, - updateOnChange: true), - ], - ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + '61lcxdgm', ), - ], - ), - ); -} + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); + } -Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, - Function safeSetState) { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Form( - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column(mainAxisSize: MainAxisSize.max, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), + Widget bodyScheduleCompleteVisit(BuildContext context, + ScheduleCompleteVisitPageModel model, Function safeSetState) { + return SafeArea( + top: true, + child: Column( + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getText( + 'ueth1f4g', ), ), - 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.textController1, + Tab( + text: FFLocalizations.of(context).getText( + 'k4uraqam', + ), + ), + ], + controller: model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded( + child: TabBarView( + controller: model.tabBarController, + children: [ + scheduleVisit(context, model, safeSetState), + wrapWithModel( + model: model, + child: const VisitHistoryWidget(), + updateCallback: () { + safeSetState(() {}); + }, + updateOnChange: true), + ], + ), + ), + ], + ), + ); + } + + Widget scheduleVisit(BuildContext context, + ScheduleCompleteVisitPageModel model, Function safeSetState) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 12.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 16.0 ? 10 : baseFontSize; + final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80; + + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: scaledSizedBoxSize, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: model.textController1, + readOnly: true, + focusNode: model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + fontSize: limitedFontSize, + ), + 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), + lineHeight: 1.0, + fontSize: limitedFontSize, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: + FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedFontSize, + ), + textAlign: TextAlign.start, + validator: model.textController1Validator + .asValidator(context)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey(FlutterFlowTheme + .of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context).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) { + safeSetState(() { + model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + safeSetState(() { + model.textController1?.text = + dateTimeFormat( + 'dd/MM/yyyy HH:mm:ss', + model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + model.textController1?.selection = + TextSelection.collapsed( + offset: model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: scaledSizedBoxSize, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( readOnly: true, - focusNode: model.textFieldFocusNode1, + controller: model.textController2, + focusNode: model.textFieldFocusNode2, autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, @@ -284,9 +553,10 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedFontSize, ), hintText: FFLocalizations.of(context).getText( - '53cbwqh9', + 'xpgc5e8d', ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -301,6 +571,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .labelMediumFamily), lineHeight: 1.0, + fontSize: limitedFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -348,74 +619,29 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .bodyMediumFamily), lineHeight: 1.8, + fontSize: limitedFontSize, ), textAlign: TextAlign.start, - validator: model.textController1Validator - .asValidator(context)), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked1Date = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context).primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = await showTimePicker( + validator: model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = await showDatePicker( context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), builder: (context, child) { - return wrapInMaterialTimePickerTheme( + return wrapInMaterialDatePickerTheme( context, child!, headerBackgroundColor: @@ -430,7 +656,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, fontFamily: FlutterFlowTheme.of(context) .headlineLargeFamily, - fontSize: 32.0, + fontSize: limitedFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts @@ -444,15 +670,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .primaryBackground, pickerForegroundColor: - FlutterFlowTheme.of(context).info, + FlutterFlowTheme.of(context) + .primaryText, selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context) .primary, selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, - pickerDialForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, actionButtonForegroundColor: FlutterFlowTheme.of(context) .primaryText, @@ -460,531 +684,655 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, ); }, ); - } - if (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - safeSetState(() { - model.textController1?.text = dateTimeFormat( - 'dd/MM/yyyy HH:mm:ss', - model.datePicked1, - locale: FFLocalizations.of(context) - .languageCode, - ); - model.textController1?.selection = - TextSelection.collapsed( - offset: model - .textController1!.text.length); - }); - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - 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( - readOnly: true, - controller: model.textController2, - focusNode: model.textFieldFocusNode2, - 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( + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'xpgc5e8d', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: 1.8, - ), - textAlign: TextAlign.start, - validator: model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked2Date = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context).primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = await showTimePicker( - context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context).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) { - safeSetState(() { - model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - safeSetState(() { - model.textController2?.text = dateTimeFormat( - 'dd/MM/yyyy HH:mm:ss', - model.datePicked2, - locale: FFLocalizations.of(context) - .languageCode, - ); - model.textController2?.selection = - TextSelection.collapsed( - offset: model - .textController2!.text.length); - }); - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ], - ), - ]), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return Padding( - padding: - const EdgeInsets.symmetric(horizontal: 30), - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${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), - child: Text( - getJsonField(visitorListViewItem, - r'''$.VTE_NOME''') - .toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), + .containsKey(FlutterFlowTheme + .of(context) + .headlineLargeFamily), ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - IconButton( - onPressed: () async { - safeSetState(() { - model.removeFromVisitorJsonList( - visitorListViewItem); - if (model.visitorJsonList.isEmpty) { - model.visitorStrList = ''; - } - }); + 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, + ); }, - icon: const Icon(Icons.close), - ), - ], + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + safeSetState(() { + model.textController2?.text = + dateTimeFormat( + 'dd/MM/yyyy HH:mm:ss', + model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + model.textController2?.selection = + TextSelection.collapsed( + offset: model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), ), ), - ); - }, - ); - }, + ), + ], + ), + ), + ], + ), + ]), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.7, - width: MediaQuery.of(context).size.width, - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - safeSetState(() {}); - }, - getDocs: (docsParam) async { - model.visitorStrList = strListToStr( - docsParam!.toList()); - safeSetState(() {}); - }, + if (model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return Padding( + padding: + const EdgeInsets.symmetric(horizontal: 30), + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", + fit: BoxFit.cover, ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), + Expanded( + child: Padding( + 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, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + overflow: TextOverflow.ellipsis, + ), + ), + ), + IconButton( + onPressed: () async { + safeSetState(() { + model.removeFromVisitorJsonList( + visitorListViewItem); + if (model.visitorJsonList.isEmpty) { + model.visitorStrList = ''; + } + }); + }, + icon: const Icon(Icons.close), + ), + ], ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 1.0, + ), + ); + }, + ); + }, + ), + Stack( + children: [ + GestureDetector( + onTap: () async { + safeSetState(() { + _isLoading = true; + }); + + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + model.visitorJsonList = visitorsParam! + .toList() + .cast(); + safeSetState(() {}); + }, + getDocs: (docsParam) async { + model.visitorStrList = + strListToStr(docsParam!.toList()); + safeSetState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() { + _isLoading = false; + })); + }, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + border: Border.all( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _isLoading + ? SizedBox( + width: 30.0, + height: 30.0, + child: CircularProgressIndicator( + valueColor: + AlwaysStoppedAnimation( + FlutterFlowTheme.of(context) + .primary, + ), + ), + ) + : Icon( + Icons.add, + color: FlutterFlowTheme.of(context) + .primary, + size: 30.0, + ), + Padding( + 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, + fontSize: limitedFontSize, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + ), + ) + ], ), - borderRadius: BorderRadius.circular(8.0), ), ), ), + ], + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz', + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call(), + builder: (context, snapshot) { + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + + 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, + options: model.reasonsDropDown1, + optionLabels: reasonsOptionLabels, + onChanged: (val) => safeSetState( + () => model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr', + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context) + .accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), ), + ), + ), + ], + ), + if (model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call(), + builder: (context, snapshot) { + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + + final lavelsJsonList = + PhpGroup.getDadosCall.levelJsonList( + snapshot.data!.jsonBody); + final lavelsOptionLabels = PhpGroup + .getDadosCall + .levelNACDescricaoStrList( + snapshot.data!.jsonBody); + model.processDropDown2(lavelsJsonList!); + + return FlutterFlowDropDown( + controller: + model.dropDownValueController2, + options: model.lavelsDropDown2, + optionLabels: lavelsOptionLabels, + onChanged: (val) => safeSetState( + () => model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c', + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context) + .accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (model.dropDownValue2 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht', + ), + textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( @@ -994,662 +1342,358 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, ), ), ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Column( - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 45.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call(), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - - 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, - options: model.reasonsDropDown1, - optionLabels: reasonsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr', - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - if (model.dropDownValue1 == '') - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), - ), - ], - ), - ], - ), - Column( - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 45.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call(), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - - final lavelsJsonList = PhpGroup.getDadosCall - .levelJsonList(snapshot.data!.jsonBody); - final lavelsOptionLabels = PhpGroup - .getDadosCall - .levelNACDescricaoStrList( - snapshot.data!.jsonBody); - model.processDropDown2(lavelsJsonList!); - - return FlutterFlowDropDown( - controller: - model.dropDownValueController2, - options: model.lavelsDropDown2, - optionLabels: lavelsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c', - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - if (model.dropDownValue2 == '') - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), - ), - ], - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch( - value: model.switchValue!, - onChanged: (newValue) async { - safeSetState(() => model.switchValue = newValue); - }, - focusColor: FlutterFlowTheme.of(context).primary, - trackColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { + Switch( + value: model.switchValue!, + onChanged: (newValue) async { + safeSetState(() => model.switchValue = newValue); + }, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } return FlutterFlowTheme.of(context).alternate; - } - return FlutterFlowTheme.of(context).alternate; - }, + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, ), - hoverColor: - FlutterFlowTheme.of(context).primaryBackground, - overlayColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context).accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - trackOutlineColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context).accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - activeColor: FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], + ], + ), ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 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, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: model.textController3, + focusNode: model.textFieldFocusNode3, + autofocus: false, + cursorColor: FlutterFlowTheme.of(context).primary, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of(context).accent1, ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: model.textController3, - focusNode: model.textFieldFocusNode3, - autofocus: false, - cursorColor: FlutterFlowTheme.of(context).primary, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup', ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium + style: FlutterFlowTheme.of(context) + .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, + .bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) - .labelMediumFamily), + .bodyMediumFamily), ), - hintText: FFLocalizations.of(context).getText( - 'w18iztdm', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of(context).accent1, - ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: model.textController3Validator + .asValidator(context), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: - model.textController3Validator.asValidator(context), ), ), - ), - ], - ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], + ), ), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Schedule', - ptText: 'Agendar', - ), - onPressed: model.isValid() - ? () async { - 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, - ) - .catchError((e) async => await DialogUtil.errorDefault(context)) - .then((value) async { - if (PhpGroup.postScheduleVisitCall.error( - (value.jsonBody ?? ''), - ) == - false) { - context.pop(); + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), + onPressed: model.isValid() + ? () async { + 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, + ) + .catchError((e) async => + await DialogUtil.errorDefault(context)) + .then((value) async { + if (PhpGroup.postScheduleVisitCall.error( + (value.jsonBody ?? ''), + ) == + false) { + context.pop(); - model.dropDownValue1 = null; - model.dropDownValue2 = null; - model.dropDownValueController1 = - FormFieldController(''); - model.dropDownValueController2 = - FormFieldController(''); - model.visitorStrList = ''; - model.visitorJsonList = []; + model.dropDownValue1 = null; + model.dropDownValue2 = null; + 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 { - final message = value.jsonBody['error_msg']; - await DialogUtil.error(context, message); - context.pop(); - } - }); + await ShareUtil.showShare(value.jsonBody); + } else { + final message = value.jsonBody['error_msg']; + await DialogUtil.error(context, message); + context.pop(); + } + }); - safeSetState(() {}); - } + safeSetState(() {}); + } - if (model.visitorJsonList.length > 1) { - final title = FFLocalizations.of(context).getVariableText( - ptText: 'Cadastrar Múltiplos Visitantes', - 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?', - ); + if (model.visitorJsonList.length > 1) { + final title = FFLocalizations.of(context).getVariableText( + ptText: 'Cadastrar Múltiplos Visitantes', + 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?', + ); - showAlertDialog(context, title, content, scheduleVisit); - } else { - await showDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Dialog( - alignment: Alignment.topCenter, - child: SizedBox( - child: DetailsComponentWidget( - buttons: [ - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'Done', - ptText: 'Confirmar', - ), - icon: const Icon(Icons.done), - onPressed: scheduleVisit, - options: FFButtonOptions( - width: 130, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + showAlertDialog(context, title, content, scheduleVisit); + } else { + await showDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + child: DetailsComponentWidget( + buttons: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Done', + ptText: 'Confirmar', ), - borderSide: BorderSide( + icon: const Icon(Icons.done), + onPressed: scheduleVisit, + options: FFButtonOptions( + width: 130, + height: 40, color: FlutterFlowTheme.of(context) .primaryBackground, - width: 1, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + 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', - 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, - }, - statusHashMap: [ - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Inativo', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).success, - }), - ], - onTapCardItemAction: () async {}, + ], + 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, + }, + statusHashMap: [ + Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).success, + }), + ], + onTapCardItemAction: () async {}, + ), ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); + ); + }, + ).then((value) => safeSetState(() {})); + } } - } - : null, - options: FFButtonOptions( - height: MediaQuery.of(context).size.height * 0.05, - width: MediaQuery.of(context).size.height * 0.2, - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - disabledColor: FlutterFlowTheme.of(context).customColor5), - showLoadingIndicator: true, - ), - ].addToEnd(const SizedBox(height: 30.0)), - ), - ); + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), + ].addToEnd(const SizedBox(height: 30.0)), + ), + ); + } }