Feat: Finalizada a tela de visita completa e de encomendas

This commit is contained in:
Lucas 2024-11-05 17:30:03 -03:00
parent 8ce59f3f2b
commit f543a200f1
14 changed files with 396 additions and 277 deletions

View File

@ -34,9 +34,9 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
@override
Widget build(BuildContext context) {
final textScaler = MediaQuery.textScalerOf(context);
final double baseFontSize = 10;
final double baseFontSize = 14;
final double scaledFontSize = baseFontSize * textScaler.scale(1);
final double limitedFontSize = scaledFontSize > 22 ? 10 : baseFontSize;
final double limitedFontSize = scaledFontSize > 24 ? 12 : baseFontSize;
return InkWell(
splashColor: Colors.transparent,

View File

@ -6,6 +6,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
// ignore: unused_import
import 'package:hub/shared/helpers/secure_storage_helper.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:hub/shared/utils/storage_util.dart';
class OrderFilterModalWidget extends StatefulWidget {
@ -226,8 +227,8 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
mainAxisSize: MainAxisSize.min,
children: [
_buildCheckboxListTile(
'adresseeType', adresseeTypeOptions, 14),
_buildCheckboxListTile('status', statusOptions, 14),
'adresseeType', adresseeTypeOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)),
_buildCheckboxListTile('status', statusOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)),
],
),
),
@ -239,7 +240,7 @@ class _OrderFilterModalWidgetState extends State<OrderFilterModalWidget> {
foregroundColor: FlutterFlowTheme.of(context).info,
backgroundColor: FlutterFlowTheme.of(context).primary,
),
child: Text(FFLocalizations.of(context).getText('88kshkph')),
child: Text(FFLocalizations.of(context).getText('88kshkph'), style: TextStyle(fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10))),
),
],
),

View File

