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:
@@ -9,8 +9,12 @@ class MainControllers{
|
||||
var senha = senhaDigitada.toUpperCase();
|
||||
// Faz a criptografia da senha inserida
|
||||
String senhaMD5 = grHashString(GRCryptoType.md5, senha);
|
||||
print('senhaMD5');
|
||||
print(senhaMD5);
|
||||
// Retira o tipo (1, 2 ou 3) da senha do Usuário
|
||||
int tipo = int.parse(senhaUsuario.substring(0, 1));
|
||||
|
||||
print('tipo $tipo');
|
||||
// Define a possição inicial da quebra da senha
|
||||
int posicaoInicialMin = 0;
|
||||
int posicaoInicialMax= 0;
|
||||
@@ -35,10 +39,17 @@ class MainControllers{
|
||||
}
|
||||
|
||||
String inicio = senhaMD5.substring(posicaoInicialMin, posicaoInicialMax);
|
||||
print('inicio');
|
||||
print(inicio);
|
||||
String fim = senhaMD5.substring(posicaoFinalMin, posicaoFinalMax);
|
||||
|
||||
print('fim');
|
||||
print(fim);
|
||||
|
||||
// Faz a criptografia e concatena ela com sha1 e md5
|
||||
String senhaCriptogradafa = tipo.toString() + '\$'+ grHashString(GRCryptoType.sha1, inicio + senha + fim);
|
||||
print('senhaCriptogradafa');
|
||||
print(senhaCriptogradafa);
|
||||
// Retorna a senha criptografada
|
||||
return senhaCriptogradafa;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
],
|
||||
));
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rkm/controllers/main_controllers.dart';
|
||||
import 'package:rkm/screens/home_screen.dart';
|
||||
import 'package:rkm/service/api/url_api_const.dart';
|
||||
@@ -42,6 +43,7 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
|
||||
final PrefService _prefService = PrefService();
|
||||
checkLogin()async{
|
||||
|
||||
if(inputUser.text.isNotEmpty && inputPassword.text.isNotEmpty && inputUser.text.length>3 && inputPassword.text.length>3){
|
||||
if(selectCity!=null){
|
||||
_prefService.createCacheModel(inputUser.text,inputPassword.text,selectCity!,mode);
|
||||
@@ -61,7 +63,8 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
urlAPI = 'http://${inputIP.text}:${inputPort.text}/api/atb/';
|
||||
}
|
||||
await ApiDataLoad().apiConect(urlAPI,mode,nameCityApi,inputUser.text).then((response) async {
|
||||
// print("erre : "+response.toString());
|
||||
print('response');
|
||||
print(response);
|
||||
if(response == 'Erro' || response.toString() == 'Error: -902 - I/O error during "open" operation for file "/bases/conectasus/extrema/SISTEMA.FDB" Error while trying to open file No such file or directory'){
|
||||
setState(() {
|
||||
loading = false;
|
||||
@@ -70,7 +73,11 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
}else if(inputUser.text == inputPassword.text || response['bloqueio']==1){
|
||||
setState(() {
|
||||
loading = false;
|
||||
error = 'Usuário bloqueado/usuário e/ou senha incorreta';
|
||||
if( response['bloqueio']==1){
|
||||
error = 'Usuário bloqueado/usuário e/ou senha incorreta';
|
||||
}else if(inputUser.text == inputPassword.text){
|
||||
error = 'Usuário e senha não podem ser idênticas';
|
||||
}
|
||||
});
|
||||
}else if(response['status']==0) {
|
||||
setState(() {
|
||||
@@ -78,14 +85,14 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
error = 'Usuário não encontrado';
|
||||
});
|
||||
}else if(response['status']==1) {
|
||||
// print('aqui 1');
|
||||
// print(response);
|
||||
print('aqui 1');
|
||||
print(response);
|
||||
setState((){
|
||||
error = '';
|
||||
});
|
||||
//verificar se a criptografia identificou se a senha está correta
|
||||
print('chegou');
|
||||
if(MainControllers().encrypt(inputPassword.text,response['userPass']) == response['userPass']){
|
||||
// 'print'(EncryptPassword().encrypt(inputPassword.text,response['userPass']));
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
@@ -199,6 +206,9 @@ class _LoginLoadScreenState extends State<LoginLoadScreen> {
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s')),
|
||||
],
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:rkm/screens/home_screen.dart';
|
||||
import 'package:rkm/screens/login/sync_login_screen.dart';
|
||||
@@ -141,6 +142,9 @@ class _LoginSavedScreenState extends State<LoginSavedScreen> {
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s')),
|
||||
],
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rkm/screens/sync_init_screen.dart';
|
||||
import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/config/const_variable.dart';
|
||||
@@ -235,6 +236,9 @@ class _SyncLoginScreenState extends State<SyncLoginScreen> {
|
||||
width: width*0.6,
|
||||
colorBorder: Colors.white,
|
||||
onChanged: (v)=>setState((){}),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s')),
|
||||
],
|
||||
),
|
||||
TitleInput(title:'Senha'),
|
||||
InputText(
|
||||
|
||||
@@ -634,9 +634,13 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
|
||||
selectSubdivisionCOD = widget.listData[0]['CLASSIFICACAO_SUB']=='null'?0:widget.listData[0]['CLASSIFICACAO_SUB'];
|
||||
}
|
||||
numberFamilyController.text = widget.listData[0]['NUM_FAMILIA'].toString();
|
||||
|
||||
if(widget.listData[0]['ID_PAIS_RESID']!=0 && widget.listData[0]['ID_PAIS_RESID']!=null){
|
||||
for(int i = 0; ConstVariable().paises.length > i;i++){
|
||||
if(ConstVariable().paises[i].ID_PAIS_RESID == widget.listData[0]['ID_PAIS_RESID']){
|
||||
print('ID_PAIS_RESID');
|
||||
print(widget.listData[0]['ID_PAIS_RESID']);
|
||||
selectPaisResidencia = ConstVariable().paises[i].PAIS;
|
||||
selectCountry = ConstVariable().paises[i];
|
||||
// print(selectCountry!.ID_PAIS_RESID);
|
||||
// print(selectCountry!.PAIS);
|
||||
@@ -1368,12 +1372,12 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
DropdownWithSubtitle(
|
||||
subtitle: 'Pais de Residência',
|
||||
subtitle: 'País de Residência',
|
||||
select: selectPaisResidencia,
|
||||
widthSubtitle: width*0.6,
|
||||
widthDropdown: width*0.69,
|
||||
widthContainerDropdown: width*0.6,
|
||||
hintDropdown: 'Pais de Residência',
|
||||
hintDropdown: 'País de Residência',
|
||||
onChanged:selectClassification!='OUTRO MUNICIPIO'?null:(value){
|
||||
setState(() {
|
||||
selectPaisResidencia = value;
|
||||
@@ -1956,7 +1960,7 @@ class _RegisterCitizenScreenState extends State<RegisterCitizenScreen> {
|
||||
subtitle: 'RG',
|
||||
errorInput: 'Campo Obrigatório',
|
||||
labelInput: 'RG',
|
||||
maxLength: 8,
|
||||
maxLength: 9,
|
||||
widthInput: width*0.7,
|
||||
widthSubtitle: width*0.7,
|
||||
hintInput: 'Escreva aqui',
|
||||
|
||||
@@ -12,9 +12,10 @@ description: RKM AB 2.0.
|
||||
#versão 1.0.15+16 AJUSTE DAS RESTRIÇÕES DE VISITAS PERIODICAS, ENVIO DE PESO E ALTURA E DO LOADING. 30/08/2024
|
||||
#versão 1.0.15+16 AJUSTE DOS CODIGOS, ENVIO DE PESO E ALTURA E SINCRONIZADO QUE NAO EXIBIA. 02/09/2024
|
||||
#versão 1.0.16+17 AJUSTE DA COMPETENCIA. 10/09/2024
|
||||
#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
|
||||
|
||||
publish_to: 'none'
|
||||
version: 1.0.16+17
|
||||
version: 1.0.17+18
|
||||
|
||||
environment:
|
||||
sdk: '>=3.2.3 <4.0.0'
|
||||
|
||||
Reference in New Issue
Block a user