Merge branch 'fix/visitorRegister' into develop
This commit is contained in:
commit
614e55bb99
|
@ -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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<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>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
|
@ -14,13 +16,14 @@
|
|||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<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"/>
|
||||
<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>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-16" y="-40"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
|
|
@ -16,6 +16,8 @@ import 'package:google_fonts/google_fonts.dart';
|
|||
import 'forgot_password_template_component_model.dart';
|
||||
export 'forgot_password_template_component_model.dart';
|
||||
|
||||
//
|
||||
|
||||
class ForgotPasswordTemplateComponentWidget extends StatefulWidget {
|
||||
const ForgotPasswordTemplateComponentWidget({super.key});
|
||||
|
||||
|
@ -81,7 +83,8 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
tablet: false,
|
||||
))
|
||||
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(
|
||||
splashColor: Colors.transparent,
|
||||
focusColor: Colors.transparent,
|
||||
|
@ -103,20 +106,20 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
12.0, 0.0, 0.0, 0.0),
|
||||
child: Text(
|
||||
'',
|
||||
style:
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: const Color(0xFF15161E),
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -124,43 +127,46 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
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(
|
||||
FFLocalizations.of(context).getText(
|
||||
'xxm3ajsy' /* ESQUECEU 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'),
|
||||
),
|
||||
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),
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0),
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getText(
|
||||
'wu2f7yzo' /* Não se preucupe nós vamos te 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'),
|
||||
),
|
||||
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: 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(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
|
@ -169,7 +175,7 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.emailAddressTextController',
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
() => setState(() {}),
|
||||
),
|
||||
autofocus: true,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
|
@ -226,14 +232,14 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
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'),
|
||||
),
|
||||
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'),
|
||||
),
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
||||
|
@ -246,64 +252,73 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
Align(
|
||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
||||
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(
|
||||
onPressed: (_model.emailAddressTextController.text == '' || !ValidatorUtil.isValidEmail(_model.emailAddressTextController.text))
|
||||
onPressed: (_model.emailAddressTextController.text == '' ||
|
||||
!ValidatorUtil.isValidEmail(
|
||||
_model.emailAddressTextController.text))
|
||||
? null
|
||||
: () async {
|
||||
try {
|
||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||
email: _model.emailAddressTextController.text,
|
||||
);
|
||||
|
||||
try {
|
||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||
email: _model.emailAddressTextController.text,
|
||||
);
|
||||
if (PhpGroup.forgotPasswordCall
|
||||
.error((_model.req?.jsonBody ?? '')) ==
|
||||
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) {
|
||||
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 ?? ''))!);
|
||||
}
|
||||
|
||||
setState(() {});
|
||||
|
||||
} catch (error, stack) {
|
||||
LogUtil.requestAPIFailed("iforgot.php", _model.emailAddressTextController.text, "Recuperar Senha", error, 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(
|
||||
'74rnd5bu' /* 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),
|
||||
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: FlutterFlowTheme.of(context).primary,
|
||||
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'),
|
||||
),
|
||||
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,
|
||||
),
|
||||
disabledColor:
|
||||
FlutterFlowTheme.of(
|
||||
context)
|
||||
.customColor5,
|
||||
disabledTextColor:
|
||||
Colors.white,
|
||||
disabledColor: FlutterFlowTheme.of(context).customColor5,
|
||||
disabledTextColor: Colors.white,
|
||||
),
|
||||
showLoadingIndicator: true,
|
||||
),
|
||||
|
|
|
@ -44,6 +44,7 @@ class RegisiterVistorTemplateComponentModel
|
|||
atividade: 'getVisitante',
|
||||
documento: document,
|
||||
);
|
||||
|
||||
log('${response.jsonBody}');
|
||||
if (response.jsonBody['visitante']['VTE_ID'] != '0' &&
|
||||
response.jsonBody['error'] != 'false') {
|
||||
|
|
|
@ -38,6 +38,8 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
bool _isVisitorRegistered = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
@ -71,6 +73,35 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
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
|
||||
Widget build(BuildContext context) {
|
||||
BehaviorSubject<bool> visitorAlreadyRegistered = BehaviorSubject<bool>();
|
||||
|
@ -216,9 +247,12 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
} else if (snapshot.hasError ||
|
||||
snapshot.data == null ||
|
||||
snapshot.data == '') {
|
||||
// safeSetState(() => _isVisitorRegistered = false);
|
||||
_isVisitorRegistered = false;
|
||||
visitorAlreadyRegistered.add(true);
|
||||
return const SizedBox();
|
||||
} else {
|
||||
_isVisitorRegistered = true;
|
||||
visitorAlreadyRegistered.add(false);
|
||||
return _model.textController2.text.isEmpty
|
||||
? const SizedBox()
|
||||
|
@ -334,119 +368,79 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 10.0),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.95,
|
||||
decoration: const BoxDecoration(),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
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),
|
||||
)),
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
24.0, 0.0, 24.0, 10.0),
|
||||
child: Column(
|
||||
children: [
|
||||
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: 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(
|
||||
|
@ -491,10 +485,11 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
allowPhoto: true,
|
||||
includeDimensions: true,
|
||||
);
|
||||
if (selectedMedia != null &&
|
||||
selectedMedia.every((m) =>
|
||||
validateFileFormat(
|
||||
m.storagePath, context))) {
|
||||
if (selectedMedia != null) {
|
||||
// &&
|
||||
// selectedMedia.every((m) =>
|
||||
// validateFileFormat(
|
||||
// m.storagePath, context))) {
|
||||
setState(() => _model.isDataUploading = true);
|
||||
var selectedUploadedFiles =
|
||||
<FFUploadedFile>[];
|
||||
|
@ -793,12 +788,7 @@ class _RegisiterVistorTemplateComponentWidgetState
|
|||
padding:
|
||||
const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: (((_model.uploadedLocalFile.bytes?.isNotEmpty ??
|
||||
false)) &&
|
||||
(_model.textController1.text != '') &&
|
||||
(_model.dropDownValue != null &&
|
||||
_model.dropDownValue != '') &&
|
||||
(_model.textController2.text != ''))
|
||||
onPressed: _isFormValid(context)
|
||||
? () async {
|
||||
log(visitorAlreadyRegistered.value.toString());
|
||||
if (visitorAlreadyRegistered.value == true) {
|
||||
|
|
|
@ -99,8 +99,9 @@ class _SignInTemplateComponentWidgetState
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
bool _isFormInvalid() {
|
||||
if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') {
|
||||
bool _isFormInvalid() {
|
||||
if (_model.emailAddressTextController.text == '' ||
|
||||
_model.passwordTextController.text == '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -185,7 +186,8 @@ class _SignInTemplateComponentWidgetState
|
|||
decoration: const BoxDecoration(),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155),
|
||||
child: const AtomImageSvgTheme(
|
||||
filename: 'login', width: 600, height: 155),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
|
@ -697,26 +699,37 @@ class _SignInTemplateComponentWidgetState
|
|||
.fromSTEB(0.0, 0.0,
|
||||
0.0, 16.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: _isFormInvalid()
|
||||
? null
|
||||
: () async {
|
||||
try {
|
||||
await action_blocks
|
||||
.singInLoginAction(
|
||||
context,
|
||||
emailAdress: _model
|
||||
.emailAddressTextController
|
||||
.text,
|
||||
password: _model
|
||||
.passwordTextController
|
||||
.text,
|
||||
);
|
||||
setState(() {});
|
||||
} catch (e, s) {
|
||||
await DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed('login.php', _model.emailAddressTextController.text, "Login", e, s);
|
||||
}
|
||||
},
|
||||
onPressed:
|
||||
_isFormInvalid()
|
||||
? null
|
||||
: () async {
|
||||
try {
|
||||
await action_blocks
|
||||
.singInLoginAction(
|
||||
context,
|
||||
emailAdress: _model
|
||||
.emailAddressTextController
|
||||
.text,
|
||||
password: _model
|
||||
.passwordTextController
|
||||
.text,
|
||||
);
|
||||
setState(
|
||||
() {});
|
||||
} catch (e, s) {
|
||||
await DialogUtil
|
||||
.errorDefault(
|
||||
context);
|
||||
LogUtil.requestAPIFailed(
|
||||
'login.php',
|
||||
_model
|
||||
.emailAddressTextController
|
||||
.text,
|
||||
"Login",
|
||||
e,
|
||||
s);
|
||||
}
|
||||
},
|
||||
text: FFLocalizations.of(
|
||||
context)
|
||||
.getText(
|
||||
|
@ -773,7 +786,8 @@ class _SignInTemplateComponentWidgetState
|
|||
const Color(
|
||||
0xE81AAB5F),
|
||||
),
|
||||
showLoadingIndicator: true,
|
||||
showLoadingIndicator:
|
||||
true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -866,15 +880,20 @@ class _SignInTemplateComponentWidgetState
|
|||
onTap: () async {
|
||||
await showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
backgroundColor:
|
||||
Colors.transparent,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Padding(
|
||||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: const ForgotPasswordTemplateComponentWidget(),
|
||||
padding:
|
||||
MediaQuery.viewInsetsOf(
|
||||
context),
|
||||
child:
|
||||
const ForgotPasswordTemplateComponentWidget(),
|
||||
);
|
||||
},
|
||||
).then((value) => safeSetState(() {}));
|
||||
).then(
|
||||
(value) => safeSetState(() {}));
|
||||
},
|
||||
child: RichText(
|
||||
textScaler: MediaQuery.of(context)
|
||||
|
|
|
@ -11,7 +11,7 @@ import 'package:video_player/video_player.dart';
|
|||
import 'flutter_flow_theme.dart';
|
||||
import 'flutter_flow_util.dart';
|
||||
|
||||
const allowedFormats = {'image/png', 'image/jpeg', 'video/mp4', 'image/gif'};
|
||||
const allowedFormats = {'image/png', 'image/jpeg'};
|
||||
|
||||
class SelectedFile {
|
||||
const SelectedFile({
|
||||
|
|
Loading…
Reference in New Issue