@ -62,7 +62,7 @@ class _LocalProfileComponentWidgetState
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;
final double limitedFontSize = scaledFontSize > 20 ? 12 : scaledFontSize;
return Container(
decoration: const BoxDecoration(),

View File

@ -54,7 +54,7 @@ class _MenuStaggeredViewComponentWidgetState
Widget build(BuildContext context) {
final textScaler = MediaQuery.textScalerOf(context);
final double scaledFontSize = 14 * textScaler.scale(1);
final int crossAxisCount = scaledFontSize > 20 ? 2 : 3;
final int crossAxisCount = scaledFontSize >= 26 ? 1 : scaledFontSize >= 18 ? 2 : 3;
return Column(
children: [

View File

@ -3,6 +3,7 @@ import 'dart:collection';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
@ -56,6 +57,8 @@ class _CardItemTemplateComponentWidgetState
}
List<Widget> _generateLabels() {
double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 10);
return labelsLinkedHashMap.entries.map((entry) {
final key = entry.key;
final text = entry.value.toString();
@ -73,6 +76,7 @@ class _CardItemTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedTextSize,
),
),
const SizedBox(width: 8),
@ -82,7 +86,7 @@ class _CardItemTemplateComponentWidgetState
overflow: TextOverflow.ellipsis,
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 12.5,
fontSize: limitedTextSize,
letterSpacing: 0.0,
fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey(
@ -125,21 +129,24 @@ class _CardItemTemplateComponentWidgetState
final text = entry.key;
final color = entry.value;
return Container(
padding: const EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.25,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(5),
),
child: Center(
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: FlutterFlowTheme.of(context).info,
fontSize: 12,
fontWeight: FontWeight.bold,
return Tooltip(
message: text,
child: Container(
padding: const EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.25,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(5),
),
child: Center(
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: FlutterFlowTheme.of(context).info,
fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12, 22, 10),
fontWeight: FontWeight.bold,
),
),
),
),

View File

@ -6,6 +6,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/templates_components/details_component/details_component_model.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
class DetailsComponentWidget extends StatefulWidget {
@ -62,7 +63,12 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
@override
Widget build(BuildContext context) {
// CachedNetworkImage.evictFromCache(widget.imagePath ?? '');
final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize(
context,
12.0,
16.0,
10.0,
);
return Container(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width,
@ -132,7 +138,9 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.labelMediumFamily,
),
fontSize: limitedFontSize,
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
@ -145,6 +153,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
FlutterFlowTheme.of(context)
.labelMediumFamily,
),
fontSize: limitedFontSize,
),
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
@ -162,6 +171,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily,
),
fontSize: limitedFontSize,
),
textAlign: TextAlign.start,
maxLines: null,
@ -186,6 +196,7 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
return TextFormField(
readOnly: true,
initialValue: '$value',
style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
@ -194,8 +205,11 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily,
),
fontSize: limitedFontSize,
),
decoration: InputDecoration(
labelText: key,
filled: true,
fillColor: FlutterFlowTheme.of(context).primaryBackground,
@ -216,7 +230,9 @@ class _DetailsComponentWidgetState extends State<DetailsComponentWidget> {
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily,
),
),
hintStyle: FlutterFlowTheme.of(context)
.labelMedium
.override(

View File

@ -14,6 +14,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
class VisitorSearchModalTemplateComponentWidget extends StatefulWidget {
const VisitorSearchModalTemplateComponentWidget({
@ -59,6 +60,19 @@ class _VisitorSearchModalTemplateComponentWidgetState
@override
Widget build(BuildContext context) {
final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize(
context,
12,
16,
10
);
final double limitedHeaderFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize(
context,
14,
16,
12
);
return Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
child: Container(
@ -99,8 +113,9 @@ class _VisitorSearchModalTemplateComponentWidgetState
obscureText: false,
decoration: InputDecoration(
isDense: true,
labelText: FFLocalizations.of(context).getText(
'cjlpru1m' /* Procure pelo documento do visi... */,
labelText: FFLocalizations.of(context).getVariableText(
enText: 'Document of the Visitor',
ptText: 'Documento do Visitante',
),
labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily:
@ -109,6 +124,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedFontSize,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
@ -170,6 +186,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedFontSize,
),
keyboardType:
const TextInputType.numberWithOptions(signed: true),
@ -198,6 +215,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedHeaderFontSize,
),
),
),
@ -212,6 +230,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedHeaderFontSize,
),
),
),
@ -311,6 +330,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
FlutterFlowTheme.of(
context)
.bodyLargeFamily),
fontSize: limitedFontSize,
),
),
),
@ -382,8 +402,8 @@ class _VisitorSearchModalTemplateComponentWidgetState
ptText: 'Enviar',
),
options: FFButtonOptions(
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.width * 0.1,
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(
@ -396,6 +416,7 @@ class _VisitorSearchModalTemplateComponentWidgetState
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).titleSmallFamily),
fontSize: limitedFontSize,
),
elevation: 3.0,
borderSide: const BorderSide(

View File

@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
import 'package:hub/flutter_flow/internationalization.dart';
import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:intl/intl.dart';
import 'package:json_path/json_path.dart';
import 'package:timeago/timeago.dart' as timeago;
@ -565,13 +566,19 @@ void showSnackbar(
void showAlertDialog(BuildContext context, String title, String content,
Future<void> Function() action) {
double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 20, 12);
double limitedHeaderSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 28, 18);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
title: Text(title),
content: Text(content),
title: Text(title, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderSize), textAlign: TextAlign.center),
content: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(content, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedTextSize)),
),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -581,15 +588,17 @@ void showAlertDialog(BuildContext context, String title, String content,
onPressed: () => context.pop(), //Navigator.pop(context),
options: FFButtonOptions(
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.height * 0.05,
height: 50,
color: FlutterFlowTheme.of(context).primaryBackground,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedTextSize
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primaryBackground,
width: 1,
),
splashColor: const Color.fromARGB(255, 129, 129, 129),
borderRadius: BorderRadius.circular(10),
elevation: 0,
),
@ -604,12 +613,14 @@ void showAlertDialog(BuildContext context, String title, String content,
},
options: FFButtonOptions(
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.height * 0.05,
height: 50,
color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 0,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedTextSize
),
splashColor: const Color.fromARGB(255, 129, 129, 129),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primaryBackground,
width: 1,

View File

@ -97,13 +97,14 @@ class _FFButtonWidgetState extends State<FFButtonWidget> {
),
),
)
: AutoSizeText(
: Text(
text ?? '',
style:
text == null ? null : widget.options.textStyle?.withoutColor(),
textAlign: widget.options.textAlign,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
);
final onPressed = widget.onPressed != null

View File

@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.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/storage_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
@ -178,6 +179,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
defaultStatus:
_selectedTypeSubject.value['status'] ??
'.*',
),
),
),
@ -264,6 +266,11 @@ class _PackageOrderPage extends State<PackageOrderPage> {
FFLocalizations.of(context).getVariableText(
ptText: "Nenhuma encomenda encontrada!",
enText: "No orders found!"),
style: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(
context, 14, 24, 12),
),
)),
],
),

View File

