versão 1.0.17+18 AJUSTE PARA NÃO DEIXAR ESPAÇO DIGITAÇÃO DO LOGIN E CORREÇÃO DO SCROOL DA LISTA DE ATENDIMENTOS. 19/09/2024
This commit is contained in:
@@ -54,301 +54,199 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double altura = MediaQuery.of(context).size.height;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBarDefault().appbar(context, 'RKM AB - Lista Atendimentos',widget.username),
|
||||
body: Container(
|
||||
decoration: ConstVariable().backgroundGradient,
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: ListView(
|
||||
height: altura,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: Column(
|
||||
width: double.infinity,
|
||||
padding: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: Column(
|
||||
children: [
|
||||
TextDefault(
|
||||
text: 'Atendimentos Domiciliares: ${atendimentoDomiciliarLista.length} | Visitas Domiciliares: ${visitaDomiciliarLista.length}',
|
||||
fontWeigth: FontWeight.bold,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 18,
|
||||
),
|
||||
TextDefault(
|
||||
text: 'Cadastros Cidadãos Realizados / Atualizados : ${cadastroCidadaoLista.length + cadastrosIndividuais.length}',
|
||||
fontWeigth: FontWeight.bold,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 18,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
height: altura*0.88,
|
||||
child: ListView(
|
||||
children: [
|
||||
TextDefault(
|
||||
text: 'Atendimentos Domiciliares: ${atendimentoDomiciliarLista.length} | Visitas Domiciliares: ${visitaDomiciliarLista.length}',
|
||||
fontWeigth: FontWeight.bold,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 18,
|
||||
),
|
||||
TextDefault(
|
||||
text: 'Cadastros Cidadãos Realizados / Atualizados : ${cadastroCidadaoLista.length + cadastrosIndividuais.length}',
|
||||
fontWeigth: FontWeight.bold,
|
||||
color: ColorPalette.black54,
|
||||
fontSize: 18,
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
height: atendimentoDomiciliarLista.length*80,
|
||||
child: ListView.builder(
|
||||
itemCount: atendimentoDomiciliarLista.length,
|
||||
itemBuilder: (context,i){
|
||||
atendimentoDomiciliarLista.isEmpty?Container():Container(
|
||||
height: atendimentoDomiciliarLista.length*80,
|
||||
child: ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: atendimentoDomiciliarLista.length,
|
||||
itemBuilder: (context,i_ad){
|
||||
|
||||
List dataList = atendimentoDomiciliarLista[i]['DATA'].toString().split('-');
|
||||
String data = '${dataList[2]}/${dataList[1]}/${dataList[0]}';
|
||||
List dataList = atendimentoDomiciliarLista[i_ad]['DATA'].toString().split('-');
|
||||
String data = '${dataList[2]}/${dataList[1]}/${dataList[0]}';
|
||||
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF666666),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'A.D.',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextDefault(text:atendimentoDomiciliarLista[i]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
children: [
|
||||
TextDefault(text:'DATA ATENDIMENTO: $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${atendimentoDomiciliarLista[i]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
atendimentoDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async{
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja apagar esse "Atendimento Domiciliar" ?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
await db.delete(
|
||||
'ATENDS_DOM_COMPL',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'ATENDS_DOM_PROC',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'ATENDIMENTOS_DOMICILIARES',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
getData();
|
||||
},
|
||||
title: 'Sim',
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.of(context).pop(false),
|
||||
title: 'Não',
|
||||
background: ColorPalette.white,
|
||||
borderColor: ColorPalette.white,
|
||||
textColor: ColorPalette.black54,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
atendimentoDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => AtendimentoDomiciliarTela(name: atendimentoDomiciliarLista[i]['NOME_CIDADAO'],username: widget.username,dados: atendimentoDomiciliarLista[i],)),
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: visitaDomiciliarLista.length*80,
|
||||
child: ListView.builder(
|
||||
itemCount: visitaDomiciliarLista.length,
|
||||
itemBuilder: (context,i){
|
||||
|
||||
//print(visitHome[i]);
|
||||
List dataList = visitaDomiciliarLista[i]['DT_ATENDIMENTO'].toString().split('-');
|
||||
String data = '${dataList[2]}/${dataList[1]}/${dataList[0]}';
|
||||
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF006633),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'V.D.',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextDefault(text:visitaDomiciliarLista[i]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
children: [
|
||||
TextDefault(text:'DATA ATENDIMENTO: $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${visitaDomiciliarLista[i]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
visitaDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async{
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja apagar essa "Visita Domiciliar" ?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
await db.delete(
|
||||
'VISITAS_DOMICILIARES_COMPL',
|
||||
where: 'ID_VISITA_DOMICILIAR = ?',
|
||||
whereArgs: [visitaDomiciliarLista[i]['ID_VISITA_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'VISITAS_DOMICILIARES',
|
||||
where: 'ID_VISITA_DOMICILIAR = ?',
|
||||
whereArgs: [visitaDomiciliarLista[i]['ID_VISITA_DOMICILIAR']],
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
getData();
|
||||
},
|
||||
title: 'Sim',
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.of(context).pop(false),
|
||||
title: 'Não',
|
||||
background: ColorPalette.white,
|
||||
borderColor: ColorPalette.white,
|
||||
textColor: ColorPalette.black54,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
visitaDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => VisitaDomiciliarTela(name: visitaDomiciliarLista[i]['NOME_CIDADAO'],username: widget.username,dados: visitaDomiciliarLista[i],)),
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: cadastroCidadaoLista.length*80,
|
||||
child: ListView.builder(
|
||||
itemCount: cadastroCidadaoLista.length,
|
||||
itemBuilder: (context,i){
|
||||
|
||||
List dataList1 = cadastroCidadaoLista[i]['DT_HORA_CADASTRO'].toString().split(' ');
|
||||
List dataList2 = dataList1[0].split('-');
|
||||
String data = '${dataList2[2]}/${dataList2[1]}/${dataList2[0]}';
|
||||
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'C',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text:cadastroCidadaoLista[i]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF666666),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'A.D.',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextDefault(text:'DATA CADASTRO : $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${cadastroCidadaoLista[i]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
TextDefault(text:atendimentoDomiciliarLista[i_ad]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
children: [
|
||||
TextDefault(text:'DATA ATENDIMENTO: $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${atendimentoDomiciliarLista[i_ad]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
atendimentoDomiciliarLista[i_ad]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async{
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja apagar esse "Atendimento Domiciliar" ?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
await db.delete(
|
||||
'ATENDS_DOM_COMPL',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i_ad]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'ATENDS_DOM_PROC',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i_ad]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'ATENDIMENTOS_DOMICILIARES',
|
||||
where: 'ID_ATENDIMENTO_DOMICILIAR = ?',
|
||||
whereArgs: [atendimentoDomiciliarLista[i_ad]['ID_ATENDIMENTO_DOMICILIAR']],
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
getData();
|
||||
},
|
||||
title: 'Sim',
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.of(context).pop(false),
|
||||
title: 'Não',
|
||||
background: ColorPalette.white,
|
||||
borderColor: ColorPalette.white,
|
||||
textColor: ColorPalette.black54,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
atendimentoDomiciliarLista[i_ad]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => AtendimentoDomiciliarTela(name: atendimentoDomiciliarLista[i_ad]['NOME_CIDADAO'],username: widget.username,dados: atendimentoDomiciliarLista[i_ad],)),
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
cadastroCidadaoLista[i]['ORIGEM']=='C' && cadastroCidadaoLista[i]['SINCRONIZADO']=='N'
|
||||
?IconButton(
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
visitaDomiciliarLista.isEmpty?Container():Container(
|
||||
height: visitaDomiciliarLista.length*80,
|
||||
child: ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: visitaDomiciliarLista.length,
|
||||
itemBuilder: (context,i_vd){
|
||||
|
||||
//print(visitHome[i]);
|
||||
List dataList = visitaDomiciliarLista[i_vd]['DT_ATENDIMENTO'].toString().split('-');
|
||||
String data = '${dataList[2]}/${dataList[1]}/${dataList[0]}';
|
||||
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF006633),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'V.D.',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextDefault(text:visitaDomiciliarLista[i_vd]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
children: [
|
||||
TextDefault(text:'DATA ATENDIMENTO: $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${visitaDomiciliarLista[i_vd]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
visitaDomiciliarLista[i_vd]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
@@ -363,15 +261,20 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja apagar esse cidadão?',color: ColorPalette.black54,),
|
||||
content: TextDefault(text: 'Deseja apagar essa "Visita Domiciliar" ?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
await db.delete(
|
||||
'CIDADAOS', // Substitua pelo nome da sua tabela
|
||||
where: 'ID_CIDADAO = ?',
|
||||
whereArgs: [cadastroCidadaoLista[i]['ID_CIDADAO']],
|
||||
'VISITAS_DOMICILIARES_COMPL',
|
||||
where: 'ID_VISITA_DOMICILIAR = ?',
|
||||
whereArgs: [visitaDomiciliarLista[i_vd]['ID_VISITA_DOMICILIAR']],
|
||||
);
|
||||
await db.delete(
|
||||
'VISITAS_DOMICILIARES',
|
||||
where: 'ID_VISITA_DOMICILIAR = ?',
|
||||
whereArgs: [visitaDomiciliarLista[i_vd]['ID_VISITA_DOMICILIAR']],
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
getData();
|
||||
@@ -393,30 +296,141 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
:Container(),
|
||||
cadastroCidadaoLista[i]['SINCRONIZADO']=='N'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async {
|
||||
await DBQuerys().buscaCidadao(cadastroCidadaoLista[i]['NOME_CIDADAO']).then((list){
|
||||
// print(showResults[index]['CD_USUARIO_SUS']);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => RegisterCitizenScreen(listData: list,username: widget.username,)),
|
||||
);
|
||||
});
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
));
|
||||
},
|
||||
):Container(),
|
||||
visitaDomiciliarLista[i_vd]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => VisitaDomiciliarTela(name: visitaDomiciliarLista[i_vd]['NOME_CIDADAO'],username: widget.username,dados: visitaDomiciliarLista[i_vd],)),
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
cadastroCidadaoLista.isEmpty?Container():Container(
|
||||
height: cadastroCidadaoLista.length*80,
|
||||
child: ListView.builder(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: cadastroCidadaoLista.length,
|
||||
itemBuilder: (context,i_c){
|
||||
|
||||
List dataList1 = cadastroCidadaoLista[i_c]['DT_HORA_CADASTRO'].toString().split(' ');
|
||||
List dataList2 = dataList1[0].split('-');
|
||||
String data = '${dataList2[2]}/${dataList2[1]}/${dataList2[0]}';
|
||||
|
||||
return Card(
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 70,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10),topLeft: Radius.circular(10))
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: TextDefault(text: 'C',color: Colors.white,fontSize: 22,fontWeigth: FontWeight.bold,),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextDefault(text:cadastroCidadaoLista[i_c]['NOME_CIDADAO'].toString(),color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
Row(
|
||||
children: [
|
||||
TextDefault(text:'DATA CADASTRO : $data',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
SizedBox(width: 20,),
|
||||
TextDefault(text:'SINCRONIZADO : ${cadastroCidadaoLista[i_c]['SINCRONIZADO']}',color: ColorPalette.black54,fontWeigth: FontWeight.w700,),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
cadastroCidadaoLista[i_c]['ORIGEM']=='C' && cadastroCidadaoLista[i_c]['SINCRONIZADO']=='N'
|
||||
?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0XFF990000),
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async{
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextDefault(text: 'Aviso',color: ColorPalette.black54,textAlign: TextAlign.center,),
|
||||
content: TextDefault(text: 'Deseja apagar esse cidadão?',color: ColorPalette.black54,),
|
||||
actions: [
|
||||
ButtonDefault(
|
||||
onPressed: ()async{
|
||||
Database db = await DbSqliteLoad().intialDB();
|
||||
await db.delete(
|
||||
'CIDADAOS', // Substitua pelo nome da sua tabela
|
||||
where: 'ID_CIDADAO = ?',
|
||||
whereArgs: [cadastroCidadaoLista[i_c]['ID_CIDADAO']],
|
||||
);
|
||||
Navigator.of(context).pop();
|
||||
getData();
|
||||
},
|
||||
title: 'Sim',
|
||||
background: ColorPalette.appBar,
|
||||
borderColor: ColorPalette.appBar,
|
||||
textColor: ColorPalette.white,
|
||||
),
|
||||
ButtonDefault(
|
||||
onPressed: ()=>Navigator.of(context).pop(false),
|
||||
title: 'Não',
|
||||
background: ColorPalette.white,
|
||||
borderColor: ColorPalette.white,
|
||||
textColor: ColorPalette.black54,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
:Container(),
|
||||
cadastroCidadaoLista[i_c]['SINCRONIZADO']=='N'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: ()async {
|
||||
await DBQuerys().buscaCidadao(cadastroCidadaoLista[i_c]['NOME_CIDADAO']).then((list){
|
||||
// print(showResults[index]['CD_USUARIO_SUS']);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => RegisterCitizenScreen(listData: list,username: widget.username,)),
|
||||
);
|
||||
});
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user