fix: add form validador
This commit is contained in:
parent
f6bc7ecf6a
commit
8eeda2d54b
|
@ -52,8 +52,8 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
required bool allowPhoto,
|
||||
bool allowVideo = false,
|
||||
String pickerFontFamily = 'Roboto',
|
||||
Color textColor = const Color(0xFF111417),
|
||||
Color backgroundColor = const Color(0xFFF5F5F5),
|
||||
// Color textColor = const Color(0xFF111417),
|
||||
// Color backgroundColor = const Color(0xFFF5F5F5),
|
||||
bool includeDimensions = false,
|
||||
bool includeBlurHash = false,
|
||||
}) async {
|
||||
|
@ -63,12 +63,12 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.getFont(
|
||||
pickerFontFamily,
|
||||
color: textColor,
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
tileColor: backgroundColor,
|
||||
tileColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
dense: false,
|
||||
onTap: () => Navigator.pop(
|
||||
context,
|
||||
|
@ -77,7 +77,7 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
);
|
||||
final mediaSource = await showModalBottomSheet<MediaSource>(
|
||||
context: context,
|
||||
backgroundColor: backgroundColor,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
builder: (context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -91,13 +91,13 @@ Future<List<SelectedFile>?> selectMediaWithSourceBottomSheet({
|
|||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.getFont(
|
||||
pickerFontFamily,
|
||||
color: textColor.withOpacity(0.65),
|
||||
color: FlutterFlowTheme.of(context).primaryText.withOpacity(0.65),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
tileColor: backgroundColor,
|
||||
dense: false,
|
||||
tileColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
dense: true,
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
|
|
|
@ -17,10 +17,28 @@ class RegisterVisitorPageModel
|
|||
FocusNode? textFieldFocusNode1;
|
||||
TextEditingController? textController1;
|
||||
String? Function(BuildContext, String?)? textController1Validator;
|
||||
String? _textController1Validator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// State field(s) for TextField widget.
|
||||
FocusNode? textFieldFocusNode2;
|
||||
TextEditingController? textController2;
|
||||
String? Function(BuildContext, String?)? textController2Validator;
|
||||
String? _textController2Validator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// State field(s) for DropDown widget.
|
||||
String? dropDownValue;
|
||||
FormFieldController<String>? dropDownValueController;
|
||||
|
@ -28,17 +46,56 @@ class RegisterVisitorPageModel
|
|||
FocusNode? textFieldFocusNode3;
|
||||
TextEditingController? textController3;
|
||||
String? Function(BuildContext, String?)? textController3Validator;
|
||||
String? _textController3Validator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// State field(s) for TextField widget.
|
||||
FocusNode? textFieldFocusNode4;
|
||||
TextEditingController? textController4;
|
||||
String? Function(BuildContext, String?)? textController4Validator;
|
||||
String? _textController4Validator(BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getVariableText(
|
||||
enText: 'This field is required',
|
||||
ptText: 'Este campo é obrigatório',
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// Stores action output result for [Custom Action - convertImageFileToBase64] action in Button widget.
|
||||
String? imgBase64;
|
||||
// Stores action output result for [Backend Call - API (postScheduleVisitor)] action in Button widget.
|
||||
ApiCallResponse? scheduleVisitor;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
void initState(BuildContext context) {
|
||||
|
||||
textFieldFocusNode1 = FocusNode();
|
||||
textController1 = TextEditingController();
|
||||
textController1Validator = _textController1Validator;
|
||||
|
||||
textFieldFocusNode2 = FocusNode();
|
||||
textController2 = TextEditingController();
|
||||
textController2Validator = _textController2Validator;
|
||||
|
||||
|
||||
dropDownValue = '';
|
||||
// dropDownValueController = FormFieldController<String>(initialValue: dropDownValue);
|
||||
|
||||
textFieldFocusNode3 = FocusNode();
|
||||
textController3 = TextEditingController();
|
||||
textController3Validator = _textController3Validator;
|
||||
|
||||
textFieldFocusNode4 = FocusNode();
|
||||
textController4 = TextEditingController();
|
||||
textController4Validator = _textController4Validator;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue