Ajuste na validadão de dados do cidadão antes de salvar no banco de dados

This commit is contained in:
Reginaldo
2023-04-14 11:52:27 -03:00
parent aebd562347
commit 4a135901d4
2 changed files with 64 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ class InputWithSubtitle extends StatelessWidget {
TextInputType textInputType;
int maxLines;
Color colorBorder;
String typeInput;
InputWithSubtitle({
required this.subtitle,
@@ -28,6 +29,7 @@ class InputWithSubtitle extends StatelessWidget {
required this.widthSubtitle,
required this.widthInput,
required this.controller,
this.typeInput = 'normal',
this.enable = true,
this.mandatory = true,
this.textInputType = TextInputType.text,
@@ -63,7 +65,8 @@ class InputWithSubtitle extends StatelessWidget {
colorBorder: colorBorder,
onChanged: onChanged,
),
controller.text=='' &&(enable&&mandatory)?ErrorDefault(widthDefault: widthError,):Container(),
typeInput=='normal'&& controller.text=='' &&(enable&&mandatory)?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(),
typeInput!='normal'&&(enable&&mandatory)&& errorInput!=''?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(),
Divider(color: ColorPalette.black54,height: 5,endIndent: 10,)
],
);