Merge branch 'fix/visitorRegister' into develop

This commit is contained in:
jantunesmesias 2024-08-02 16:12:56 -03:00
commit 614e55bb99
7 changed files with 265 additions and 235 deletions

View File

@ -41,6 +41,8 @@
4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; }; 4C588A6A63D12FBFE8C3D586 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; 4C7A2C30DCF835BA60FAD235 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; 50BE974D08F66282C0031620 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
6436409127A31CDB00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409227A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Flutter View Controller--> <!--Flutter View Controller-->
@ -14,13 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="-16" y="-40"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>

View File

@ -16,6 +16,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'forgot_password_template_component_model.dart'; import 'forgot_password_template_component_model.dart';
export 'forgot_password_template_component_model.dart'; export 'forgot_password_template_component_model.dart';
//
class ForgotPasswordTemplateComponentWidget extends StatefulWidget { class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
const ForgotPasswordTemplateComponentWidget({super.key}); const ForgotPasswordTemplateComponentWidget({super.key});
@ -81,7 +83,8 @@ class _ForgotPasswordTemplateComponentWidgetState
tablet: false, tablet: false,
)) ))
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
child: InkWell( child: InkWell(
splashColor: Colors.transparent, splashColor: Colors.transparent,
focusColor: Colors.transparent, focusColor: Colors.transparent,
@ -103,20 +106,20 @@ class _ForgotPasswordTemplateComponentWidgetState
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsetsDirectional.fromSTEB(
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: 14.0, 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'),
), ),
), ),
), ),
], ],
@ -124,43 +127,46 @@ class _ForgotPasswordTemplateComponentWidgetState
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
child: Text( child: Text(
FFLocalizations.of(context).getText( FFLocalizations.of(context).getText(
'xxm3ajsy' /* ESQUECEU SUA SENHA? */, 'xxm3ajsy' /* ESQUECEU SUA SENHA? */,
), ),
style: FlutterFlowTheme.of(context).headlineMedium.override( style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily: 'Outfit', fontFamily: 'Outfit',
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
fontSize: 24.0, fontSize: 24.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'),
), ),
), ),
), ),
Padding( Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
child: Text( child: Text(
FFLocalizations.of(context).getText( FFLocalizations.of(context).getText(
'wu2f7yzo' /* Não se preucupe nós vamos te a... */, 'wu2f7yzo' /* Não se preucupe nós vamos te a... */,
), ),
style: FlutterFlowTheme.of(context).labelMedium.override( style: 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: 14.0,
letterSpacing: 0.0, letterSpacing: 0.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
useGoogleFonts: useGoogleFonts:
GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
), ),
), ),
), ),
Form( Form(
key: _model.formKey, key: _model.formKey,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: TextFormField( child: TextFormField(
@ -169,7 +175,7 @@ class _ForgotPasswordTemplateComponentWidgetState
onChanged: (_) => EasyDebounce.debounce( onChanged: (_) => EasyDebounce.debounce(
'_model.emailAddressTextController', '_model.emailAddressTextController',
const Duration(milliseconds: 500), const Duration(milliseconds: 500),
() => setState(() {}), () => setState(() {}),
), ),
autofocus: true, autofocus: true,
autofillHints: const [AutofillHints.email], autofillHints: const [AutofillHints.email],
@ -226,14 +232,14 @@ class _ForgotPasswordTemplateComponentWidgetState
), ),
), ),
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: 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'),
), ),
maxLines: null, maxLines: null,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
cursorColor: FlutterFlowTheme.of(context).primary, cursorColor: FlutterFlowTheme.of(context).primary,
@ -246,64 +252,73 @@ class _ForgotPasswordTemplateComponentWidgetState
Align( Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: const AlignmentDirectional(0.0, 0.0),
child: Padding( child: Padding(
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) onPressed: (_model.emailAddressTextController.text == '' ||
!ValidatorUtil.isValidEmail(
_model.emailAddressTextController.text))
? null ? null
: () async { : () async {
try {
_model.req = await PhpGroup.forgotPasswordCall.call(
email: _model.emailAddressTextController.text,
);
try { if (PhpGroup.forgotPasswordCall
_model.req = await PhpGroup.forgotPasswordCall.call( .error((_model.req?.jsonBody ?? '')) ==
email: _model.emailAddressTextController.text, false) {
); await DialogUtil.success(
context,
FFLocalizations.of(context).getVariableText(
enText: "Send E-mail Successful!",
ptText: "E-mail Enviado com Sucesso!"));
Navigator.pop(context);
} else {
await DialogUtil.error(
context,
PhpGroup.forgotPasswordCall
.msg((_model.req?.jsonBody ?? ''))!);
}
if (PhpGroup.forgotPasswordCall.error((_model.req?.jsonBody ?? '')) == false) { setState(() {});
await DialogUtil.success(context, FFLocalizations.of(context).getVariableText( } catch (error, stack) {
enText: "Send E-mail Successful!", LogUtil.requestAPIFailed(
ptText: "E-mail Enviado com Sucesso!" "iforgot.php",
)); _model.emailAddressTextController.text,
Navigator.pop(context); "Recuperar Senha",
} else { error,
await DialogUtil.error(context, PhpGroup.forgotPasswordCall.msg((_model.req?.jsonBody ?? ''))!); stack);
} await DialogUtil.errorDefault(context);
}
setState(() {}); },
} catch (error, stack) {
LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, stack);
await DialogUtil.errorDefault(context);
}
},
text: FFLocalizations.of(context).getText( text: FFLocalizations.of(context).getText(
'74rnd5bu' /* Enviar */, '74rnd5bu' /* Enviar */,
), ),
options: FFButtonOptions( options: FFButtonOptions(
width: 270.0, width: 270.0,
height: 50.0, height: 50.0,
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), padding: const EdgeInsetsDirectional.fromSTEB(
iconPadding: 0.0, 0.0, 0.0, 0.0),
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 0.0),
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
textStyle: FlutterFlowTheme.of(context).titleSmall.override( textStyle: FlutterFlowTheme.of(context).titleSmall.override(
fontFamily: 'Plus Jakarta Sans', fontFamily: 'Plus Jakarta Sans',
color: Colors.white, color: Colors.white,
fontSize: 16.0, fontSize: 16.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'),
), ),
elevation: 3.0, elevation: 3.0,
borderSide: const BorderSide( borderSide: const BorderSide(
color: Colors.transparent, color: Colors.transparent,
width: 1.0, width: 1.0,
), ),
disabledColor: disabledColor: FlutterFlowTheme.of(context).customColor5,
FlutterFlowTheme.of( disabledTextColor: Colors.white,
context)
.customColor5,
disabledTextColor:
Colors.white,
), ),
showLoadingIndicator: true, showLoadingIndicator: true,
), ),

