92 lines
3.0 KiB
Dart
92 lines
3.0 KiB
Dart
import '/flutter_flow/flutter_flow_util.dart';
|
|
import 'sign_up_page_widget.dart' show SignUpPageWidget;
|
|
import 'package:flutter/material.dart';
|
|
|
|
class SignUpPageModel extends FlutterFlowModel<SignUpPageWidget> {
|
|
/// State fields for stateful widgets in this page.
|
|
|
|
final unfocusNode = FocusNode();
|
|
final formKey = GlobalKey<FormState>();
|
|
// State field(s) for nameRegisterForm widget.
|
|
FocusNode? nameRegisterFormFocusNode;
|
|
TextEditingController? nameRegisterFormTextController;
|
|
String? Function(BuildContext, String?)?
|
|
nameRegisterFormTextControllerValidator;
|
|
String? _nameRegisterFormTextControllerValidator(
|
|
BuildContext context, String? val) {
|
|
if (val == null || val.isEmpty) {
|
|
return FFLocalizations.of(context).getText(
|
|
'iv6d5xk3' /* Campo é necessário */,
|
|
);
|
|
}
|
|
|
|
if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) {
|
|
return 'Must start with a letter and can only contain letters, digits and - or _.';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// State field(s) for emailRegisterForm widget.
|
|
FocusNode? emailRegisterFormFocusNode;
|
|
TextEditingController? emailRegisterFormTextController;
|
|
String? Function(BuildContext, String?)?
|
|
emailRegisterFormTextControllerValidator;
|
|
String? _emailRegisterFormTextControllerValidator(
|
|
BuildContext context, String? val) {
|
|
if (val == null || val.isEmpty) {
|
|
return FFLocalizations.of(context).getText(
|
|
'w3nl41ps' /* Campo é necessário */,
|
|
);
|
|
}
|
|
|
|
if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) {
|
|
return 'Has to be a valid email address.';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
// State field(s) for passwordRegisterForm widget.
|
|
FocusNode? passwordRegisterFormFocusNode;
|
|
TextEditingController? passwordRegisterFormTextController;
|
|
late bool passwordRegisterFormVisibility;
|
|
String? Function(BuildContext, String?)?
|
|
passwordRegisterFormTextControllerValidator;
|
|
String? _passwordRegisterFormTextControllerValidator(
|
|
BuildContext context, String? val) {
|
|
if (val == null || val.isEmpty) {
|
|
return FFLocalizations.of(context).getText(
|
|
'ql1bxvno' /* Campo é necessário */,
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
// Stores action output result for [Action Block - signUpRegisterAction] action in SignUpButtonRegisterForm widget.
|
|
bool? signUp;
|
|
|
|
@override
|
|
void initState(BuildContext context) {
|
|
nameRegisterFormTextControllerValidator =
|
|
_nameRegisterFormTextControllerValidator;
|
|
emailRegisterFormTextControllerValidator =
|
|
_emailRegisterFormTextControllerValidator;
|
|
passwordRegisterFormVisibility = false;
|
|
passwordRegisterFormTextControllerValidator =
|
|
_passwordRegisterFormTextControllerValidator;
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
unfocusNode.dispose();
|
|
nameRegisterFormFocusNode?.dispose();
|
|
nameRegisterFormTextController?.dispose();
|
|
|
|
emailRegisterFormFocusNode?.dispose();
|
|
emailRegisterFormTextController?.dispose();
|
|
|
|
passwordRegisterFormFocusNode?.dispose();
|
|
passwordRegisterFormTextController?.dispose();
|
|
}
|
|
}
|