diff --git a/lib/config/const_variable.dart b/lib/config/const_variable.dart index 8105edf..a5c1f02 100644 --- a/lib/config/const_variable.dart +++ b/lib/config/const_variable.dart @@ -11,10 +11,7 @@ class ConstVariable{ IconThemeData iconThemeDataDefault = IconThemeData(color: Colors.white); double fontSizeInput = 15; double fontSizeTitleAppBar = 20; - List RGUF = ['AC','AI','AL','AM','AN','AP','AS','BA','BY','CA','CB','CE','CH','CN','CO','DC','DF','ES','GD','GO','GU', - 'HU','IL','LA','LE','LI','LO','LT','MA','MG','MO','MS','MT','NB','NE','NW','NT','NY','OH','OU','PA','PB', - 'PE','PI','PO','PR','QH','RJ','RM','RN','RO','RR','RN','RO','RR','RS','SC','SE','SF','SJ','SP','TA','TO', - 'VC','XX','ZU','-','--','']; + List RGUF = ['AC','AL','AP','AM','BA','CE','DF','ES','GO','MA','MT','MS','MG','PA','PB','PR','PE','PI','RJ','RN','RS','RO','RR','SC','SP','SE','TO',]; List itensProceduresStart = [ 'ATEND. INDIVIDUAL', 'VISTA DOMICILIAR' diff --git a/lib/screens/registers_citizen/register_citizen_screen.dart b/lib/screens/registers_citizen/register_citizen_screen.dart index e1ca6bf..0b6b1df 100644 --- a/lib/screens/registers_citizen/register_citizen_screen.dart +++ b/lib/screens/registers_citizen/register_citizen_screen.dart @@ -7,7 +7,6 @@ import 'package:rkm/config/const_variable.dart'; import 'package:rkm/models/pais_modelo.dart'; import 'package:rkm/widgets/alert_dialog_default.dart'; import 'package:rkm/widgets/button_default.dart'; -import 'package:rkm/widgets/dropdown_button_com_pesquisa.dart'; import 'package:rkm/widgets/dropdown_button_com_pesquisa_paises.dart'; import 'package:rkm/widgets/title_containers.dart'; import 'package:sqflite/sqflite.dart'; @@ -87,6 +86,8 @@ class _RegisterCitizenScreenState extends State { var dateDeathController = TextEditingController(); String checkCNS = ''; String checkCPF = ''; + String checkEmail = ''; + String checkCEP = ''; String? selectTypeCertificate; int? selectTypeCertificateCod; String? selectCTPSUF; @@ -360,8 +361,8 @@ class _RegisterCitizenScreenState extends State { selectCountry==null || date == 'Data de Nascimento'|| cityBirthController.text.isEmpty || - messageDDDController.text.isEmpty || - messageController.text.isEmpty || + mobileDDDController.text.isEmpty || + mobileController.text.isEmpty || checkMother || checkFather || checkClassification|| @@ -387,7 +388,7 @@ class _RegisterCitizenScreenState extends State { } } } - +//sdsafdsf saveCitizen()async{ print('NISController.text'); print(NISController.text); @@ -426,7 +427,7 @@ class _RegisterCitizenScreenState extends State { 'ID_LOGR_TIPO' : idTipo, 'NOME_LOGR' : selectStreet, 'CEP_LOGR' : cepController.text.isNotEmpty?int.parse(cepController.text):0, - 'NUMERO_LOGR' : numberController.text.isNotEmpty && numberController.text!='N/A'?int.parse(numberController.text):0, + 'NUMERO_LOGR' : numberController.text.isNotEmpty && numberController.text!='S/N'?int.parse(numberController.text):0, 'LOTEAMENTO_LOGR' : selectSubdivision, 'COMPL_LOGR' : complementController.text, 'PONTO_REFERENCIA' : referencePointController.text, @@ -892,6 +893,7 @@ class _RegisterCitizenScreenState extends State { enabled: enableSpouse, onChanged: (v)=>setState((){}), ), + selectMaritalStatus=='CASADO(A)'&& enableSpouse && mandatory?ErrorDefault():Container(), DropdownWithSubtitle( list: ConstVariable().listNationality, subtitle: 'Naturalidade', @@ -910,7 +912,7 @@ class _RegisterCitizenScreenState extends State { }else{ selectNaturalityCod = 3; } - cityBirthController.text = 'MUNICIPIO IGNORADO - SP'; + cityBirthController.text = 'MUNICIPIO IGNORADO'; }else{ cityBirthController.text = ''; selectNaturalityCod = 1; @@ -967,7 +969,7 @@ class _RegisterCitizenScreenState extends State { ], ), GestureDetector( - onTap: cityBirthController.text == 'MUNICIPIO IGNORADO - SP' || edit?null:(){ + onTap: cityBirthController.text == 'MUNICIPIO IGNORADO' || edit?null:(){ searchCityController.text = ''; searchCityBirthController.text = ''; searchCity('birth'); @@ -1125,6 +1127,7 @@ class _RegisterCitizenScreenState extends State { enabled: !enableMother && !edit, onChanged: (v)=>setState((){}), ), + !enableMother&& mandatory?ErrorDefault():Container(), SwitchWithSubtitle( width: width*0.65, title: 'Desconhece Mãe', @@ -1150,6 +1153,7 @@ class _RegisterCitizenScreenState extends State { enabled: !enableFather && !edit, onChanged: (v)=>setState((){}), ), + !enableFather&& mandatory?ErrorDefault():Container(), SwitchWithSubtitle( width: width*0.65, title: 'Desconhece Pai', @@ -1310,9 +1314,9 @@ class _RegisterCitizenScreenState extends State { hintDropdown: 'Pais de Residência', onChanged:selectClassification!='OUTRO MUNICIPIO'?null:(value){ setState(() { - selectCountry = value; - if(selectCountry=='OUTRO'){ - cityController.text= 'MUNICIPIO IGNORADO - SP'; + selectPaisResidencia = value; + if(selectPaisResidencia=='OUTRO'){ + cityController.text= 'MUNICIPIO IGNORADO'; resultListResid = [{"ID_MUNICIPIO":1,"CODIGO_IBGE":"000000","NO_MUNICIPIO":"MUNICIPIO IGNORADO","UF_ESTADO":"--","ID_PAIS":33}]; codIBGEController.text = '000000'; numberController.clear(); @@ -1342,7 +1346,7 @@ class _RegisterCitizenScreenState extends State { ), selectCountry==null&& mandatory?ErrorDefault():Container(), GestureDetector( - onTap: selectClassification!='OUTRO MUNICIPIO'|| cityController.text == 'MUNICIPIO IGNORADO - SP'?null: (){ + onTap: selectClassification!='OUTRO MUNICIPIO'|| cityController.text == 'MUNICIPIO IGNORADO'?null: (){ searchCityController.text = ''; searchCityBirthController.text = ''; searchCity('city'); @@ -1502,8 +1506,24 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.2, hintInput: 'Escreva aqui', mandatory: mandatory, + maxLength: 10, enabled: selectClassification!='OUTRO MUNICIPIO' && !edit?true:false, - onChanged: (v)=>setState((){}), + textInputType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + CepInputFormatter() + ], + onChanged: (v){ + if(cepController.text.length==10){ + checkCEP = ''; + }else{ + checkCEP = 'CEP incompleto'; + } + setState((){}); + }, + ), + checkCEP==''?Container():Container( + width: width*0.7,child: TextDefault(text: checkCEP,fontSize: 15,color: ColorPalette.red,) ), Container( width: width*0.7, @@ -1528,7 +1548,7 @@ class _RegisterCitizenScreenState extends State { setState(() { checkBoxNumber = value!; if(checkBoxNumber){ - numberController.text = 'N/A'; + numberController.text = 'S/N'; }else{ numberController.clear(); } @@ -1666,11 +1686,12 @@ class _RegisterCitizenScreenState extends State { hintInput: 'Escreva aqui', maxLength: 3, enabled: !edit, - mandatory: false, + mandatory: mandatory, textInputType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly,], onChanged: (v)=>setState((){}), ), + selectDeficiency==null&& mandatory?ErrorDefault():Container(), InputWithSubtitle( controller: mobileController, subtitle: 'Celular (Só Números)', @@ -1681,11 +1702,12 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', enabled: !edit, - mandatory: false, + mandatory: mandatory, textInputType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly,], onChanged: (v)=>setState((){}), ), + selectDeficiency==null&& mandatory?ErrorDefault():Container(), InputWithSubtitle( controller: messageDDDController, subtitle: 'Recado - DDD', @@ -1696,7 +1718,6 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', enabled: !edit, - mandatory: mandatory, textInputType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly,], onChanged: (v)=>setState((){}), @@ -1711,7 +1732,6 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', enabled: !edit, - mandatory: mandatory, textInputType: TextInputType.number, inputFormatters: [FilteringTextInputFormatter.digitsOnly,], onChanged: (v)=>setState((){}), @@ -1727,8 +1747,18 @@ class _RegisterCitizenScreenState extends State { mandatory: false, enabled: !edit, textInputType: TextInputType.emailAddress, - onChanged: (v)=>setState((){}), + onChanged: (v){ + if(emailController.text.contains('@') && emailController.text.contains('.')){ + checkEmail = ''; + }else{ + checkEmail = 'E-mail incompleto'; + } + setState((){}); + }, ), + checkEmail==''?Container():Container( + width: width*0.7,child: TextDefault(text: checkEmail,fontSize: 15,color: ColorPalette.red,) + ) ], ), ), @@ -2068,6 +2098,10 @@ class _RegisterCitizenScreenState extends State { mandatory: false, enabled: !edit, onChanged: (v)=>setState((){}), + textInputType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], ), InputWithSubtitle( controller: numberCTPSController, diff --git a/lib/widgets/dropdown_button_com_pesquisa_paises.dart b/lib/widgets/dropdown_button_com_pesquisa_paises.dart index ced3a50..1cd0e56 100644 --- a/lib/widgets/dropdown_button_com_pesquisa_paises.dart +++ b/lib/widgets/dropdown_button_com_pesquisa_paises.dart @@ -1,10 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:rkm/models/pais_modelo.dart'; -import 'package:rkm/widgets/text_default.dart'; import '../config/color_palette.dart'; import '../config/const_variable.dart'; -import 'input_search_text.dart'; class DropDownButtonComPesquisaPaises extends StatelessWidget { var onChanged; diff --git a/pubspec.yaml b/pubspec.yaml index 0dfcdc8..5963220 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,8 @@ name: rkm description: RKM AB 2.0. #Cadastro e edição do Cadastro do Cidadão, Cadastro Individual, Cadastro Domiciliar e Visita Domiciliar +#versão 1.0.6+5 finalizada dia 19/02/2024 + publish_to: 'none' version: 1.0.6+5