ajustes de inputs com apenas numeros, mascaras, textos

This commit is contained in:
Reginaldo
2024-02-09 16:14:44 -03:00
parent a94bff8ebd
commit 8cf5569840
10 changed files with 176 additions and 79 deletions

View File

@@ -418,7 +418,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
'ID_LOGR_TIPO' : idTipo,
'NOME_LOGR' : selectStreet,
'CEP_LOGR' : cepController.text.isNotEmpty?int.parse(cepController.text):0,
'NUMERO_LOGR' : numberController.text.isNotEmpty?int.parse(numberController.text):0,
'NUMERO_LOGR' : numberController.text.isNotEmpty && numberController.text!='N/A'?int.parse(numberController.text):0,
'LOTEAMENTO_LOGR' : selectSubdivision,
'COMPL_LOGR' : complementController.text,
'PONTO_REFERENCIA' : referencePointController.text,
@@ -627,7 +627,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
observationController.text = widget.listData[0]['OBSERVACOES'];
CPFController.text = widget.listData[0]['CPF'].toString();
CNSController.text = widget.listData[0]['CNS'];
voterController.text = widget.listData[0]['TITULO_ELEITOR'].toString()??'';
voterController.text = widget.listData[0]['TITULO_ELEITOR']==null?'':widget.listData[0]['TITULO_ELEITOR'].toString()??'';
RGController.text = widget.listData[0]['RG_NUMERO'].toString()=='null'?'':widget.listData[0]['RG_NUMERO'].toString();
RGComplementController.text = widget.listData[0]['RG_COMPLEMENTO'].toString();
selectRGUF = widget.listData[0]['RG_UF']??'';
@@ -1464,7 +1464,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
setState(() {
checkBoxNumber = value!;
if(checkBoxNumber){
numberController.text = '0';
numberController.text = 'N/A';
}else{
numberController.clear();
}
@@ -1569,9 +1569,12 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
labelInput: 'Telefone - DDD',
widthInput: width*0.7,
widthSubtitle: width*0.7,
maxLength: 3,
hintInput: 'Escreva aqui',
enabled: !edit,
mandatory: false,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1579,11 +1582,14 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
subtitle: 'Telefone (Só Números)',
errorInput: 'Campo Obrigatório',
labelInput: 'Telefone(Só Números)',
maxLength: 8,
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
enabled: !edit,
mandatory: false,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1594,8 +1600,11 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
maxLength: 3,
enabled: !edit,
mandatory: false,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1603,11 +1612,14 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
subtitle: 'Celular (Só Números)',
errorInput: 'Campo Obrigatório',
labelInput: 'Celular (Só Números)',
maxLength: 9,
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
enabled: !edit,
mandatory: false,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1615,11 +1627,14 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
subtitle: 'Recado - DDD',
errorInput: 'Campo Obrigatório',
labelInput: 'Recado - DDD',
maxLength: 3,
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
enabled: !edit,
mandatory: mandatory,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1627,11 +1642,14 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
subtitle: 'Recado (Só Números)',
errorInput: 'Campo Obrigatório',
labelInput: 'Recado (Só Números)',
maxLength: 9,
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
enabled: !edit,
mandatory: mandatory,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1644,6 +1662,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
hintInput: 'Escreva aqui',
mandatory: false,
enabled: !edit,
textInputType: TextInputType.emailAddress,
onChanged: (v)=>setState((){}),
),
],
@@ -1719,7 +1738,13 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
mandatory: false,
maxLength: 14,
enabled: !edit,
textInputType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
CpfInputFormatter()
],
onChanged: (v)async{
if(CPFController.text.isNotEmpty){
checkCPF = await MainControllers().validaCPF(v,editing);
@@ -1740,8 +1765,11 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
maxLength: 15,
mandatory: false,
enabled: !edit,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)async{
//783107557570002
if(CNSController.text.isNotEmpty){
@@ -1772,11 +1800,14 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
subtitle: 'RG',
errorInput: 'Campo Obrigatório',
labelInput: 'RG',
maxLength: 8,
widthInput: width*0.7,
widthSubtitle: width*0.7,
hintInput: 'Escreva aqui',
mandatory: false,
enabled: !edit,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChanged: (v)=>setState((){}),
),
InputWithSubtitle(
@@ -1786,9 +1817,12 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
labelInput: 'RG - Complemento',
widthInput: width*0.7,
widthSubtitle: width*0.7,
maxLength: 1,
hintInput: 'Escreva aqui',
mandatory: false,
enabled: !edit,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChanged: (v)=>setState((){}),
),
DropdownWithSubtitle(
@@ -1981,6 +2015,8 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
hintInput: 'Escreva aqui',
mandatory: false,
enabled: !edit,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly,],
onChanged: (v)=>setState((){}),
),
DropdownWithSubtitle(