feat: Ajuste na tela de Registro de Visitante e de QRCode

This commit is contained in:
Lucas 2024-11-06 17:27:02 -03:00
parent f543a200f1
commit a58f535d6d
5 changed files with 280 additions and 237 deletions

View File

@ -1,4 +1,5 @@
import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_util.dart';
@ -52,13 +53,16 @@ class _QrCodePassKeyTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 1.0), alignment: const AlignmentDirectional(0.0, 1.0),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: 300.0, height: LimitedTextSizeUtil.getScaledSizedBoxSize(context, 300, 570, 500, 300),
constraints: const BoxConstraints( constraints: const BoxConstraints(
minHeight: 300.0,
maxWidth: 570.0, maxWidth: 570.0,
maxHeight: 500,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context).primaryBackground, color: FlutterFlowTheme.of(context).primaryBackground,
@ -69,104 +73,103 @@ class _QrCodePassKeyTemplateComponentWidgetState
topRight: Radius.circular(15.0), topRight: Radius.circular(15.0),
), ),
), ),
child: Column( child: SingleChildScrollView(
mainAxisSize: MainAxisSize.max, child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
// This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. children: [
if (responsiveVisibility( // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well.
context: context, if (responsiveVisibility(
phone: false, context: context,
tablet: false, phone: false,
)) tablet: false,
Padding( ))
padding: Padding(
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), padding:
child: InkWell( const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
splashColor: Colors.transparent, child: InkWell(
focusColor: Colors.transparent, splashColor: Colors.transparent,
hoverColor: Colors.transparent, focusColor: Colors.transparent,
highlightColor: Colors.transparent, hoverColor: Colors.transparent,
onTap: () async { highlightColor: Colors.transparent,
context.safePop(); onTap: () async {
}, context.safePop();
child: Row( },
mainAxisSize: MainAxisSize.max, child: Row(
children: [ mainAxisSize: MainAxisSize.max,
const Padding( children: [
padding: EdgeInsetsDirectional.fromSTEB( const Padding(
0.0, 12.0, 0.0, 12.0), padding: EdgeInsetsDirectional.fromSTEB(
child: Icon( 0.0, 12.0, 0.0, 12.0),
Icons.arrow_back_rounded, child: Icon(
color: Color(0xFF15161E), Icons.arrow_back_rounded,
size: 24.0, color: Color(0xFF15161E),
size: 24.0,
),
), ),
), Padding(
Padding( padding: const EdgeInsetsDirectional.fromSTEB(
padding: const EdgeInsetsDirectional.fromSTEB( 12.0, 0.0, 0.0, 0.0),
12.0, 0.0, 0.0, 0.0), child: Text(
child: Text( '',
'', style:
style: FlutterFlowTheme.of(context).bodyMedium.override(
FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans',
fontFamily: 'Plus Jakarta Sans', color: const Color(0xFF15161E),
color: const Color(0xFF15161E), fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 16, 30, 14),
fontSize: 14.0, letterSpacing: 0.0,
letterSpacing: 0.0, fontWeight: FontWeight.w500,
fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap()
useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'),
.containsKey('Plus Jakarta Sans'), ),
), ),
), ),
), ],
], ),
), ),
), ),
), Padding(
Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text(
FFLocalizations.of(context).getText(
'h1xilful' /* DIGITE A SUA SENHA */,
),
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 24.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
),
),
),
Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text(
FFLocalizations.of(context).getText(
'ujodm2ci' /* Para gerar o QR Code digite a ... */,
),
style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
Form(
key: _model.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: Padding(
padding: padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 0.0, 0.0),
child: SizedBox( child: Text(
width: double.infinity, FFLocalizations.of(context).getText(
'h1xilful' /* DIGITE A SUA SENHA */,
),
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 38, 18),
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
),
),
),
Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text(
FFLocalizations.of(context).getText(
'ujodm2ci' /* Para gerar o QR Code digite a ... */,
),
style: FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText,
fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 26, 12),
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
),
),
),
Form(
key: _model.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction,
child: Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
child: TextFormField( child: TextFormField(
controller: _model.keyTextFieldTextController, controller: _model.keyTextFieldTextController,
focusNode: _model.keyTextFieldFocusNode, focusNode: _model.keyTextFieldFocusNode,
@ -189,11 +192,12 @@ class _QrCodePassKeyTemplateComponentWidgetState
FlutterFlowTheme.of(context).labelMedium.override( FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8),
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'), .containsKey('Plus Jakarta Sans'),
), ),
hintText: FFLocalizations.of(context).getText( hintText: FFLocalizations.of(context).getText(
'zz1haydj' /* digite a sua senha..... */, 'zz1haydj' /* digite a sua senha..... */,
@ -202,7 +206,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
FlutterFlowTheme.of(context).labelMedium.override( FlutterFlowTheme.of(context).labelMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8),
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
@ -258,7 +262,7 @@ class _QrCodePassKeyTemplateComponentWidgetState
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 14.0, fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8),
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
@ -281,54 +285,54 @@ class _QrCodePassKeyTemplateComponentWidgetState
), ),
), ),
), ),
), Align(
Align( alignment: const AlignmentDirectional(0.0, 0.0),
alignment: const AlignmentDirectional(0.0, 0.0), child: Padding(
child: Padding( padding:
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 15),
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), child: FFButtonWidget(
child: FFButtonWidget( onPressed: () async {
onPressed: () async { if (_model.formKey.currentState == null ||
if (_model.formKey.currentState == null || !_model.formKey.currentState!.validate()) {
!_model.formKey.currentState!.validate()) { return;
return; }
} await widget.toggleActionStatus?.call(
await widget.toggleActionStatus?.call( _model.keyTextFieldTextController.text,
_model.keyTextFieldTextController.text, );
); context.pop();
context.pop(); },
}, text: FFLocalizations.of(context).getText(
text: FFLocalizations.of(context).getText( '2cybbi5p' /* Enviar */,
'2cybbi5p' /* Enviar */,
),
options: FFButtonOptions(
width: 270.0,
height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
iconPadding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: const Color(0xFF1AAB5F),
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
fontFamily: 'Plus Jakarta Sans',
color: Colors.white,
fontSize: 16.0,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
), ),
options: FFButtonOptions(
width: 270.0,
height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
iconPadding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: const Color(0xFF1AAB5F),
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
fontFamily: 'Plus Jakarta Sans',
color: Colors.white,
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15),
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap()
.containsKey('Plus Jakarta Sans'),
),
elevation: 3.0,
borderSide: const BorderSide(
color: Colors.transparent,
width: 1.0,
),
),
showLoadingIndicator: false,
), ),
showLoadingIndicator: false,
), ),
), ),
), ],
], ),
), ),
), ),
); );

