diff --git a/lib/config/color_palette.dart b/lib/config/color_palette.dart index 5fd2bfe..3eb2325 100644 --- a/lib/config/color_palette.dart +++ b/lib/config/color_palette.dart @@ -4,9 +4,11 @@ class ColorPalette{ static const Color red = Colors.red; static const Color primary = Color(0xff89dbf7); static const Color appBar = Color(0xff387ef5); + static const Color edit = Color(0xff11bff1); static const Color secundary = Color(0xffcff1fc); static const Color border = Color(0xff78baf8); - static const Color gray = Color(0xffababab); + static const Color gray = Color(0xffbfbfbf); + static const Color disable = Color(0xffdedede); static const Color grayBackground = Color(0xffd1d1e3); static const Color titleContainer = Color(0xffdedede); static const Color buttonDisable = Color(0xfffafcbfb); diff --git a/lib/config/const_variable.dart b/lib/config/const_variable.dart index ae9bd0b..e844b21 100644 --- a/lib/config/const_variable.dart +++ b/lib/config/const_variable.dart @@ -15,7 +15,7 @@ class ConstVariable{ 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','-','--']; + 'VC','XX','ZU','-','--','']; List itensProceduresStart = [ 'ATENDIMENTO INDIVIDUAL', 'VISTA DOMICILIAR' diff --git a/lib/screens/registers_citizen/register_citizen_screen.dart b/lib/screens/registers_citizen/register_citizen_screen.dart index 75067d6..222efaf 100644 --- a/lib/screens/registers_citizen/register_citizen_screen.dart +++ b/lib/screens/registers_citizen/register_citizen_screen.dart @@ -137,6 +137,7 @@ class _RegisterCitizenScreenState extends State { List listMaritalStatus = []; String idUnidade = ''; String codSus = ''; + bool edit = false; escolherprazoInicio(BuildContext context,String type) async { @@ -539,7 +540,7 @@ class _RegisterCitizenScreenState extends State { enableFather = widget.listData[0]['DESCONHECE_PAI']==0?false:true; idUnidade = widget.listData[0]['ID_UNIDADE'].toString(); medicalRecordController.text = widget.listData[0]['NUM_PRONTUARIO']; - medicalRecordProvController.text = widget.listData[0]['NUM_PRONTUARIO_PROV'].toString(); + medicalRecordProvController.text = widget.listData[0]['NUM_PRONTUARIO_PROV'].toString()=='null'?'':widget.listData[0]['NUM_PRONTUARIO_PROV'].toString(); selectClassificationCOD = widget.listData[0]['CLASSIFICACAO']; if(selectClassificationCOD==1){ selectClassification = 'MUNICIPE'; @@ -569,7 +570,7 @@ class _RegisterCitizenScreenState extends State { selectTypeStreet = listTypeStreet[0]['NO_LOGR_TIPO']; cepController.text = listTypeStreet[0]['CEP_LOGR']??''; numberController.text = listTypeStreet[0]['NUMERO_LOGR']??''; - selectSubdivision = listTypeStreet[0]['LOTEAMENTO_LOGR']??''; + selectSubdivision = listTypeStreet[0]['LOTEAMENTO_LOGR']; subdivisionDB.add(selectSubdivision!); //aqui complementController.text = listTypeStreet[0]['COMPL_LOGR']??''; @@ -592,7 +593,7 @@ class _RegisterCitizenScreenState extends State { CPFController.text = widget.listData[0]['CPF'].toString(); CNSController.text = widget.listData[0]['CNS']; voterController.text = widget.listData[0]['TITULO_ELEITOR']??''; - RGController.text = widget.listData[0]['RG_NUMERO'].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']??''; RGOrganController.text = widget.listData[0]['RG_ORGAO']==null?'':widget.listData[0]['RG_ORGAO']; @@ -616,9 +617,9 @@ class _RegisterCitizenScreenState extends State { PISController.text = widget.listData[0]['NUM_PIS_PASEP'].toString()??''; enableCityCard = widget.listData[0]['FL_RETIROU_CARTAO'] == 'S'?true:false; NISController.text = widget.listData[0]['NUM_NIS'].toString()??''; - incomeController.text = widget.listData[0]['RENDA_MENSAL'].toString()??''; + incomeController.text = widget.listData[0]['RENDA_MENSAL']==null?'R\$ 0,00':widget.listData[0]['RENDA_MENSAL']; professionalController.text = widget.listData[0]['PROFISSAO']??''; - dateDeathController.text = widget.listData[0]['DT_OBITO']??''; + dateDeathController.text = widget.listData[0]['DT_OBITO']==null?'Data Óbito':widget.listData[0]['DT_OBITO']; enableBlocked = widget.listData[0]['BLOQUEIO']==1?true:false; setState(() {}); } @@ -636,6 +637,7 @@ class _RegisterCitizenScreenState extends State { loadLists(); if(widget.listData.length!=0){ getData(); + edit = true; } } @@ -675,7 +677,18 @@ class _RegisterCitizenScreenState extends State { padding: const EdgeInsets.all(8.0), child: Column( children: [ - ButtonDefault( + edit?ButtonDefault( + onPressed: (){ + setState(() { + edit = false; + }); + }, + title: 'Alterar', + borderColor: ColorPalette.edit, + background: ColorPalette.edit, + textColor: ColorPalette.white, + width: double.infinity, + ):ButtonDefault( onPressed: ()=>checkSave(), title: 'Salvar', borderColor: ColorPalette.appBar, @@ -719,6 +732,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -730,6 +744,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -740,7 +755,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged: edit?null:(value){ setState(() { selectGender = value!; }); @@ -751,18 +766,8 @@ class _RegisterCitizenScreenState extends State { width: width*0.75, child: Row( children: [ - // Padding( - // padding: const EdgeInsets.symmetric(horizontal: 5.0,vertical: 15), - // child: TextDefault( - // text: 'Data de Nascimento', - // color: ColorPalette.black54, - // fontWeigth: FontWeight.bold, - // fontSize: 18, - // ), - // ), - // Spacer(), GestureDetector( - onTap: ()=>escolherprazoInicio(context,'birth'), + onTap:edit?null: ()=>escolherprazoInicio(context,'birth'), child: Container( alignment: Alignment.centerLeft, height: 58, @@ -777,7 +782,7 @@ class _RegisterCitizenScreenState extends State { width: width*0.7, child: TextDefault( text: date, - color: ColorPalette.black54, + color: Colors.black, fontSize: 16, ), ), @@ -794,7 +799,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectMaritalStatus = value!; for(int i = 0;ConstVariable().listMaritalStatus.length >i;i++){ @@ -819,7 +824,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -830,7 +835,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectNaturality = value!; if(selectNaturality!='BRASILEIRO'){ @@ -849,7 +854,7 @@ class _RegisterCitizenScreenState extends State { ), selectNaturality==null?ErrorDefault():Container(), GestureDetector( - onTap: cityBirthController.text == 'MUNICIPIO IGNORADO - SP'?null:(){ + onTap: cityBirthController.text == 'MUNICIPIO IGNORADO - SP' || edit?null:(){ searchCityController.text = ''; searchCityBirthController.text = ''; searchCity('birth'); @@ -930,7 +935,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ), @@ -942,7 +947,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectBreed = value!; for(int i = 0;ConstVariable().listBreed.length >i;i++){ @@ -963,7 +968,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectScooling = value!; for(int i = 0;ConstVariable().listScooling.length >i;i++){ @@ -983,7 +988,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.6, widthDropdown: width*0.69, widthContainerDropdown: width*0.6, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectDeficiency = value!; for(int i = 0;ConstVariable().itensDeficiency.length >i;i++){ @@ -1004,14 +1009,14 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: !enableMother, + enabled: !enableMother && !edit, onChanged: (v)=>setState((){}), ), SwitchWithSubtitle( width: width*0.65, title: 'Desconhece Mãe', value: enableMother, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { enableMother = value; if(enableMother){ @@ -1028,14 +1033,14 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: !enableFather, + enabled: !enableFather && !edit, onChanged: (v)=>setState((){}), ), SwitchWithSubtitle( width: width*0.65, title: 'Desconhece Pai', value: enableFather, - onChanged: (value){ + onChanged: edit?null: (value){ setState(() { enableFather = value; if(enableFather){ @@ -1075,7 +1080,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1086,7 +1091,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1097,7 +1102,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1107,8 +1112,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Classificação', - onChanged: (value)async{ - + onChanged:edit?null: (value)async{ selectClassification = value; if(selectClassification=='OUTRO MUNICIPIO'){ selectClassificationCOD = 3; @@ -1155,6 +1159,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, mandatory: false, + enabled: !edit, hintInput: 'Escreva aqui', onChanged: (v)=>setState((){}), ), @@ -1303,7 +1308,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ), @@ -1315,7 +1320,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1325,7 +1330,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Bairro', - onChanged:selectClassification=='OUTRO MUNICIPIO'?null: (value)async{ + onChanged:selectClassification=='OUTRO MUNICIPIO' || edit?null: (value)async{ setState(() { selectVillage = value; selectTypeStreet = null; @@ -1345,7 +1350,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Tipo de Logradouro', - onChanged:selectClassification=='OUTRO MUNICIPIO' || selectVillage == null?null: (value)async{ + onChanged:selectClassification=='OUTRO MUNICIPIO' || selectVillage == null || edit?null: (value)async{ setState(() { selectTypeStreet = value; selectStreet = null; @@ -1365,7 +1370,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Nome do Logradouro', - onChanged:selectClassification=='OUTRO MUNICIPIO' || selectVillage == null?null: (value){ + onChanged:selectClassification=='OUTRO MUNICIPIO' || selectVillage == null || edit?null: (value){ setState(() { selectStreet = value; }); @@ -1381,7 +1386,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: selectClassification!='OUTRO MUNICIPIO'?true:false, + enabled: selectClassification!='OUTRO MUNICIPIO' && !edit?true:false, onChanged: (v)=>setState((){}), ), Container( @@ -1397,12 +1402,12 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.2, widthError: 0.4, hintInput: 'Escreva aqui', - enable: selectClassification!='OUTRO MUNICIPIO' && !checkBoxNumber?true:false, + enabled: selectClassification!='OUTRO MUNICIPIO' && !checkBoxNumber && !edit?true:false, onChanged: (v)=>setState((){}), ), Checkbox( value: checkBoxNumber, - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { checkBoxNumber = value!; if(checkBoxNumber){ @@ -1428,7 +1433,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Loteamento/Subdistrito', - onChanged: selectClassification=='OUTRO MUNICIPIO' || selectVillage == null?null:(value)async{ + onChanged: selectClassification=='OUTRO MUNICIPIO' || selectVillage == null || edit?null:(value)async{ setState(() { selectSubdivision = value; }); @@ -1445,6 +1450,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.2, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1456,6 +1462,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.2, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1465,7 +1472,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Zona', - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectZone = value; if(selectZone == 'URBANA'){ @@ -1510,6 +1517,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1521,6 +1529,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1532,6 +1541,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1543,6 +1553,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1554,6 +1565,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1564,6 +1576,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1575,6 +1588,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), ], @@ -1613,6 +1627,7 @@ class _RegisterCitizenScreenState extends State { hintInput: 'Escreva aqui', textInputType: TextInputType.multiline, maxLines: 5, + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1649,6 +1664,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)async{ if(CPFController.text.isNotEmpty){ checkCPF = await MainControllers().validaCPF(v); @@ -1670,6 +1686,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)async{ if(CNSController.text.isNotEmpty){ checkCNS = await MainControllers().validaCNS(v); @@ -1690,6 +1707,7 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), @@ -1702,6 +1720,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1713,6 +1732,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1722,7 +1742,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'RG - UF', - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectRGUF = value; }); @@ -1737,11 +1757,12 @@ class _RegisterCitizenScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', + enabled: !edit, mandatory: false, onChanged: (v)=>setState((){}), ), GestureDetector( - onTap: ()=>escolherprazoInicio(context,'rg'), + onTap:edit?null: ()=>escolherprazoInicio(context,'rg'), child: Container( alignment: Alignment.centerLeft, height: 58, @@ -1768,7 +1789,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'Tipo de certidão', - onChanged: (value){ + onChanged: edit?null:(value){ setState(() { selectTypeCertificate = value; for(int i = 0;ConstVariable().itensCertificate.length >i;i++){ @@ -1790,6 +1811,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1801,6 +1823,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1812,6 +1835,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1823,6 +1847,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1834,10 +1859,11 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), GestureDetector( - onTap: ()=>escolherprazoInicio(context,'cert'), + onTap:edit?null: ()=>escolherprazoInicio(context,'cert'), child: Container( alignment: Alignment.centerLeft, height: 58, @@ -1866,6 +1892,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -1877,6 +1904,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1886,7 +1914,7 @@ class _RegisterCitizenScreenState extends State { widthDropdown: width*0.69, widthContainerDropdown: width*0.6, hintDropdown: 'CTPS - UF', - onChanged: (value){ + onChanged:edit?null: (value){ setState(() { selectCTPSUF = value; }); @@ -1902,6 +1930,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), Container( @@ -1910,7 +1939,7 @@ class _RegisterCitizenScreenState extends State { children: [ TextDefault(text: 'Retirou cartão municipal da cidade?',fontSize: 15,color: Colors.black54), Spacer(), - Switch(value: enableCityCard, onChanged: (value)=>setState(()=>enableCityCard=value!) + Switch(value: enableCityCard, onChanged:edit?null: (value)=>setState(()=>enableCityCard=value!) ) ], ), @@ -1924,6 +1953,7 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), ], @@ -1960,6 +1990,7 @@ class _RegisterCitizenScreenState extends State { CentavosInputFormatter(moeda: true), ], controller: incomeController, + enabled: !edit, style: TextStyle( color: Colors.black, fontSize: 16, @@ -1999,10 +2030,11 @@ class _RegisterCitizenScreenState extends State { widthSubtitle: width*0.7, hintInput: 'Escreva aqui', mandatory: false, + enabled: !edit, onChanged: (v)=>setState((){}), ), GestureDetector( - onTap: ()=>escolherprazoInicio(context,'death'), + onTap:edit?null: ()=>escolherprazoInicio(context,'death'), child: Container( alignment: Alignment.centerLeft, height: 58, @@ -2028,7 +2060,7 @@ class _RegisterCitizenScreenState extends State { children: [ TextDefault(text: 'Bloqueado',fontSize: 15,color: ColorPalette.black54), Spacer(), - Switch(value: enableBlocked, onChanged: (value)=>setState(()=>enableBlocked=value!)), + Switch(value: enableBlocked, onChanged:edit?null: (value)=>setState(()=>enableBlocked=value!)), ], ), ) diff --git a/lib/screens/registers_citizen/register_home_screen.dart b/lib/screens/registers_citizen/register_home_screen.dart index 6d24028..bc73bd1 100644 --- a/lib/screens/registers_citizen/register_home_screen.dart +++ b/lib/screens/registers_citizen/register_home_screen.dart @@ -507,7 +507,7 @@ class _RegisterHomeScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ], diff --git a/lib/screens/registers_citizen/register_individual_screen.dart b/lib/screens/registers_citizen/register_individual_screen.dart index 0caf4dd..49f4bb8 100644 --- a/lib/screens/registers_citizen/register_individual_screen.dart +++ b/lib/screens/registers_citizen/register_individual_screen.dart @@ -258,7 +258,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -283,7 +283,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -294,7 +294,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -305,7 +305,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -316,7 +316,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -448,7 +448,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -569,7 +569,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.2, hintInput: 'Escreva aqui', - enable: enableSpouse, + enabled: enableSpouse, onChanged: (v)=>setState((){}), ), SwitchWithSubtitle( @@ -631,7 +631,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -800,7 +800,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -911,7 +911,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -922,7 +922,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ], @@ -988,7 +988,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), SwitchWithSubtitle( @@ -1038,7 +1038,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -1197,7 +1197,7 @@ class _RegisterIndividualScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ], diff --git a/lib/screens/select_service/service_home_screen.dart b/lib/screens/select_service/service_home_screen.dart index 67c52fc..1ca9a62 100644 --- a/lib/screens/select_service/service_home_screen.dart +++ b/lib/screens/select_service/service_home_screen.dart @@ -100,7 +100,7 @@ class _ServiceHomeScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -111,7 +111,7 @@ class _ServiceHomeScreenState extends State { widthInput: width*0.7, widthSubtitle: width*0.7, hintInput: 'Escreva aqui', - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( diff --git a/lib/screens/select_service/service_individual_screen.dart b/lib/screens/select_service/service_individual_screen.dart index 6ae658c..9163ac4 100644 --- a/lib/screens/select_service/service_individual_screen.dart +++ b/lib/screens/select_service/service_individual_screen.dart @@ -287,7 +287,7 @@ class _ServiceIndividualScreenState extends State { widthInput: width*0.7, controller: userResponsibleRegisterController, colorBorder: ColorPalette.white, - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -299,7 +299,7 @@ class _ServiceIndividualScreenState extends State { widthInput: width*0.7, controller: userUnitController, colorBorder: ColorPalette.white, - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), DropdownWithSubtitle( @@ -360,7 +360,7 @@ class _ServiceIndividualScreenState extends State { widthInput: width*0.7, controller: dumController, colorBorder: ColorPalette.white, - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), SwitchWithSubtitle( @@ -378,7 +378,7 @@ class _ServiceIndividualScreenState extends State { widthInput: width*0.7, controller: oldPregnancyController, colorBorder: ColorPalette.white, - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), InputWithSubtitle( @@ -390,7 +390,7 @@ class _ServiceIndividualScreenState extends State { widthInput: width*0.7, controller: childBirthsController, colorBorder: ColorPalette.white, - enable: false, + enabled: false, onChanged: (v)=>setState((){}), ), ], diff --git a/lib/widgets/dropdown_button_default.dart b/lib/widgets/dropdown_button_default.dart index ad1f644..db9e429 100644 --- a/lib/widgets/dropdown_button_default.dart +++ b/lib/widgets/dropdown_button_default.dart @@ -35,7 +35,7 @@ class DropDownButtonDefault extends StatelessWidget { child: DropdownButton( hint: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end), + child: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end,color: Colors.black,), ), value: select, items: list.map((value) => DropdownMenuItem( diff --git a/lib/widgets/input_text.dart b/lib/widgets/input_text.dart index b343a9f..b048312 100644 --- a/lib/widgets/input_text.dart +++ b/lib/widgets/input_text.dart @@ -10,7 +10,7 @@ class InputText extends StatelessWidget { String hint; double width; String label; - bool enable; + bool enabled; TextInputType textInputType; int maxLines; Color colorBorder; @@ -23,7 +23,7 @@ class InputText extends StatelessWidget { this.fontSize = 15.0, this.hint = '', this.label = '', - this.enable = true, + this.enabled = true, this.textInputType = TextInputType.text, this.maxLines = 1, this.colorBorder = ColorPalette.black54, @@ -33,7 +33,7 @@ class InputText extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: ColorPalette.white, + color: enabled?ColorPalette.white:ColorPalette.disable, margin: EdgeInsets.only(top: 5), width: width, child: TextFormField( @@ -68,9 +68,9 @@ class InputText extends StatelessWidget { borderRadius: BorderRadius.circular(3), ), hintText: this.hint, - enabled: enable, + enabled: enabled, hintStyle: TextStyle( - color: ColorPalette.gray, + color: Colors.black, fontSize: this.fontSize, ) ) diff --git a/lib/widgets/input_with_subtitle.dart b/lib/widgets/input_with_subtitle.dart index 4a47b65..e32ea4b 100644 --- a/lib/widgets/input_with_subtitle.dart +++ b/lib/widgets/input_with_subtitle.dart @@ -13,7 +13,7 @@ class InputWithSubtitle extends StatelessWidget { double widthError; var controller; var onChanged; - bool enable; + bool enabled; bool mandatory; TextInputType textInputType; int maxLines; @@ -29,7 +29,7 @@ class InputWithSubtitle extends StatelessWidget { required this.widthInput, required this.controller, this.typeInput = 'normal', - this.enable = true, + this.enabled = true, this.mandatory = true, this.textInputType = TextInputType.text, this.maxLines = 1, @@ -58,14 +58,14 @@ class InputWithSubtitle extends StatelessWidget { width: widthInput, hint: hintInput, label: labelInput, - enable: enable, + enabled: enabled, textInputType: textInputType, maxLines:maxLines, colorBorder: colorBorder, onChanged: onChanged, ), - typeInput=='normal'&& controller.text=='' &&(enable&&mandatory)?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(), - typeInput!='normal'&&(enable&&mandatory)&& errorInput!=''?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(), + typeInput=='normal'&& controller.text=='' &&(enabled&&mandatory)?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(), + typeInput!='normal'&&(enabled&&mandatory)&& errorInput!=''?ErrorDefault(widthDefault: widthError,error: errorInput,):Container(), Divider(color: ColorPalette.black54,height: 5,endIndent: 10,) ], );