View File

@ -44,6 +44,7 @@ class RegisiterVistorTemplateComponentModel
atividade: 'getVisitante', atividade: 'getVisitante',
documento: document, documento: document,
); );
log('${response.jsonBody}'); log('${response.jsonBody}');
if (response.jsonBody['visitante']['VTE_ID'] != '0' && if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
response.jsonBody['error'] != 'false') { response.jsonBody['error'] != 'false') {

View File

@ -38,6 +38,8 @@ class _RegisiterVistorTemplateComponentWidgetState
final scaffoldKey = GlobalKey<ScaffoldState>(); final scaffoldKey = GlobalKey<ScaffoldState>();
bool _isVisitorRegistered = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -71,6 +73,35 @@ class _RegisiterVistorTemplateComponentWidgetState
setState(() {}); setState(() {});
} }
bool _isFormValid(BuildContext context) {
if (_model.uploadedLocalFile.bytes?.isEmpty ?? true) {
return false;
}
if (_model.textController1.text.isEmpty ||
_model.textController1.text == '') {
return false;
}
if (_model.dropDownValue == null ||
_model.dropDownValue!.isEmpty ||
_model.dropDownValue == '') {
return false;
}
if (_model.textController2.text.isEmpty ||
_model.textController2.text == '') {
return false;
}
log("Visitante Já Cadastrado $_isVisitorRegistered");
if (_isVisitorRegistered) {
return false;
}
return true;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>(); BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
@ -216,9 +247,12 @@ class _RegisiterVistorTemplateComponentWidgetState
} else if (snapshot.hasError || } else if (snapshot.hasError ||
snapshot.data == null || snapshot.data == null ||
snapshot.data == '') { snapshot.data == '') {
// safeSetState(() => _isVisitorRegistered = false);
_isVisitorRegistered = false;
visitorAlreadyRegistered.add(true); visitorAlreadyRegistered.add(true);
return const SizedBox(); return const SizedBox();
} else { } else {
_isVisitorRegistered = true;
visitorAlreadyRegistered.add(false); visitorAlreadyRegistered.add(false);
return _model.textController2.text.isEmpty return _model.textController2.text.isEmpty
? const SizedBox() ? const SizedBox()
@ -334,119 +368,79 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsetsDirectional.fromSTEB(
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0), 24.0, 0.0, 24.0, 10.0),
child: Container( child: Column(
width: MediaQuery.sizeOf(context).width * 0.95, children: [
decoration: const BoxDecoration(), FlutterFlowDropDown<String>(
child: Column( controller: _model.dropDownValueController ??=
children: [ FormFieldController<String>(null),
Row( options: [
mainAxisSize: MainAxisSize.min, FFLocalizations.of(context).getText(
mainAxisAlignment: MainAxisAlignment.start, 'n8vddmcq' /* Visitante */,
children: [
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 7.0),
child: Text(
FFLocalizations.of(context).getText(
'yp23q90m' /* Selecione o tipo: */,
),
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodyMediumFamily,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
),
),
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 5.0),
child: FlutterFlowDropDown<String>(
controller: _model.dropDownValueController ??=
FormFieldController<String>(null),
options: [
FFLocalizations.of(context).getText(
'n8vddmcq' /* Visitante */,
),
FFLocalizations.of(context).getText(
'9luaa09e' /* Prestador de Serviço */,
)
],
onChanged: (val) =>
setState(() => _model.dropDownValue = val),
width: 200.0,
height: 44.0,
textStyle: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodyMediumFamily,
color: FlutterFlowTheme.of(context)
.primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
hintText: FFLocalizations.of(context).getText(
'pmezihb4' /* Selecione... */,
),
icon: Icon(
Icons.keyboard_arrow_down_rounded,
color:
FlutterFlowTheme.of(context).primaryText,
size: 24.0,
),
elevation: 2.0,
borderColor:
FlutterFlowTheme.of(context).customColor6,
borderWidth: 0.5,
borderRadius: 8.0,
margin: const EdgeInsetsDirectional.fromSTEB(
16.0, 0.0, 16.0, 0.0),
hidesUnderline: true,
isOverButton: true,
isSearchable: false,
isMultiSelect: false,
),
),
]
.divide(const SizedBox(width: 19.0))
.addToStart(const SizedBox(width: 30.0)),
),
if (_model.dropDownValue == null ||
_model.dropDownValue == '')
Align(
alignment: const AlignmentDirectional(0.4, 0),
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'This field is required',
ptText: 'Este campo é obrigatório',
),
style: FlutterFlowTheme.of(context)
.bodySmall
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodySmallFamily,
color: FlutterFlowTheme.of(context)
.customColor6,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodySmallFamily),
)),
), ),
], FFLocalizations.of(context).getText(
), '9luaa09e' /* Prestador de Serviço */,
)
],
onChanged: (val) =>
setState(() => _model.dropDownValue = val),
width: MediaQuery.sizeOf(context).width * 0.9,
// height: 44.0,
textStyle: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily:
FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily),
),
hintText: FFLocalizations.of(context).getText(
'pmezihb4' /* Selecione... */,
),
icon: Icon(
Icons.keyboard_arrow_down_rounded,
color: FlutterFlowTheme.of(context).primaryText,
size: 24.0,
),
elevation: 2.0,
borderColor: FlutterFlowTheme.of(context).customColor6,
borderWidth: 0.5,
borderRadius: 8.0,
margin: const EdgeInsetsDirectional.fromSTEB(
16.0, 0.0, 16.0, 0.0),
hidesUnderline: true,
isOverButton: true,
isSearchable: false,
isMultiSelect: false,
),
if (_model.dropDownValue == null ||
_model.dropDownValue == '')
Align(
alignment: const AlignmentDirectional(0.4, 0),
child: Text(
FFLocalizations.of(context).getVariableText(
enText: 'This field is required',
ptText: 'Este campo é obrigatório',
),
style: FlutterFlowTheme.of(context)
.bodySmall
.override(
fontFamily: FlutterFlowTheme.of(context)
.bodySmallFamily,
color: FlutterFlowTheme.of(context)
.customColor6,
letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodySmallFamily),
)),
),
],
), ),
), ),
Builder( Builder(
@ -491,10 +485,11 @@ class _RegisiterVistorTemplateComponentWidgetState
allowPhoto: true, allowPhoto: true,
includeDimensions: true, includeDimensions: true,
); );
if (selectedMedia != null && if (selectedMedia != null) {
selectedMedia.every((m) => // &&
validateFileFormat( // selectedMedia.every((m) =>
m.storagePath, context))) { // validateFileFormat(
// m.storagePath, context))) {
setState(() => _model.isDataUploading = true); setState(() => _model.isDataUploading = true);
var selectedUploadedFiles = var selectedUploadedFiles =
<FFUploadedFile>[]; <FFUploadedFile>[];
@ -793,12 +788,7 @@ class _RegisiterVistorTemplateComponentWidgetState
padding: padding:
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ?? onPressed: _isFormValid(context)
false)) &&
(_model.textController1.text != '') &&
(_model.dropDownValue != null &&
_model.dropDownValue != '') &&
(_model.textController2.text != ''))
? () async { ? () async {
log(visitorAlreadyRegistered.value.toString()); log(visitorAlreadyRegistered.value.toString());
if (visitorAlreadyRegistered.value == true) { if (visitorAlreadyRegistered.value == true) {

View File

@ -99,8 +99,9 @@ class _SignInTemplateComponentWidgetState
super.dispose(); super.dispose();
} }
bool _isFormInvalid() { bool _isFormInvalid() {
if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') { if (_model.emailAddressTextController.text == '' ||
_model.passwordTextController.text == '') {
return true; return true;
} }
@ -185,7 +186,8 @@ class _SignInTemplateComponentWidgetState
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155), child: const AtomImageSvgTheme(
filename: 'login', width: 600, height: 155),
), ),
), ),
Column( Column(
@ -697,26 +699,37 @@ class _SignInTemplateComponentWidgetState
.fromSTEB(0.0, 0.0, .fromSTEB(0.0, 0.0,
0.0, 16.0), 0.0, 16.0),
child: FFButtonWidget( child: FFButtonWidget(
onPressed: _isFormInvalid() onPressed:
? null _isFormInvalid()
: () async { ? null
try { : () async {
await action_blocks try {
.singInLoginAction( await action_blocks
context, .singInLoginAction(
emailAdress: _model context,
.emailAddressTextController emailAdress: _model
.text, .emailAddressTextController
password: _model .text,
.passwordTextController password: _model
.text, .passwordTextController
); .text,
setState(() {}); );
} catch (e, s) { setState(
await DialogUtil.errorDefault(context); () {});
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s); } catch (e, s) {
} await DialogUtil
}, .errorDefault(
context);
LogUtil.requestAPIFailed(
'login.php',
_model
.emailAddressTextController
.text,
"Login",
e,
s);
}
},
text: FFLocalizations.of( text: FFLocalizations.of(
context) context)
.getText( .getText(
@ -773,7 +786,8 @@ class _SignInTemplateComponentWidgetState
const Color( const Color(
0xE81AAB5F), 0xE81AAB5F),
), ),
showLoadingIndicator: true, showLoadingIndicator:
true,
), ),
), ),
), ),
@ -866,15 +880,20 @@ class _SignInTemplateComponentWidgetState
onTap: () async { onTap: () async {
await showModalBottomSheet( await showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor:
Colors.transparent,
context: context, context: context,
builder: (context) { builder: (context) {
return Padding( return Padding(
padding: MediaQuery.viewInsetsOf(context), padding:
child: const ForgotPasswordTemplateComponentWidget(), MediaQuery.viewInsetsOf(
context),
child:
const ForgotPasswordTemplateComponentWidget(),
); );
}, },
).then((value) => safeSetState(() {})); ).then(
(value) => safeSetState(() {}));
}, },
child: RichText( child: RichText(
textScaler: MediaQuery.of(context) textScaler: MediaQuery.of(context)

View File

@ -11,7 +11,7 @@ import 'package:video_player/video_player.dart';
import 'flutter_flow_theme.dart'; import 'flutter_flow_theme.dart';
import 'flutter_flow_util.dart'; import 'flutter_flow_util.dart';
const allowedFormats = {'image/png', 'image/jpeg', 'video/mp4', 'image/gif'}; const allowedFormats = {'image/png', 'image/jpeg'};
class SelectedFile { class SelectedFile {
const SelectedFile({ const SelectedFile({