diff --git a/lib/components/atomic_components/shared_components_atoms/custom_input.dart b/lib/components/atomic_components/shared_components_atoms/custom_input.dart index 50f26559..51d0fbad 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_input.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_input.dart @@ -145,6 +145,7 @@ class _CustomInputUtilState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), + fontSize: limitedInputTextSize, ), maxLines: null, maxLength: widget.haveMaxLength ? widget.maxLength : null, diff --git a/lib/components/atomic_components/shared_components_atoms/toast.dart b/lib/components/atomic_components/shared_components_atoms/toast.dart index aad47149..1be2a15e 100644 --- a/lib/components/atomic_components/shared_components_atoms/toast.dart +++ b/lib/components/atomic_components/shared_components_atoms/toast.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class ToastUtil { static void showToast({ @@ -8,7 +9,7 @@ class ToastUtil { Toast toastLength = Toast.LENGTH_SHORT, Color backgroundColor = Colors.black, Color textColor = Colors.white, - double fontSize = 16.0, + double fontSize = 16, }) { Fluttertoast.showToast( msg: message, diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index 8712ddd3..6ee4b9ee 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -6,6 +6,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import '../../../shared/services/authentication/authentication_service.dart'; @@ -52,7 +53,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State e).toList(); - final doc = _model.docs.map((e) => e).toList(); - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - final docItem = doc[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(40.0), - 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( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(), - 'NOT FOUND', - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyLargeFamily), - fontSize: limitedBodyFontSize, - ), - ), - ), - ], - ), - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon(Icons.close, - color: FlutterFlowTheme.of(context).customColor6, size: 20.0), - onPressed: () async { - _model.removeFromVisitors(visitorItem); - _model.removeFromDocs(docItem); - safeSetState(() {}); - }, - ), - ], - ), - ), - ), - ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground), - ); - } - }, - ), + keyboardType: const TextInputType.numberWithOptions(signed: true), + validator: _model.textControllerValidator.asValidator(context), + inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))], ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.isNotEmpty) Row( - mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, children: [ - FFButtonWidget( - onPressed: MediaQuery.of(context).viewInsets.bottom > 0 - ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) - : () async => await sendVisitors(context), - text: MediaQuery.of(context).viewInsets.bottom > 0 - ? FFLocalizations.of(context).getVariableText( - enText: 'Add', - ptText: 'Adicionar', - ) - : FFLocalizations.of(context).getVariableText( - enText: 'Submit', - ptText: 'Enviar', - ), - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.4, - height: 40, - 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, - color: Colors.white, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText('9coywebh'), + style: 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).titleSmallFamily), - fontSize: limitedInputFontSize, + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedHeaderFontSize, + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), + child: Text( + _model.visitors.length.toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedHeaderFontSize, ), - elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15), - bottomRight: Radius.circular(15), - topLeft: Radius.circular(15), - topRight: Radius.circular(15)), ), ), ], ), - const SizedBox(height: 30.0) - ], - ), + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = _model.visitors.map((e) => e).toList(); + final doc = _model.docs.map((e) => e).toList(); + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + final docItem = doc[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(40.0), + 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( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(), + 'NOT FOUND', + ), + style: FlutterFlowTheme.of(context).bodyLarge.override( + fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyLargeFamily), + fontSize: limitedBodyFontSize, + ), + ), + ), + ], + ), + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon(Icons.close, + color: FlutterFlowTheme.of(context).customColor6, size: 20.0), + onPressed: () async { + _model.removeFromVisitors(visitorItem); + _model.removeFromDocs(docItem); + safeSetState(() {}); + }, + ), + ], + ), + ), + ), + ), + ); + }, + ); + }, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground), + ); + } + }, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: MediaQuery.of(context).viewInsets.bottom > 0 + ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) + : () async => await sendVisitors(context), + text: MediaQuery.of(context).viewInsets.bottom > 0 + ? FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ) + : FFLocalizations.of(context).getVariableText( + enText: 'Submit', + ptText: 'Enviar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.4, + height: 40, + 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, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + fontSize: limitedInputFontSize, + ), + elevation: 3.0, + borderSide: const BorderSide(color: Colors.transparent, width: 1.0), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15)), + ), + ), + ], + ), + const SizedBox(height: 30.0) + ], ), ); } @@ -381,7 +372,9 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle(color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context),), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index edaeae1b..89847e87 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -347,6 +348,10 @@ class _LiberationHistoryWidgetState extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 2d5a19bc..345842d5 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -275,6 +275,10 @@ class _MessageHistoryPageWidgetState extends State wit SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 7d457847..4f42294b 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -80,6 +80,10 @@ class _PackageOrderPage extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/pets_page/pets_history_screen.dart b/lib/pages/pets_page/pets_history_screen.dart index 4982a515..bcd69dfc 100644 --- a/lib/pages/pets_page/pets_history_screen.dart +++ b/lib/pages/pets_page/pets_history_screen.dart @@ -105,6 +105,10 @@ class _PetsHistoryScreenState extends State with TickerProvid SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color :Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, 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 678724cc..6777162f 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 @@ -906,8 +906,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State with TickerProv SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/shared/utils/snackbar_util.dart b/lib/shared/utils/snackbar_util.dart index 27150db6..21c43566 100644 --- a/lib/shared/utils/snackbar_util.dart +++ b/lib/shared/utils/snackbar_util.dart @@ -1,14 +1,17 @@ import 'package:flutter/material.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '../../flutter_flow/flutter_flow_theme.dart'; class SnackBarUtil { static void showSnackBar(BuildContext context, String text, {bool isError = false}) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( text, - style: TextStyle(color: FlutterFlowTheme.of(context).info), + overflow: TextOverflow.clip, + style: TextStyle(color: FlutterFlowTheme.of(context).info, fontSize: limitedBodyFontSize), ), backgroundColor: isError ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success, duration: const Duration(seconds: 3),