View File

@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/dialog_util.dart';
import 'package:hub/shared/utils/image_util.dart'; import 'package:hub/shared/utils/image_util.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:hub/shared/utils/validator_util.dart'; import 'package:hub/shared/utils/validator_util.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
@ -33,7 +34,7 @@ class RegisiterVistorTemplateComponentWidget extends StatefulWidget {
class _RegisiterVistorTemplateComponentWidgetState class _RegisiterVistorTemplateComponentWidgetState
extends State<RegisiterVistorTemplateComponentWidget> { extends State<RegisiterVistorTemplateComponentWidget> {
late RegisiterVistorTemplateComponentModel _model; late RegisiterVistorTemplateComponentModel _model;
bool _isLoading = false;
final scaffoldKey = GlobalKey<ScaffoldState>(); final scaffoldKey = GlobalKey<ScaffoldState>();
bool _isVisitorRegistered = false; bool _isVisitorRegistered = false;
@ -120,6 +121,9 @@ class _RegisiterVistorTemplateComponentWidgetState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12.0, 22.0, 10.0 );
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 1.0), alignment: const AlignmentDirectional(0.0, 1.0),
child: Container( child: Container(
@ -193,6 +197,7 @@ class _RegisiterVistorTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.labelMediumFamily), .labelMediumFamily),
fontSize: limitedTextSize,
), ),
hintStyle: hintStyle:
FlutterFlowTheme.of(context).labelMedium.override( FlutterFlowTheme.of(context).labelMedium.override(
@ -202,6 +207,7 @@ class _RegisiterVistorTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context) .containsKey(FlutterFlowTheme.of(context)
.labelMediumFamily), .labelMediumFamily),
fontSize: limitedTextSize,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
@ -243,6 +249,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedTextSize,
), ),
onChanged: (value) { onChanged: (value) {
_model.debounce(() async { _model.debounce(() async {
@ -330,6 +337,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
hintStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
@ -340,6 +348,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
@ -381,6 +390,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedTextSize,
), ),
maxLines: null, maxLines: null,
maxLength: 80, maxLength: 80,
@ -420,9 +430,11 @@ class _RegisiterVistorTemplateComponentWidgetState
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
fontSize: limitedTextSize,
), ),
hintText: FFLocalizations.of(context).getText( hintText: FFLocalizations.of(context).getVariableText(
'pmezihb4' /* Selecione... */, enText: 'Visitor Type',
ptText: 'Tipo de Visitante',
), ),
icon: Icon( icon: Icon(
Icons.keyboard_arrow_down_rounded, Icons.keyboard_arrow_down_rounded,
@ -451,8 +463,8 @@ class _RegisiterVistorTemplateComponentWidgetState
top: 5, start: 15), top: 5, start: 15),
child: Text( child: Text(
FFLocalizations.of(context).getVariableText( FFLocalizations.of(context).getVariableText(
enText: 'This field is required', enText: 'Select the type of visitor',
ptText: 'Este campo é obrigatório', ptText: 'Selecione o tipo de visitante',
), ),
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodySmall .bodySmall
@ -466,6 +478,7 @@ class _RegisiterVistorTemplateComponentWidgetState
.containsKey( .containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodySmallFamily), .bodySmallFamily),
fontSize: limitedTextSize,
)), )),
), ),
], ],
@ -505,11 +518,14 @@ class _RegisiterVistorTemplateComponentWidgetState
); );
} else { } else {
return Stack( return Stack(
children: [ children: [
Align( GestureDetector(
alignment: const AlignmentDirectional(0.0, 0.0), onTap: () async {
child: FFButtonWidget(
onPressed: () async { setState(() {
_isLoading = true;
});
final selectedMedia = final selectedMedia =
await selectMediaWithSourceBottomSheetandFaceDetection( await selectMediaWithSourceBottomSheetandFaceDetection(
context: context, context: context,
@ -562,6 +578,7 @@ class _RegisiterVistorTemplateComponentWidgetState
setState(() { setState(() {
_model.uploadedLocalFile = _model.uploadedLocalFile =
selectedUploadedFiles.first; selectedUploadedFiles.first;
_isLoading = false;
}); });
final String message = final String message =
FFLocalizations.of(context) FFLocalizations.of(context)
@ -571,7 +588,9 @@ class _RegisiterVistorTemplateComponentWidgetState
); );
showUploadMessage(context, message); showUploadMessage(context, message);
} else { } else {
setState(() {}); setState(() {
_isLoading = false;
});
final String message = final String message =
FFLocalizations.of(context) FFLocalizations.of(context)
.getVariableText( .getVariableText(
@ -579,75 +598,80 @@ class _RegisiterVistorTemplateComponentWidgetState
ptText: 'Falha ao enviar os dados', ptText: 'Falha ao enviar os dados',
); );
showUploadMessage(context, message); showUploadMessage(context, message);
return; return;
} }} else {
setState(() {
_isLoading = false;
});
} }
}, },
text: '', child: Center(
icon: Icon( child: Container(
Icons.photo_camera, width: MediaQuery.of(context).size.width * 0.8,
color: FlutterFlowTheme.of(context).accent1, height: 120,
size: 30.0, decoration: BoxDecoration(
), borderRadius: BorderRadius.circular(8.0),
options: FFButtonOptions( border: Border.all(
width: double.infinity, color: FlutterFlowTheme.of(context).customColor6,
height: 120.0, width: 1.0,
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 20.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),
),
borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent1,
width: 0.2,
),
borderRadius: BorderRadius.circular(8.0),
), ),
), ),
), child: Column(
Align( mainAxisSize: MainAxisSize.max,
alignment: const AlignmentDirectional(0.0, 0.0), mainAxisAlignment: MainAxisAlignment.center,
child: Padding( children: [
padding: const EdgeInsetsDirectional.fromSTEB( _isLoading
10.0, 65.0, 10.0, 0.0), ? SizedBox(
child: Text( width: 30.0,
FFLocalizations.of(context).getText( height: 30.0,
'p4ftwxcy' /* Clique para adicionar a foto p... */, child: CircularProgressIndicator(
), valueColor:
style: FlutterFlowTheme.of(context) AlwaysStoppedAnimation<Color>(
.bodyMedium FlutterFlowTheme.of(context)
.override( .primary,
fontFamily: FlutterFlowTheme.of(context) ),
.bodyMediumFamily, ),
color: FlutterFlowTheme.of(context) )
.primaryText, : Icon(
letterSpacing: 0.0, Icons.photo_camera,
useGoogleFonts: GoogleFonts.asMap() color: FlutterFlowTheme.of(context)
.containsKey( .primary,
FlutterFlowTheme.of(context) size: 30.0,
.bodyMediumFamily), ),
Padding(
padding:
const EdgeInsets.fromLTRB(0, 15, 0, 0),
child: Text(
FFLocalizations.of(context).getText(
'p4ftwxcy',
), ),
), textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily:
FlutterFlowTheme.of(context)
.titleSmallFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
fontSize: limitedTextSize,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.titleSmallFamily),
),
),
)
],
), ),
), ),
], ),
); ),
]
);
} }
}, },
), ),
@ -706,6 +730,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
hintStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
@ -716,6 +741,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
@ -757,6 +783,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedTextSize,
), ),
// validator: // validator:
// _model.textController3Validator.asValidator(context), // _model.textController3Validator.asValidator(context),
@ -793,6 +820,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
hintStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context)
.labelMedium .labelMedium
@ -803,6 +831,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).labelMediumFamily), FlutterFlowTheme.of(context).labelMediumFamily),
fontSize: limitedTextSize,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
@ -844,6 +873,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedTextSize,
), ),
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
inputFormatters: [LengthLimitingTextInputFormatter(80)], inputFormatters: [LengthLimitingTextInputFormatter(80)],
@ -899,7 +929,10 @@ class _RegisiterVistorTemplateComponentWidgetState
'Visitor successfully registered.'), 'Visitor successfully registered.'),
style: TextStyle( style: TextStyle(
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.info)), .info,
)
),
backgroundColor: backgroundColor:
FlutterFlowTheme.of(context).primary, FlutterFlowTheme.of(context).primary,
duration: const Duration(seconds: 3), duration: const Duration(seconds: 3),
@ -960,6 +993,7 @@ class _RegisiterVistorTemplateComponentWidgetState
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).titleSmallFamily), FlutterFlowTheme.of(context).titleSmallFamily),
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15)
), ),
borderSide: const BorderSide( borderSide: const BorderSide(
color: Colors.transparent, color: Colors.transparent,

View File

@ -16,6 +16,7 @@ import 'package:hub/flutter_flow/nav/nav.dart';
import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:hub/pages/qr_code_page/qr_code_page_model.dart';
import 'package:hub/shared/utils/biometric_util.dart'; import 'package:hub/shared/utils/biometric_util.dart';
import 'package:hub/shared/utils/limited_text_size.dart';
import 'package:hub/shared/utils/storage_util.dart'; import 'package:hub/shared/utils/storage_util.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
@ -109,6 +110,9 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
screenWidth < screenHeight ? screenWidth : screenHeight; screenWidth < screenHeight ? screenWidth : screenHeight;
double dimension = smallerDimension * 0.75; double dimension = smallerDimension * 0.75;
double totalTimeInSeconds = 100.0; double totalTimeInSeconds = 100.0;
double limitedHeaderTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20.0, 38, 18);
double limitedBodyTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14.0, 22, 12);
return SafeArea( return SafeArea(
// top: true, // top: true,
child: Column( child: Column(
@ -123,11 +127,12 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
), ),
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
fontSize: 20.0, fontSize: limitedHeaderTextSize,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
), ),
Stack( Stack(
@ -221,6 +226,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap()
.containsKey(FlutterFlowTheme.of(context) .containsKey(FlutterFlowTheme.of(context)
.titleSmallFamily), .titleSmallFamily),
fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14),
), ),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide( borderSide: const BorderSide(
@ -255,6 +261,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
fontSize: limitedBodyTextSize,
), ),
), ),
), ),
@ -291,6 +298,7 @@ class _QrCodePageWidgetState extends State<QrCodePageWidget>
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
fontSize: limitedBodyTextSize,
), ),
), ),
), ),