@ -9,6 +9,7 @@ import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/flutter_flow/request_manager.dart';
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
import 'package:hub/shared/mixins/status_mixin.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:hub/shared/utils/storage_util.dart';
import 'package:share_plus/share_plus.dart';
@ -441,6 +442,7 @@ class ScheduleCompleteVisitPageModel
ptText: 'Cancelar',
enText: 'Cancel',
),
icon: const Icon(Icons.close),
onPressed: () async {
showAlertDialog(
@ -498,17 +500,19 @@ class ScheduleCompleteVisitPageModel
});
},
options: FFButtonOptions(
width: 130,
width: MediaQuery.of(context).size.width * 0.3,
height: 40,
color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 0,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14),
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primaryBackground,
width: 1,
),
splashColor: const Color.fromARGB(132, 255, 17, 0),
// borderRadius: 12,
),
),
@ -532,17 +536,19 @@ class ScheduleCompleteVisitPageModel
switchTab(0);
},
options: FFButtonOptions(
width: 130,
width: MediaQuery.of(context).size.width * 0.5,
height: 40,
color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 0,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14),
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primaryBackground,
width: 1,
),
splashColor: const Color.fromARGB(137, 134, 134, 134),
// borderRadius: 12,
),
),
@ -566,17 +572,19 @@ URL do Convite: https://visita.freaccess.com.br/${item['VAW_ID']}/$cliUUID/${ite
''');
},
options: FFButtonOptions(
width: 130,
width: MediaQuery.of(context).size.width * 0.3,
height: 40,
color: FlutterFlowTheme.of(context).primaryBackground,
elevation: 0,
textStyle: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14),
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primaryBackground,
width: 1,
),
splashColor: const Color.fromARGB(136, 97, 160, 255),
// borderRadius: 12,
),
),

View File

@ -19,6 +19,7 @@ import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart';
import 'package:hub/pages/schedule_complete_visit_page/visit_history_page_widget.dart';
import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:hub/shared/utils/share_util.dart';
class ScheduleComplete extends StatefulWidget {
@ -170,10 +171,12 @@ class _ScheduleCompleteVisitPageWidgetState
unselectedLabelColor: FlutterFlowTheme.of(context).primaryText,
labelStyle: FlutterFlowTheme.of(context).titleMedium.override(
fontFamily: FlutterFlowTheme.of(context).titleMediumFamily,
fontSize: 13.0,
fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(
context, 12.0, 16.0, 10.0),
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).titleMediumFamily),
),
unselectedLabelStyle: const TextStyle(),
indicatorColor: FlutterFlowTheme.of(context).primary,
@ -259,115 +262,112 @@ class _ScheduleCompleteVisitPageWidgetState
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width * 0.85,
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
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)
.bodyMediumFamily,
fontFamily:
FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
lineHeight: 1.8,
.labelMediumFamily),
fontSize: limitedFontSize,
),
textAlign: TextAlign.start,
validator: model.textController1Validator
.asValidator(context)),
),
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),
@ -522,109 +522,106 @@ class _ScheduleCompleteVisitPageWidgetState
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width * 0.85,
height: scaledSizedBoxSize,
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(
FlutterFlowTheme.of(context)
.labelMediumFamily),
fontSize: limitedFontSize,
),
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,
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
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)
.bodyMediumFamily,
.labelMediumFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
lineHeight: 1.8,
.labelMediumFamily),
fontSize: limitedFontSize,
),
textAlign: TextAlign.start,
validator: model.textController2Validator
.asValidator(context),
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,
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.textController2Validator
.asValidator(context),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
@ -1057,8 +1054,8 @@ class _ScheduleCompleteVisitPageWidgetState
padding: const EdgeInsetsDirectional.fromSTEB(
24.0, 0.0, 24.0, 0.0),
child: Container(
width: 100.0,
height: 45.0,
width: MediaQuery.of(context).size.width * 0.8,
height: scaledSizedBoxSize *0.5,
decoration: const BoxDecoration(),
child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getDadosCall.call(),
@ -1112,11 +1109,12 @@ class _ScheduleCompleteVisitPageWidgetState
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
fontSize: limitedFontSize,
),
hintText:
FFLocalizations.of(context).getText(
'6p3e0bzr',
FFLocalizations.of(context).getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita'
),
icon: Icon(
Icons.keyboard_arrow_down_rounded,
color: FlutterFlowTheme.of(context)
@ -1148,18 +1146,22 @@ class _ScheduleCompleteVisitPageWidgetState
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)),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 30.0, vertical: 5.0),
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Select a reason for the visit',
ptText: 'Selecione um motivo da visita',
),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: FlutterFlowTheme.of(context)
.customColor6,
fontSize: limitedFontSize)),
),
),
],
),
@ -1176,7 +1178,7 @@ class _ScheduleCompleteVisitPageWidgetState
24.0, 0.0, 24.0, 0.0),
child: Container(
width: 100.0,
height: 45.0,
height: scaledSizedBoxSize *0.5,
decoration: const BoxDecoration(),
child: FutureBuilder<ApiCallResponse>(
future: PhpGroup.getDadosCall.call(),
@ -1227,10 +1229,12 @@ class _ScheduleCompleteVisitPageWidgetState
FlutterFlowTheme.of(
context)
.bodyMediumFamily),
fontSize: limitedFontSize,
),
hintText:
FFLocalizations.of(context).getText(
'2wun8p6c',
FFLocalizations.of(context).getVariableText(
enText: 'Level of access',
ptText: 'Nível de acesso',
),
icon: Icon(
Icons.keyboard_arrow_down_rounded,
@ -1265,18 +1269,22 @@ class _ScheduleCompleteVisitPageWidgetState
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)),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 30.0, vertical: 5.0),
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'Select a level of access',
ptText: 'Selecione um nível de acesso',
),
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
color: FlutterFlowTheme.of(context)
.customColor6,
fontSize: limitedFontSize)),
),
),
],
),
@ -1316,30 +1324,27 @@ class _ScheduleCompleteVisitPageWidgetState
30.0, 0.0, 30.0, 20.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
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),
),
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),
fontSize: limitedFontSize,
),
),
),
Switch(
@ -1444,6 +1449,7 @@ class _ScheduleCompleteVisitPageWidgetState
useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context)
.labelMediumFamily),
fontSize: limitedFontSize,
),
hintText: FFLocalizations.of(context).getText(
'w18iztdm',
@ -1459,6 +1465,7 @@ class _ScheduleCompleteVisitPageWidgetState
useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context)
.labelMediumFamily),
fontSize: limitedFontSize,
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
@ -1503,6 +1510,7 @@ class _ScheduleCompleteVisitPageWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
fontSize: limitedFontSize,
),
textAlign: TextAlign.start,
maxLines: null,
@ -1527,6 +1535,7 @@ class _ScheduleCompleteVisitPageWidgetState
enText: 'Schedule',
ptText: 'Agendar',
),
onPressed: model.isValid()
? () async {
Future<void> scheduleVisit() async {
@ -1625,6 +1634,7 @@ class _ScheduleCompleteVisitPageWidgetState
textStyle: TextStyle(
color: FlutterFlowTheme.of(context)
.primaryText,
fontSize: 16/ MediaQuery.textScalerOf(context).scale(1),
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context)
@ -1680,9 +1690,15 @@ class _ScheduleCompleteVisitPageWidgetState
}
: null,
options: FFButtonOptions(
height: MediaQuery.of(context).size.height * 0.05,
width: MediaQuery.of(context).size.height * 0.2,
height: 40,
width: MediaQuery.of(context).size.width * 0.5,
color: FlutterFlowTheme.of(context).primary,
textStyle: FlutterFlowTheme.of(context).subtitle2.override(
fontFamily: 'Nunito',
color: FlutterFlowTheme.of(context).primaryBackground,
fontSize: 18.0 / MediaQuery.textScalerOf(context).scale(1),
fontWeight: FontWeight.w500,
),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(15.0),
bottomRight: Radius.circular(15.0),

View File

@ -7,6 +7,7 @@ import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_p
import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart';
import 'package:hub/shared/mixins/status_mixin.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/storage_util.dart';
import 'package:hub/shared/utils/validator_util.dart';
@ -127,6 +128,9 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
@override
Widget build(BuildContext context) {
double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 12);
return Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
@ -140,7 +144,13 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget>
Center(
child: Text(FFLocalizations.of(context).getVariableText(
ptText: "Nenhuma visita encontrada!",
enText: "No visit found")),
enText: "No visit found"),
style: TextStyle(
color: FlutterFlowTheme.of(context).primaryText,
fontSize: limitedTextSize,
fontWeight: FontWeight.bold
)
),
)
],
),

View File

@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
class LimitedTextSizeUtil {
static double getLimitedBodyFontSize(BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) {
final textScaler = MediaQuery.textScalerOf(context);
final double scaledFontSize = baseFontSize * textScaler.scale(1);
return scaledFontSize > maxFontSize ? limitedFontSize : scaledFontSize;
}
static double getNoResizeFont(BuildContext context, double baseFontSize) {
final textScaler = MediaQuery.textScalerOf(context);
final double noscaledFontSize = baseFontSize / textScaler.scale(1);
return noscaledFontSize;
}
static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) {
final textScaler = MediaQuery.textScalerOf(context);
final double scaledFontSize = baseFontSize * textScaler.scale(1);
return scaledFontSize > maxFontSize ? sizeIfExceeded : sizeIfNotExceeded;
}
}