criação dos dados na tela visita domiciliar
This commit is contained in:
@@ -67,6 +67,42 @@ class ConstVariable{
|
||||
'DST',
|
||||
];
|
||||
|
||||
List tipoVisitaModel = [
|
||||
'CADASTRAMENTO / ATUALIZAÇÃO',
|
||||
'VISITA PERIÓDICA'
|
||||
];
|
||||
|
||||
List outrosModel = [
|
||||
'EGRESSO DE INTERNAÇÃO',
|
||||
'CONVITE ATIVIDADES COLETIVAS/CAMPANHAS DE SAÚDE',
|
||||
'ORIENTAÇÃO/PREVENÇÃO',
|
||||
'OUTROS',
|
||||
];
|
||||
|
||||
List tipoAcompanhamentoModel = [
|
||||
'GESTANTE',
|
||||
'PUÉRPERA',
|
||||
'RECÉM-NASCIDO',
|
||||
'CRIANÇA',
|
||||
'PESSOA COM DESNUTRIÇÃO',
|
||||
'PESSOA EM REABILITAÇÃO OU COM DEFICIÊNCIA',
|
||||
'PESSOA COM HIPERTENSÃO',
|
||||
'PESSOA COM ASMA',
|
||||
'PESSOA COM DPOC/ENFISEMA',
|
||||
'PESSOA COM CÂNCER',
|
||||
'PESSOA COM OUTRAS DOENÇAS CRÔNICAS',
|
||||
'PESSOA COM HANSENÍASE',
|
||||
'PESSOA COM TUBERCULOSE',
|
||||
'SINTOMÁTICOS RESPIRATÓRIOS',
|
||||
'TABAGISTA',
|
||||
'DOMICILIADOS/ACAMADOS',
|
||||
'CONDIÇÕES DE VULNERABILIDADE SOCIAL',
|
||||
'CONDIÇÃO DO BOLSA FAMÍLIA',
|
||||
'SAÚDE MENTAL',
|
||||
'USUÁRIO DE ÁLCOOL',
|
||||
'USUÁRIO DE OUTRAS DROGAS',
|
||||
];
|
||||
|
||||
List serviceHomeCheckConditionlist = [
|
||||
'ACAMADO',
|
||||
'DOMICILIADO',
|
||||
@@ -238,6 +274,12 @@ class ConstVariable{
|
||||
DropDownDataModel(cod: 12,title: 'ESTABELECIMENTO RELIGIOSO'),
|
||||
DropDownDataModel(cod: 99,title: 'OUTROS'),
|
||||
];
|
||||
|
||||
List<DropDownDataModel> listDesfecho = [
|
||||
DropDownDataModel(cod: 1, title: 'VISITA REALIZADA'),
|
||||
DropDownDataModel(cod: 2, title: 'VISITA RECUSADA'),
|
||||
DropDownDataModel(cod: 3, title: 'AUSENTE'),
|
||||
];
|
||||
|
||||
List<DropDownDataModel> listSituationHome = [
|
||||
DropDownDataModel(cod: 1,title: 'PRÓPRIO'),
|
||||
|
||||
@@ -10,7 +10,6 @@ import '../screens/login/login_load_screen.dart';
|
||||
import '../screens/configurations/main_procedures_screen.dart';
|
||||
import '../screens/select_service/complementary_sheet_screen.dart';
|
||||
import '../screens/select_service/consumption_markers_screen.dart';
|
||||
import '../screens/select_service/home_visit_screen.dart';
|
||||
import '../screens/select_service/procedures_screen.dart';
|
||||
import '../screens/select_service/service_dental_screen.dart';
|
||||
import '../screens/select_service/service_individual_screen.dart';
|
||||
@@ -33,5 +32,4 @@ var routes = {
|
||||
'/complementary_sheet': (context) => ComplementarySheetScreen(),
|
||||
'/consumption_markers': (context) => ConsumptionMarkersScreen(),
|
||||
'/procedures': (context) => ProceduresScreen(),
|
||||
'/home_visit': (context) => HomeVisitScreen(),
|
||||
};
|
||||
@@ -1,15 +1,722 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
import '../../config/color_palette.dart';
|
||||
import '../../config/const_variable.dart';
|
||||
import '../../models/check_model.dart';
|
||||
import '../../service/db/db_querys.dart';
|
||||
import '../../service/db/db_sqlite_load.dart';
|
||||
import '../../service/shared_preferences/shared_preferences_service.dart';
|
||||
import '../../widgets/alert_dialog_default.dart';
|
||||
import '../../widgets/appbar_default.dart';
|
||||
import '../../widgets/button_default.dart';
|
||||
import '../../widgets/check_box_subtitle.dart';
|
||||
import '../../widgets/check_box_two_subtitle.dart';
|
||||
import '../../widgets/dropdown_with_subtitle.dart';
|
||||
import '../../widgets/error_default.dart';
|
||||
import '../../widgets/input_with_subtitle.dart';
|
||||
import '../../widgets/onbackbutton.dart';
|
||||
import '../../widgets/switch_with_subtitle.dart';
|
||||
import '../../widgets/text_default.dart';
|
||||
import '../../widgets/title_containers.dart';
|
||||
|
||||
class HomeVisitScreen extends StatefulWidget {
|
||||
const HomeVisitScreen({Key? key}) : super(key: key);
|
||||
String name;
|
||||
HomeVisitScreen({required this.name});
|
||||
|
||||
@override
|
||||
State<HomeVisitScreen> createState() => _HomeVisitScreenState();
|
||||
}
|
||||
|
||||
class _HomeVisitScreenState extends State<HomeVisitScreen> {
|
||||
|
||||
var PESO = TextEditingController();
|
||||
var ALTURA = TextEditingController();
|
||||
var NOME_PROFISSIONAL = TextEditingController();
|
||||
var CNES_UNIDADE = TextEditingController();
|
||||
var COMPLEMENTO = TextEditingController();
|
||||
|
||||
bool CNS_VALIDO = false;
|
||||
bool showCheckError = false;
|
||||
bool mandatory = false;
|
||||
|
||||
bool VISITA_ACOMPANHADA = false;
|
||||
bool CONSULTA = false;
|
||||
bool VACINA = false;
|
||||
bool EXAME = false;
|
||||
bool CONDICIONALIDADES = false;
|
||||
bool ACAO_EDUCATIVA = false;
|
||||
bool ACAO_MECANICA = false;
|
||||
bool IMOVEL_FOCO = false;
|
||||
bool TRATAMENTO_FOCAL = false;
|
||||
|
||||
String? TURNO;
|
||||
String? TIPO_IMOVEL;
|
||||
String? DESFECHO;
|
||||
String? CBO_PROFISSIONAL;
|
||||
String? INE_RESP_CADASTRO;
|
||||
|
||||
int TURNO_COD = 0;
|
||||
int TIPO_IMOVEL_COD = 0;
|
||||
int DESFECHO_COD = 0;
|
||||
int ID_PROFISSIONAL=0;
|
||||
int ID_CIDADAO=0;
|
||||
|
||||
String CD_USUARIO_SUS='';
|
||||
String idUnidade = '';
|
||||
String idUsuario = '';
|
||||
String date = '';
|
||||
String dateDB = '';
|
||||
List <String> typeTurnService = [];
|
||||
List <String> listTypeHome = [];
|
||||
List <String> listDesfecho = [];
|
||||
List <String>listCBO = [];
|
||||
List <String>listINEPROF = [];
|
||||
List<String> PROCEDIMENTOS_SIGTAP = [];
|
||||
List<CheckModel> tipoVisitaModel = [];
|
||||
List<CheckModel> tipoAcompanhamentoModel = [];
|
||||
List<CheckModel> outrosModel = [];
|
||||
List listProc = [];
|
||||
|
||||
escolherprazoInicio(BuildContext context) async {
|
||||
var pickDate = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: DateTime.now(),
|
||||
firstDate: DateTime(2022),
|
||||
lastDate: DateTime(2025));
|
||||
if (pickDate != null) {
|
||||
setState(() {
|
||||
dateDB = '${pickDate.year}-${pickDate.month<10?'0':''}${pickDate.month}-${pickDate.day<10?'0':''}${pickDate.day}';
|
||||
date = formatData(year: pickDate.year, month: pickDate.month, day: pickDate.day);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
String formatData({int? year, int? month, int? day}) {
|
||||
DateTime data = DateTime(year!, month!, day!);
|
||||
String formattedDate = DateFormat('dd/MM/yyyy').format(data);
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
getUsers()async{
|
||||
await DBQuerys().buscaCidadao(widget.name).then((list){
|
||||
ID_CIDADAO = list[0]['ID_CIDADAO'];
|
||||
CD_USUARIO_SUS = list[0]['CD_USUARIO_SUS'];
|
||||
});
|
||||
final PrefService _prefService = PrefService();
|
||||
_prefService.readCacheIdUsuario('idUsuario').then((value){
|
||||
if(value != null){
|
||||
idUsuario = value;
|
||||
loadData();
|
||||
}
|
||||
});
|
||||
_prefService.readCacheUnidade('idUnidade').then((value){
|
||||
if(value!=null){
|
||||
idUnidade = value[0];
|
||||
CNES_UNIDADE.text = value[1];
|
||||
}
|
||||
});
|
||||
await DBQuerys().buscaCBOProfissional(idUsuario).then((list){
|
||||
if(list.length!=0){
|
||||
for(int i = 0; list.length>i;i++){
|
||||
listCBO.add(list[i]['CODIGO_CBO'].toString());
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
List list = await DBQuerys().buscaDadosProfissional(idUnidade,idUsuario);
|
||||
for(int i=0; list.length > i;i++){
|
||||
INE_RESP_CADASTRO = 'INE: ${list[i]['INE']} / Área: ${list[i]['AREA']} - Microárea : ${list[i]['MICROAREA']}';
|
||||
listINEPROF.add('INE: ${list[i]['INE']} / Área: ${list[i]['AREA']} - Microárea : ${list[i]['MICROAREA']}');
|
||||
}
|
||||
var db = await DbSqliteLoad().intialDB();
|
||||
List listSIGTAP = await db.query('PROCEDIMENTOS_SIGTAP');
|
||||
for(int i = 0; listSIGTAP.length>i;i++){
|
||||
if(listSIGTAP[i]['COD_PROC_SIGTAP']!=null && listSIGTAP[i]['DESC_PROC_SIGTAP']!=null){
|
||||
print(listSIGTAP[i]['COD_PROC_SIGTAP']);
|
||||
print(listSIGTAP[i]['DESC_PROC_SIGTAP']);
|
||||
PROCEDIMENTOS_SIGTAP.add('${listSIGTAP[i]['COD_PROC_SIGTAP']} - ${listSIGTAP[i]['DESC_PROC_SIGTAP']}');
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
loadLists() {
|
||||
for (int i = 0; ConstVariable().typeTurnService.length > i; i++) {
|
||||
typeTurnService.add(ConstVariable().typeTurnService[i].title);
|
||||
}
|
||||
for (int i = 0; ConstVariable().listTypeHome.length > i; i++) {
|
||||
listTypeHome.add(ConstVariable().listTypeHome[i].title);
|
||||
}
|
||||
for (int i = 0; ConstVariable().listDesfecho.length > i; i++) {
|
||||
listDesfecho.add(ConstVariable().listDesfecho[i].title);
|
||||
}
|
||||
getUsers();
|
||||
}
|
||||
|
||||
loadData()async{
|
||||
await DBQuerys().buscaProfissionalCadInd(idUsuario).then((list){
|
||||
ID_PROFISSIONAL = list['ID_PROFISSIONAL'];
|
||||
NOME_PROFISSIONAL.text = list['NOME_PROFISSIONAL'];
|
||||
String CNS_PROFISSIONAL = list['CNS_PROFISSIONAL'];
|
||||
if(CNS_PROFISSIONAL == 999999999999999 || CNS_PROFISSIONAL == '999999999999999'){
|
||||
CNS_VALIDO = true;
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
checkSave()async{
|
||||
// adicionar depois e usar um usuário real
|
||||
// CBO_RESP_CADASTRO
|
||||
//ok
|
||||
if(date.isEmpty || dateDB.isEmpty || TIPO_IMOVEL_COD==0 || DESFECHO_COD ==0 || TURNO_COD == 0
|
||||
){
|
||||
print('erro');
|
||||
setState(() {
|
||||
showCheckError = true;
|
||||
mandatory = true;
|
||||
});
|
||||
}else{
|
||||
print('passou');
|
||||
setState(() {
|
||||
mandatory = false;
|
||||
showCheckError = false;
|
||||
saveHomeVisit();
|
||||
});
|
||||
}
|
||||
}
|
||||
saveHomeVisit(){
|
||||
Map<String, dynamic> row = {
|
||||
'ID_CIDADAO' : ID_CIDADAO,
|
||||
'CD_USUARIO_SUS' : CD_USUARIO_SUS,
|
||||
'DT_ATENDIMENTO' : dateDB,
|
||||
'TURNO' : TURNO_COD,
|
||||
'TIPO_IMOVEL' : TIPO_IMOVEL_COD,
|
||||
'VISITA_ACOMPANHADA' : VISITA_ACOMPANHADA?1:2,
|
||||
'DESFECHO' : DESFECHO_COD,
|
||||
'PESO' : PESO.text,
|
||||
'ALTURA' : ALTURA.text,
|
||||
'ID_PROFISSIONAL' : int.parse(idUsuario),
|
||||
'CBO_PROFISSIONAL' : CBO_PROFISSIONAL,
|
||||
'INE_PROFISSIONAL' : INE_PROFISSIONAL,
|
||||
'CNES_UNIDADE' : CNES_UNIDADE.text,
|
||||
'ID_UNIDADE' : int.parse(idUnidade),
|
||||
'ID_EQUIPE' : ID_EQUIPE,
|
||||
'COMPLEMENTO' : COMPLEMENTO.text,
|
||||
'SINCRONIZADO' : 'N',
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
loadLists();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(child: Text('Visita Domiciliar'),);
|
||||
double heigth = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: ()async=> await OnBackButton().onBackButton(context),
|
||||
child: Scaffold(
|
||||
appBar: AppBarDefault().appbar(context, 'RKM AB - Visita Domiciliar'),
|
||||
body: Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
decoration: ConstVariable().backgroundGradient,
|
||||
child: ListView(
|
||||
children: [
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
TitleContainers(title: 'Atendimento'),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: heigth*0.5,
|
||||
width: width*0.2,
|
||||
child: Icon(LineIcons.edit,size: 80,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width*0.7,
|
||||
child: TextDefault(
|
||||
textAlign: TextAlign.start,
|
||||
text: 'Data Atendimento',
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: ()=>escolherprazoInicio(context),
|
||||
child: Container(
|
||||
height: 50,
|
||||
margin: EdgeInsets.symmetric(horizontal: 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 8,vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: date.isEmpty?ColorPalette.disable:ColorPalette.white,
|
||||
border: Border.all(color: ColorPalette.white),
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
),
|
||||
width: width*0.7,
|
||||
child: TextDefault(
|
||||
text: date,
|
||||
color: Colors.black,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
date.isEmpty&& mandatory?ErrorDefault():Container(),
|
||||
DropdownWithSubtitle(
|
||||
list: typeTurnService,
|
||||
widthSubtitle: width*0.2,
|
||||
subtitle: 'Turno',
|
||||
hintDropdown: 'Turno',
|
||||
select: TURNO,
|
||||
widthDropdown: width*0.7,
|
||||
widthContainerDropdown: width*0.6,
|
||||
onChanged: (value){
|
||||
TURNO = value;
|
||||
for(int i = 0;ConstVariable().typeTurnService.length >i;i++){
|
||||
if(ConstVariable().typeTurnService[i].title == TURNO){
|
||||
TURNO_COD = ConstVariable().typeTurnService[i].cod;
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
),
|
||||
TURNO_COD ==0 && mandatory?ErrorDefault():Container(),
|
||||
DropdownWithSubtitle(
|
||||
list: listTypeHome,
|
||||
widthSubtitle: width*0.2,
|
||||
subtitle: 'Tipo de Imóvel',
|
||||
hintDropdown: 'Tipo de Imovél',
|
||||
select: TIPO_IMOVEL,
|
||||
widthDropdown: width*0.7,
|
||||
widthContainerDropdown: width*0.6,
|
||||
onChanged: (value){
|
||||
TIPO_IMOVEL = value;
|
||||
for(int i = 0;ConstVariable().listTypeHome.length >i;i++){
|
||||
if(ConstVariable().listTypeHome[i].title == TIPO_IMOVEL){
|
||||
TIPO_IMOVEL_COD = ConstVariable().listTypeHome[i].cod;
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
),
|
||||
TIPO_IMOVEL_COD ==0 && mandatory?ErrorDefault():Container(),
|
||||
SwitchWithSubtitle(
|
||||
width: width*0.7,
|
||||
title: 'Visita Acompanhada',
|
||||
value: VISITA_ACOMPANHADA,
|
||||
onChanged:(value){
|
||||
VISITA_ACOMPANHADA = value;
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
DropdownWithSubtitle(
|
||||
list: listDesfecho,
|
||||
widthSubtitle: width*0.2,
|
||||
subtitle: 'Desfecho',
|
||||
hintDropdown: 'Desfecho',
|
||||
select: DESFECHO,
|
||||
widthDropdown: width*0.7,
|
||||
widthContainerDropdown: width*0.6,
|
||||
onChanged: (value){
|
||||
DESFECHO = value;
|
||||
for(int i = 0;ConstVariable().listDesfecho.length >i;i++){
|
||||
if(ConstVariable().listDesfecho[i].title == DESFECHO){
|
||||
DESFECHO_COD = ConstVariable().listDesfecho[i].cod;
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
),
|
||||
DESFECHO_COD ==0 && mandatory?ErrorDefault():Container(),
|
||||
TitleContainers(title: 'Tipo da Visita',width: width*0.7,textAling: TextAlign.start,fontSize: 15),
|
||||
Container(
|
||||
width: width*0.7,
|
||||
height: heigth*0.1,
|
||||
child: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: ConstVariable().tipoVisitaModel.length,
|
||||
itemBuilder: (context,index){
|
||||
tipoVisitaModel.add(
|
||||
CheckModel(
|
||||
subtitle: ConstVariable().tipoVisitaModel[index],
|
||||
check: false
|
||||
)
|
||||
);
|
||||
return CheckBoxSubtitle(
|
||||
subtitle: tipoVisitaModel[index].subtitle,
|
||||
checkbox:tipoVisitaModel[index].check,
|
||||
width: width*0.6,
|
||||
onChanged: (value)=>setState(()=>tipoVisitaModel[index].check=value),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
TitleContainers(title: 'Busca Ativa',width: width*0.7,textAling: TextAlign.start,fontSize: 15),
|
||||
CheckBoxTwoSubtitle(
|
||||
width: width*0.7,
|
||||
checkbox1: CONSULTA,
|
||||
checkbox2: VACINA,
|
||||
subtitle1: 'CONSULTA',
|
||||
subtitle2: 'VACINA',
|
||||
onChanged1: (value)=>setState(()=>CONSULTA=value),
|
||||
onChanged2: (value)=>setState(()=>VACINA=value),
|
||||
),
|
||||
CheckBoxTwoSubtitle(
|
||||
width: width*0.7,
|
||||
checkbox1: EXAME,
|
||||
checkbox2: CONDICIONALIDADES,
|
||||
subtitle1: 'EXAME',
|
||||
subtitle2: 'CONDICIONALIDADES',
|
||||
onChanged1: (value)=>setState(()=>EXAME=value),
|
||||
onChanged2: (value)=>setState(()=>CONDICIONALIDADES=value),
|
||||
),
|
||||
TitleContainers(title: 'Controle Ambiental',width: width*0.7,textAling: TextAlign.start,fontSize: 15),
|
||||
CheckBoxTwoSubtitle(
|
||||
width: width*0.7,
|
||||
checkbox1: ACAO_EDUCATIVA,
|
||||
checkbox2: ACAO_MECANICA,
|
||||
subtitle1: 'AÇÃO EDUCATIVA',
|
||||
subtitle2: 'AÇÃO MECÂNICA',
|
||||
onChanged1: (value)=>setState(()=>ACAO_EDUCATIVA=value),
|
||||
onChanged2: (value)=>setState(()=>ACAO_MECANICA=value),
|
||||
),
|
||||
CheckBoxTwoSubtitle(
|
||||
width: width*0.7,
|
||||
checkbox1: IMOVEL_FOCO,
|
||||
checkbox2: TRATAMENTO_FOCAL,
|
||||
subtitle1: 'IMÓVEL COM FOCO',
|
||||
subtitle2: 'TRATAMENTO FOCAL',
|
||||
onChanged1: (value)=>setState(()=>IMOVEL_FOCO=value),
|
||||
onChanged2: (value)=>setState(()=>TRATAMENTO_FOCAL=value),
|
||||
),
|
||||
TitleContainers(title: 'Acompanhamento',width: width*0.7,textAling: TextAlign.start,fontSize: 15),
|
||||
Container(
|
||||
width: width*0.7,
|
||||
height: heigth*1.15,
|
||||
child: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: ConstVariable().tipoAcompanhamentoModel.length,
|
||||
itemBuilder: (context,index){
|
||||
tipoAcompanhamentoModel.add(
|
||||
CheckModel(
|
||||
subtitle: ConstVariable().tipoAcompanhamentoModel[index],
|
||||
check: false
|
||||
)
|
||||
);
|
||||
return CheckBoxSubtitle(
|
||||
subtitle: tipoAcompanhamentoModel[index].subtitle,
|
||||
checkbox:tipoAcompanhamentoModel[index].check,
|
||||
width: width*0.6,
|
||||
onChanged: (value)=>setState(()=>tipoAcompanhamentoModel[index].check=value),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
TitleContainers(title: 'Outros',width: width*0.7,textAling: TextAlign.start,fontSize: 15),
|
||||
Container(
|
||||
width: width*0.7,
|
||||
height: heigth*0.22,
|
||||
child: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: ConstVariable().outrosModel.length,
|
||||
itemBuilder: (context,index){
|
||||
outrosModel.add(
|
||||
CheckModel(
|
||||
subtitle: ConstVariable().outrosModel[index],
|
||||
check: false
|
||||
)
|
||||
);
|
||||
return CheckBoxSubtitle(
|
||||
subtitle: outrosModel[index].subtitle,
|
||||
checkbox:outrosModel[index].check,
|
||||
width: width*0.6,
|
||||
onChanged: (value)=>setState(()=>outrosModel[index].check=value),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
TitleContainers(title: 'Antropometria'),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: heigth*0.2,
|
||||
width: width*0.2,
|
||||
child: Icon(LineIcons.alternateArrows,size: 80,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
InputWithSubtitle(
|
||||
controller: PESO,
|
||||
subtitle: 'Peso (em Kg - 000,000)',
|
||||
errorInput: '',
|
||||
labelInput: 'Peso (em Kg - 000,000)',
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
mandatory: false,
|
||||
enabled: true,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
InputWithSubtitle(
|
||||
controller: ALTURA,
|
||||
subtitle: 'Altura (em metros - 0,00)',
|
||||
errorInput: '',
|
||||
labelInput: 'Altura (em metros - 0,00)',
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
mandatory: false,
|
||||
enabled: true,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
TitleContainers(title: 'Profissional'),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: heigth*0.3,
|
||||
width: width*0.2,
|
||||
child: Icon(Icons.business_center,size: 80,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
InputWithSubtitle(
|
||||
controller: NOME_PROFISSIONAL,
|
||||
subtitle: 'Profissional',
|
||||
errorInput: 'Campo Obrigatório',
|
||||
labelInput: 'Profissional',
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
enabled: false,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
InputWithSubtitle(
|
||||
controller: CNES_UNIDADE,
|
||||
subtitle: 'Unidade',
|
||||
errorInput: 'Campo Obrigatório',
|
||||
labelInput: 'Unidade',
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
enabled: false,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
DropdownWithSubtitle(
|
||||
list: listCBO,
|
||||
widthSubtitle: width*0.7,
|
||||
subtitle: 'CBO',
|
||||
hintDropdown: 'CBO',
|
||||
select: CBO_PROFISSIONAL,
|
||||
widthDropdown: width*0.7,
|
||||
widthContainerDropdown: width*0.6,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
CBO_PROFISSIONAL = value!;
|
||||
});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
),
|
||||
CBO_PROFISSIONAL == null && mandatory?ErrorDefault():Container(),
|
||||
DropdownWithSubtitle(
|
||||
list: listINEPROF,
|
||||
widthSubtitle: width*0.3,
|
||||
subtitle: 'Código da Equipe',
|
||||
hintDropdown: 'Selecione',
|
||||
select: INE_RESP_CADASTRO,
|
||||
widthDropdown: width*0.7,
|
||||
widthContainerDropdown: width*0.5,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
INE_RESP_CADASTRO = value!;
|
||||
});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
TitleContainers(title: 'Complemento'),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: heigth*0.2,
|
||||
width: width*0.2,
|
||||
child: Icon(Icons.attach_file,size: 80,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
InputWithSubtitle(
|
||||
controller: COMPLEMENTO,
|
||||
subtitle: 'COMPLEMENTO',
|
||||
errorInput: '',
|
||||
labelInput: 'COMPLEMENTO',
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
mandatory: false,
|
||||
enabled: true,
|
||||
maxLines: 5,
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
TitleContainers(title: 'Procedimentos'),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: heigth*0.2,
|
||||
width: width*0.2,
|
||||
child: Icon(Icons.info_outlined,size: 80,),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Container(
|
||||
width: width*0.7,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'Procedimento',color: Colors.black,),
|
||||
Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle,color: ColorPalette.blackButton),
|
||||
onPressed: (){
|
||||
AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',PROCEDIMENTOS_SIGTAP,listProc);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
CNS_VALIDO?Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
width: width,
|
||||
height: heigth*0.1,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.warning,color: ColorPalette.red,),
|
||||
Container(
|
||||
width: width*0.9,
|
||||
child: TextDefault(
|
||||
text: 'CNS do Profissional inválido. Este cadastro não será exportado para o e-SUS.',
|
||||
fontSize: 15,
|
||||
maxLines: 2,
|
||||
color: ColorPalette.red,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
):Container(),
|
||||
showCheckError?Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.warning,color: Colors.red,),
|
||||
TextDefault(text: 'Existem campos obrigatórios não preenchidos.',color: ColorPalette.red,fontSize: 15,)
|
||||
],
|
||||
),
|
||||
),
|
||||
color: ColorPalette.white,
|
||||
):Container(),
|
||||
Card(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
ButtonDefault(
|
||||
onPressed: ()=>checkSave(),
|
||||
title: 'Salvar',
|
||||
borderColor: ColorPalette.appBar,
|
||||
background: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
width: double.infinity,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.pop(context),
|
||||
title: 'Cancelar',
|
||||
borderColor: ColorPalette.blackButton,
|
||||
background: ColorPalette.blackButton,
|
||||
textColor: ColorPalette.white,
|
||||
width: double.infinity,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:rkm/widgets/button_default.dart';
|
||||
import 'package:rkm/widgets/switch_with_subtitle.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import 'package:rkm/widgets/title_containers.dart';
|
||||
import '../screens/select_service/home_visit_screen.dart';
|
||||
import 'dropdown_button_default.dart';
|
||||
import 'input_search_text.dart';
|
||||
class AlertDialogDefault {
|
||||
@@ -124,13 +125,18 @@ class AlertDialogDefault {
|
||||
|
||||
return ListTile(
|
||||
onTap: (){
|
||||
if(index!=0){
|
||||
Navigator.pushNamed(context, routes[index]);
|
||||
}else{
|
||||
if(index==0){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => ServiceHomeScreen(name: name,)),
|
||||
);
|
||||
}else if (index==7){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => HomeVisitScreen(name: name,)),
|
||||
);
|
||||
}else{
|
||||
Navigator.pushNamed(context, routes[index]);
|
||||
}
|
||||
},
|
||||
tileColor: rest==0?ColorPalette.white:ColorPalette.appBar,
|
||||
|
||||
@@ -35,7 +35,7 @@ class CheckBoxTwoSubtitle extends StatelessWidget {
|
||||
),
|
||||
Container(
|
||||
width: width/2.5,
|
||||
child: TextDefault(text: subtitle1,fontSize: 15,color: ColorPalette.black54,)
|
||||
child: TextDefault(text: subtitle1,fontSize: 14,color: ColorPalette.black54,)
|
||||
),
|
||||
Spacer(),
|
||||
Checkbox(
|
||||
@@ -44,7 +44,7 @@ class CheckBoxTwoSubtitle extends StatelessWidget {
|
||||
),
|
||||
Container(
|
||||
width: width/3,
|
||||
child: TextDefault(text: subtitle2,fontSize: 15,color: ColorPalette.black54)
|
||||
child: TextDefault(text: subtitle2,fontSize: 14,color: ColorPalette.black54)
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -21,7 +21,7 @@ class SwitchWithSubtitle extends StatelessWidget {
|
||||
width: width,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: title,color: ColorPalette.black54,fontSize: 18),
|
||||
TextDefault(text: title,color: Colors.black,fontSize: 15),
|
||||
Spacer(),
|
||||
Switch(
|
||||
value: value,
|
||||
|
||||
@@ -7,11 +7,13 @@ class TitleContainers extends StatelessWidget {
|
||||
String title;
|
||||
double width;
|
||||
TextAlign textAling;
|
||||
double fontSize;
|
||||
|
||||
TitleContainers({
|
||||
required this.title,
|
||||
this.width = double.infinity,
|
||||
this.textAling = TextAlign.center
|
||||
this.textAling = TextAlign.center,
|
||||
this.fontSize = 20
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -20,7 +22,7 @@ class TitleContainers extends StatelessWidget {
|
||||
padding: textAling!=TextAlign.center?EdgeInsets.all(10):ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
color: ColorPalette.titleContainer,
|
||||
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: textAling,color: ColorPalette.black54,),
|
||||
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: textAling,color: ColorPalette.black54,fontSize: fontSize),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user