View File

@ -224,7 +224,8 @@ class _ScheduleCompleteVisitPageWidgetState
final textScaler = MediaQuery.textScalerOf(context); final textScaler = MediaQuery.textScalerOf(context);
final double baseFontSize = 12.0; final double baseFontSize = 12.0;
final double scaledFontSize = baseFontSize * textScaler.scale(1); final double scaledFontSize = baseFontSize * textScaler.scale(1);
final double limitedFontSize = scaledFontSize > 16.0 ? 10 : baseFontSize; final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize(
context, 12, 12, 10.0);
final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80; final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80;
return SingleChildScrollView( return SingleChildScrollView(
@ -317,7 +318,7 @@ class _ScheduleCompleteVisitPageWidgetState
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
.accent4, .customColor6,
width: 0.5, width: 0.5,
), ),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
@ -574,7 +575,7 @@ class _ScheduleCompleteVisitPageWidgetState
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: color:
FlutterFlowTheme.of(context).accent4, FlutterFlowTheme.of(context).customColor6,
width: 0.5, width: 0.5,
), ),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
@ -924,23 +925,19 @@ class _ScheduleCompleteVisitPageWidgetState
: FocusScope.of(context).unfocus(), : FocusScope.of(context).unfocus(),
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.7, 0.8,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: Padding( child: Padding(
padding: MediaQuery.viewInsetsOf(context), padding: MediaQuery.viewInsetsOf(context),
child: child: VisitorSearchModalTemplateComponentWidget(
VisitorSearchModalTemplateComponentWidget( getVisitors: (visitorsParam) async {
getVisitors: (visitorsParam) async { model.visitorJsonList = visitorsParam!.toList().cast<dynamic>();
model.visitorJsonList = visitorsParam! safeSetState(() {});
.toList() },
.cast<dynamic>(); getDocs: (docsParam) async {
safeSetState(() {}); model.visitorStrList = strListToStr(docsParam!.toList());
}, safeSetState(() {});
getDocs: (docsParam) async { },
model.visitorStrList =
strListToStr(docsParam!.toList());
safeSetState(() {});
},
), ),
), ),
), ),
@ -957,7 +954,7 @@ class _ScheduleCompleteVisitPageWidgetState
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
border: Border.all( border: Border.all(
color: FlutterFlowTheme.of(context).accent4, color: FlutterFlowTheme.of(context).customColor6,
width: 1.0, width: 1.0,
), ),
), ),
@ -1124,7 +1121,7 @@ class _ScheduleCompleteVisitPageWidgetState
elevation: 2.0, elevation: 2.0,
borderColor: borderColor:
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.accent4, .customColor6,
borderWidth: 0.5, borderWidth: 0.5,
borderRadius: 10.0, borderRadius: 10.0,
margin: const EdgeInsetsDirectional margin: const EdgeInsetsDirectional
@ -1245,7 +1242,7 @@ class _ScheduleCompleteVisitPageWidgetState
elevation: 2.0, elevation: 2.0,
borderColor: borderColor:
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.accent4, .customColor6,
borderWidth: 0.5, borderWidth: 0.5,
borderRadius: 10.0, borderRadius: 10.0,
margin: const EdgeInsetsDirectional margin: const EdgeInsetsDirectional
@ -1469,7 +1466,7 @@ class _ScheduleCompleteVisitPageWidgetState
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).accent4, color: FlutterFlowTheme.of(context).customColor6,
width: 0.5, width: 0.5,
), ),
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),

View File

@ -12,7 +12,7 @@ class LimitedTextSizeUtil {
final double noscaledFontSize = baseFontSize / textScaler.scale(1); final double noscaledFontSize = baseFontSize / textScaler.scale(1);
return noscaledFontSize; return noscaledFontSize;
} }
static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) {
final textScaler = MediaQuery.textScalerOf(context); final textScaler = MediaQuery.textScalerOf(context);
final double scaledFontSize = baseFontSize * textScaler.scale(1); final double scaledFontSize = baseFontSize * textScaler.scale(1);