From 7026c0b08e620210e777a01a46096040d2fe19a7 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 11:33:28 -0300 Subject: [PATCH 1/2] chore: Update tab controller length in message widget --- assets/images/welcome.svg | 30 +++ lib/app_state.dart | 2 +- lib/modals/forms/change_password/model.dart | 5 +- lib/modals/forms/change_password/widget.dart | 212 +++++++++---------- lib/modals/forms/qr_code/model.dart | 5 +- lib/modals/forms/qr_code/widget.dart | 3 +- lib/pages/consults/message/widget.dart | 40 +++- lib/pages/consults/qrcode/widget.dart | 11 +- lib/pages/onboarding/welcome/component.dart | 4 +- pubspec.yaml | 1 + 10 files changed, 185 insertions(+), 128 deletions(-) create mode 100644 assets/images/welcome.svg diff --git a/assets/images/welcome.svg b/assets/images/welcome.svg new file mode 100644 index 00000000..8983fac0 --- /dev/null +++ b/assets/images/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/app_state.dart b/lib/app_state.dart index a0918b1c..c16883dc 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,4 +1,4 @@ -import 'dart:ffi'; +// import 'dart:ffi'; import 'commons/widgets/permissions_util.dart'; import 'package:flutter/material.dart'; diff --git a/lib/modals/forms/change_password/model.dart b/lib/modals/forms/change_password/model.dart index b2927743..a6144794 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/modals/forms/change_password/model.dart @@ -20,8 +20,9 @@ class PassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } return null; diff --git a/lib/modals/forms/change_password/widget.dart b/lib/modals/forms/change_password/widget.dart index a53a1545..11c2dfa5 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/modals/forms/change_password/widget.dart @@ -166,101 +166,43 @@ class _PassKeyTemplateWidgetState child: SizedBox( width: double.infinity, child: TextFormField( - controller: _model.keyTextFieldTextController1, - focusNode: _model.keyTextFieldFocusNode1, - onChanged: (_) => EasyDebounce.debounce( - '_model.keyTextFieldTextController', - const Duration(milliseconds: 2000), - () { - if (mounted) setState(() {}); - }, - ), - autofillHints: const [AutofillHints.password], - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.done, - obscureText: !_model.keyTextFieldVisibility1, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Senha', - enText: 'Password', + controller: _model.keyTextFieldTextController1, + focusNode: _model.keyTextFieldFocusNode1, + onChanged: (_) => EasyDebounce.debounce( + '_model.keyTextFieldTextController', + const Duration(milliseconds: 2000), + () { + if (mounted) setState(() {}); + }, ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Digite a sua senha.....', - enText: 'Enter your password.....', - ), - hintStyle: 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'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 20.0, 24.0), - suffixIcon: InkWell( - onTap: () => setState( - () => _model.keyTextFieldVisibility1 = - !_model.keyTextFieldVisibility1, - ), - focusNode: FocusNode(skipTraversal: true), - child: Icon( - _model.keyTextFieldVisibility1 - ? Icons.visibility_outlined - : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + autofillHints: const [AutofillHints.password], + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.done, + obscureText: !_model.keyTextFieldVisibility1, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Senha', + enText: 'Password', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Digite a sua senha.....', + enText: 'Enter your password.....', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -268,19 +210,77 @@ class _PassKeyTemplateWidgetState fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent1, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent3, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + contentPadding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: InkWell( + onTap: () => setState( + () => _model.keyTextFieldVisibility1 = + !_model.keyTextFieldVisibility1, + ), + focusNode: FocusNode(skipTraversal: true), + child: Icon( + _model.keyTextFieldVisibility1 + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), + ), ), - maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.enforced, - buildCounter: (context, - {required currentLength, - required isFocused, - maxLength}) => - null, - keyboardType: TextInputType.number, - cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.keyTextFieldTextControllerValidator1 - .asValidator(context), - inputFormatters: [ + style: FlutterFlowTheme.of(context).bodyMedium.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'), + ), + maxLength: 4, + maxLengthEnforcement: MaxLengthEnforcement.enforced, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, + keyboardType: TextInputType.number, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.keyTextFieldTextControllerValidator1 + .asValidator(context), + inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), ], ), diff --git a/lib/modals/forms/qr_code/model.dart b/lib/modals/forms/qr_code/model.dart index 1c41f39a..1c9aa433 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/modals/forms/qr_code/model.dart @@ -16,8 +16,9 @@ class QrCodePassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/modals/forms/qr_code/widget.dart index 0bf75907..6ffff798 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/modals/forms/qr_code/widget.dart @@ -163,7 +163,6 @@ class _QrCodePassKeyTemplateComponentWidgetState width: double.infinity, child: TextFormField( controller: _model.keyTextFieldTextController, - focusNode: _model.keyTextFieldFocusNode, onChanged: (_) => EasyDebounce.debounce( '_model.keyTextFieldTextController', @@ -259,7 +258,7 @@ class _QrCodePassKeyTemplateComponentWidgetState .containsKey('Plus Jakarta Sans'), ), maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.none, + maxLengthEnforcement: MaxLengthEnforcement.enforced, buildCounter: (context, {required currentLength, required isFocused, diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index 969fdd5f..fe7b90a8 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -257,18 +257,38 @@ Widget messageHistoryItem( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Text(jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ),), + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + ), ), - Icon(jsonBody['MSG_DESTINO_TP'] == 'T'? Icons.group : Icons.person), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Container( + width: 100, // Adjust the width as needed + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ), + Icon(jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, color: FlutterFlowTheme.of(context).accent1,), ], ), Text(jsonBody['MSG_TEXTO'].toString()), @@ -277,5 +297,7 @@ Widget messageHistoryItem( ), ), ), - ); + ); + + } diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/consults/qrcode/widget.dart index 07a790be..72fe46a0 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/consults/qrcode/widget.dart @@ -151,9 +151,12 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( onTap: () { - safeSetState(() { - - }); + + safeSetState(() async { + _resetAnimationAndToggleAccess(); + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + }); + }, child: buildQrCode( dimension: dimension, @@ -184,7 +187,7 @@ void dispose() { ), ), if (_model.isAccess == false && _model.key == null) - Align( + Align( alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( splashColor: Colors.transparent, diff --git a/lib/pages/onboarding/welcome/component.dart b/lib/pages/onboarding/welcome/component.dart index 71c4954f..a489e5f7 100644 --- a/lib/pages/onboarding/welcome/component.dart +++ b/lib/pages/onboarding/welcome/component.dart @@ -175,8 +175,8 @@ class _WelcomeTemplateComponentWidgetState decoration: const BoxDecoration(), child: ClipRRect( borderRadius: BorderRadius.circular(0.0), - child: SvgPicture.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/lv1waa0etd3j/undraw_appreciate_it_re_yc8h_(1)_1.svg', + child: SvgPicture.asset( + 'assets/images/welcome.svg', width: 603.0, height: double.infinity, fit: BoxFit.contain, diff --git a/pubspec.yaml b/pubspec.yaml index 3f38a251..dfe4419b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -133,6 +133,7 @@ flutter_launcher_icons: adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg' + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec From 7c721b6768fe8da7124f494a15a349ccd5a6b1f4 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Thu, 25 Jul 2024 15:13:30 -0300 Subject: [PATCH 2/2] chore: Update tab controller length in message widget --- lib/commons/actions/actions.dart | 31 ++- .../components/molecules/card/widget.dart | 4 +- lib/commons/widgets/flutter_flow_theme.dart | 3 + lib/commons/widgets/internationalization.dart | 2 +- lib/main.dart | 5 + lib/modals/forms/change_password/model.dart | 6 +- lib/modals/forms/change_password/widget.dart | 9 +- lib/modals/forms/qr_code/model.dart | 4 + lib/modals/forms/qr_code/widget.dart | 12 +- lib/pages/consults/access/widget.dart | 14 +- lib/pages/consults/message/widget.dart | 121 +++++---- lib/pages/consults/poeple/widget.dart | 234 ++++++++---------- lib/pages/consults/qrcode/widget.dart | 20 +- lib/pages/onboarding/signin/component.dart | 50 ++-- lib/pages/onboarding/signup/component.dart | 37 +-- 15 files changed, 289 insertions(+), 263 deletions(-) diff --git a/lib/commons/actions/actions.dart b/lib/commons/actions/actions.dart index e63acea4..b16ce6e8 100644 --- a/lib/commons/actions/actions.dart +++ b/lib/commons/actions/actions.dart @@ -19,6 +19,17 @@ import '/commons/widgets/flutter_flow_theme.dart'; import '/commons/widgets/flutter_flow_util.dart'; import '/commons/widgets/random_data_util.dart' as random_data; + +import 'package:url_launcher/url_launcher.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} + Future repeatVisitScheduleAction( BuildContext context, { List? visitorJsonList, @@ -237,8 +248,8 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR2'), - content: const Text('ERROR2'), + title: const Text('Error'), + content: Text('${registerCall?.jsonBody}'), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), @@ -254,12 +265,21 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR1'), - content: const Text('ERROR1'), + title: Text(FFLocalizations.of(context).getVariableText( + enText: 'Error', + ptText: 'Erro', + )), + content: Text(FFLocalizations.of(context).getVariableText( + enText: 'Please fill in all fields', + ptText: 'Por favor, preencha todos os campos', + )), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR1 '), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: 'Fechar', + enText: 'Close', + )), ), ], ); @@ -314,6 +334,7 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( 'signUpPage', extra: { diff --git a/lib/commons/components/molecules/card/widget.dart b/lib/commons/components/molecules/card/widget.dart index 47f1a027..1452e832 100644 --- a/lib/commons/components/molecules/card/widget.dart +++ b/lib/commons/components/molecules/card/widget.dart @@ -187,10 +187,10 @@ class _CardItemTemplateComponentWidgetState return linkedHashMap.entries.map((MapEntry item) { return Container( child: Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 3.0), + padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), child: Container( width: 100.0, height: 27.0, diff --git a/lib/commons/widgets/flutter_flow_theme.dart b/lib/commons/widgets/flutter_flow_theme.dart index 12792945..9bc83617 100644 --- a/lib/commons/widgets/flutter_flow_theme.dart +++ b/lib/commons/widgets/flutter_flow_theme.dart @@ -50,6 +50,7 @@ abstract class FlutterFlowTheme { late Color secondary; late Color tertiary; late Color alternate; + late Color alternate2; late Color primaryText; late Color secondaryText; late Color primaryBackground; @@ -160,6 +161,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFFB59E9E); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFFF2F2F2); + late Color alternate2 = const Color(0xFF232323); late Color primaryText = const Color(0xFF000000); late Color secondaryText = const Color(0xFFFFFFFF); late Color primaryBackground = const Color(0xFFFFFFFF); @@ -559,6 +561,7 @@ class DarkModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFF18AA99); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFF232323); + late Color alternate2 = const Color(0xFF171717); late Color primaryText = const Color(0xFFFFFFFF); late Color secondaryText = const Color(0xFF000000); late Color primaryBackground = const Color(0xFF171717); diff --git a/lib/commons/widgets/internationalization.dart b/lib/commons/widgets/internationalization.dart index e535962b..9b26d8dd 100644 --- a/lib/commons/widgets/internationalization.dart +++ b/lib/commons/widgets/internationalization.dart @@ -967,7 +967,7 @@ final kTranslationsMap = >>[ }, 'a9smhn5b': { 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', + 'en': 'You already have an account? ', }, '09xv5ctc': { 'pt': 'Clique aqui', diff --git a/lib/main.dart b/lib/main.dart index 19cd912a..e15dc32e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,11 +9,16 @@ import 'package:flutter_web_plugins/url_strategy.dart'; import 'commons/widgets/flutter_flow_theme.dart'; import 'commons/widgets/flutter_flow_util.dart'; import 'commons/widgets/internationalization.dart'; +import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); void main() async { WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); await initializeApp(); runApp(ChangeNotifierProvider( create: (context) => FFAppState(), diff --git a/lib/modals/forms/change_password/model.dart b/lib/modals/forms/change_password/model.dart index a6144794..924ec401 100644 --- a/lib/modals/forms/change_password/model.dart +++ b/lib/modals/forms/change_password/model.dart @@ -19,12 +19,16 @@ class PassKeyTemplateComponentModel String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2; String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { - if (val == null || val.isEmpty) { + if (val == null || val.isEmpty ) { return FFLocalizations.of(context).getVariableText( enText: 'This field is required', ptText: 'Este campo é obrigatório', ); } + if ( val.length < 4 ) return FFLocalizations.of(context).getVariableText( + enText: 'This field must have at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/modals/forms/change_password/widget.dart b/lib/modals/forms/change_password/widget.dart index 11c2dfa5..ccecaa4c 100644 --- a/lib/modals/forms/change_password/widget.dart +++ b/lib/modals/forms/change_password/widget.dart @@ -158,7 +158,7 @@ class _PassKeyTemplateWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ Padding( @@ -189,7 +189,7 @@ class _PassKeyTemplateWidgetState .labelMedium .override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -213,14 +213,14 @@ class _PassKeyTemplateWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -282,6 +282,7 @@ class _PassKeyTemplateWidgetState .asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), ], ), ), diff --git a/lib/modals/forms/qr_code/model.dart b/lib/modals/forms/qr_code/model.dart index 1c9aa433..813a6c2a 100644 --- a/lib/modals/forms/qr_code/model.dart +++ b/lib/modals/forms/qr_code/model.dart @@ -21,6 +21,10 @@ class QrCodePassKeyTemplateComponentModel ptText: 'Este campo é obrigatório', ); } + if (val.length < 4) return FFLocalizations.of(context).getVariableText( + enText: 'This field must be at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/modals/forms/qr_code/widget.dart b/lib/modals/forms/qr_code/widget.dart index 6ffff798..8f31f358 100644 --- a/lib/modals/forms/qr_code/widget.dart +++ b/lib/modals/forms/qr_code/widget.dart @@ -156,7 +156,7 @@ class _QrCodePassKeyTemplateComponentWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( @@ -181,7 +181,7 @@ class _QrCodePassKeyTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -203,14 +203,14 @@ class _QrCodePassKeyTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -269,7 +269,9 @@ class _QrCodePassKeyTemplateComponentWidgetState validator: _model.keyTextFieldTextControllerValidator .asValidator(context), inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')) + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), + ], ), ), diff --git a/lib/pages/consults/access/widget.dart b/lib/pages/consults/access/widget.dart index 02c88025..cec1e538 100644 --- a/lib/pages/consults/access/widget.dart +++ b/lib/pages/consults/access/widget.dart @@ -324,35 +324,35 @@ class _AcessHistoryPageWidgetState extends State { accessHistoryItem['PES_TIPO'] == 'O' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Visitado', - enText: 'Visited', - ): FlutterFlowTheme.of(context).alternate, + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, }) : accessHistoryItem['PES_TIPO'] == 'E' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitante', enText: 'Visitor', - ): FlutterFlowTheme.of(context).alternate, + ): FlutterFlowTheme.of(context).alternate2, }) : Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate, + ): FlutterFlowTheme.of(context).alternate2, }), accessHistoryItem['ACE_TIPO'] == '0' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Entrada', - enText: 'Entrada' + enText: 'Entrance', ): FlutterFlowTheme.of(context).success, }) : accessHistoryItem['ACE_TIPO'] == '1' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Saída', - enText: 'Saída', + enText: 'Exit', ): FlutterFlowTheme.of(context).error, }) : Map.from({ diff --git a/lib/pages/consults/message/widget.dart b/lib/pages/consults/message/widget.dart index fe7b90a8..d390f66d 100644 --- a/lib/pages/consults/message/widget.dart +++ b/lib/pages/consults/message/widget.dart @@ -1,21 +1,13 @@ // import 'dart:js_interop'; -import 'dart:convert'; import 'dart:developer'; import 'package:hub/commons/actions/api_calls.dart'; -import 'package:hub/commons/actions/actions.dart'; import 'package:hub/commons/actions/api_manager.dart'; -import 'package:hub/commons/actions/pushNotificationService.dart'; -import 'package:hub/commons/components/molecules/card/widget.dart'; -import 'package:hub/modals/notifications/visit_request/widget.dart'; -import 'package:json_path/fun_extra.dart'; import '/commons/widgets/flutter_flow_icon_button.dart'; import '/commons/widgets/flutter_flow_theme.dart'; import '/commons/widgets/flutter_flow_util.dart'; -import '/commons/widgets/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -65,16 +57,11 @@ class _MessageHistoryPageWidgetState extends State wit @override Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarMessage(context), - body: bodyMessage(context, _model), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarMessage(context), + body: bodyMessage(context, _model), ); } } @@ -247,57 +234,67 @@ Widget messageHistoryItem( BuildContext context, dynamic jsonBody) { log(jsonBody.toString()); return Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Card( - child: Container( - // height: 100, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text( - jsonBody['MSG_DATE'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ), - ), + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + overflow: TextOverflow.ellipsis, ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Container( - width: 100, // Adjust the width as needed - child: Text( - jsonBody['MSG_ORIGEM_DESC'].toString(), - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: FlutterFlowTheme.of(context).primary, - ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - Icon(jsonBody['MSG_DESTINO_TP'] == 'T' - ? Icons.group - : Icons.person, color: FlutterFlowTheme.of(context).accent1,), - ], + ), ), - Text(jsonBody['MSG_TEXTO'].toString()), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ) ], ), - ), + SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ), + ], + ), + SizedBox(height: 8), + Text(jsonBody['MSG_TEXTO'].toString(),), + ], ), ), - ); + ), + ), + ); } diff --git a/lib/pages/consults/poeple/widget.dart b/lib/pages/consults/poeple/widget.dart index ddf4df13..313bff9f 100644 --- a/lib/pages/consults/poeple/widget.dart +++ b/lib/pages/consults/poeple/widget.dart @@ -43,136 +43,118 @@ class _PeopleOnThePropertyPageWidgetState Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - 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(); - }, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + 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, ), - title: Text( - FFLocalizations.of(context).getText( - 'nsu13r5d' /* Pessoas na Propriedade */, - ), - 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, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: FutureBuilder( - future: PhpGroup.getPessoasLocalCall.call( - cliID: FFAppState().cliUUID, - ownID: FFAppState().ownerUUID, - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final columnGetPessoasLocalResponse = snapshot.data!; - return Builder( - builder: (context) { - final getPoepleProperty = PhpGroup.getPessoasLocalCall - .pessoas( - columnGetPessoasLocalResponse.jsonBody, - ) - ?.toList() ?? - []; - - return Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: List.generate(getPoepleProperty.length, - (getPoeplePropertyIndex) { - final getPoeplePropertyItem = - getPoepleProperty[getPoeplePropertyIndex]; - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: 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://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - ), - Text( - getJsonField( - getPoeplePropertyItem, - r'''$.USU_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 40.0)), - ); - }).divide(const SizedBox(height: 3.0)), - ); - }, - ); - }, + title: Text( + FFLocalizations.of(context).getText( + 'nsu13r5d' /* Pessoas na Propriedade */, ), + 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, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: FutureBuilder( + future: PhpGroup.getPessoasLocalCall.call( + cliID: FFAppState().cliUUID, + ownID: FFAppState().ownerUUID, + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final columnGetPessoasLocalResponse = snapshot.data!; + final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? + []; + return ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: getPoepleProperty.length, + itemBuilder: (context, index) { + final getPoeplePropertyItem = getPoepleProperty[index]; + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: 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://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + fit: BoxFit.cover, + ), + ), + ), + Text( + getJsonField( + getPoeplePropertyItem, + r'''$.USU_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 40.0)), + ); + }, + ); + }, ), ), ); diff --git a/lib/pages/consults/qrcode/widget.dart b/lib/pages/consults/qrcode/widget.dart index 72fe46a0..c95570b3 100644 --- a/lib/pages/consults/qrcode/widget.dart +++ b/lib/pages/consults/qrcode/widget.dart @@ -102,16 +102,11 @@ void dispose() { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: buildAppBar(context), - body: buildBody(context), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: buildAppBar(context), + body: buildBody(context), ); } @@ -120,16 +115,15 @@ void dispose() { double screenHeight = MediaQuery.of(context).size.height; double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; - double totalTimeInSeconds = 100.0; return SafeArea( - top: true, + // top: true, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (_model.isAccess == true && _model.key != null) - Text( + Text( FFLocalizations.of(context).getVariableText( ptText: 'Use esse QR Code para acesso', enText: 'Use this QR Code for access', diff --git a/lib/pages/onboarding/signin/component.dart b/lib/pages/onboarding/signin/component.dart index cfd1f656..7b1a90c8 100644 --- a/lib/pages/onboarding/signin/component.dart +++ b/lib/pages/onboarding/signin/component.dart @@ -262,7 +262,7 @@ class _SignInTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.always, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -1007,28 +1007,34 @@ class _SignInTemplateComponentWidgetState ), ), ), - Text( - FFLocalizations.of(context).getText( - 'olf967cj' /* Termo de Uso */, + GestureDetector( + onTap: () async { + await action_blocks.openTermsOfUse(context); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Termos de uso', + enText: 'Terms of use', + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: + FlutterFlowTheme.of(context) + .primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), ), ], ), diff --git a/lib/pages/onboarding/signup/component.dart b/lib/pages/onboarding/signup/component.dart index 63c763ae..50e21802 100644 --- a/lib/pages/onboarding/signup/component.dart +++ b/lib/pages/onboarding/signup/component.dart @@ -298,7 +298,7 @@ class _SignUpTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.disabled, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -843,8 +843,9 @@ class _SignUpTemplateComponentWidgetState TextSpan( text: FFLocalizations.of( context) - .getText( - 'a9smhn5b' /* Você já tem uma conta? */, + .getVariableText( + ptText: 'Você já tem uma conta? ', + enText: 'Already have an account? ', ), style: TextStyle( color: FlutterFlowTheme.of( @@ -909,19 +910,25 @@ class _SignUpTemplateComponentWidgetState ), ], ), - Text( - FFLocalizations.of(context).getText( - 'huygnka2' /* Termo de Uso */, + GestureDetector( + onTap: () async { + await action_blocks.openTermsOfUse(context); + }, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Termos de uso', + enText: 'Terms of use', + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), ), ], ),