versão 1.0.13+14 edicao da visita_domiciliar_tela.dart
This commit is contained in:
@@ -3,11 +3,13 @@ import 'package:rkm/config/color_palette.dart';
|
||||
import 'package:rkm/config/const_variable.dart';
|
||||
import 'package:rkm/screens/registers_citizen/register_citizen_screen.dart';
|
||||
import 'package:rkm/screens/select_service/atendimento_domiciliar_tela.dart';
|
||||
import 'package:rkm/screens/select_service/visita_domiciliar_tela.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import '../service/db/db_querys.dart';
|
||||
import '../service/db/db_sqlite_load.dart';
|
||||
import '../widgets/appbar_default.dart';
|
||||
import '../widgets/button_default.dart';
|
||||
|
||||
class AttendanceListScreen extends StatefulWidget {
|
||||
String username;
|
||||
@@ -126,7 +128,52 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){},
|
||||
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(
|
||||
@@ -188,7 +235,7 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
visitaDomiciliarLista[i]['SINCRONIZADO']=='N'?IconButton(
|
||||
visitaDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
@@ -197,9 +244,49 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){},
|
||||
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']=='N'?IconButton(
|
||||
visitaDomiciliarLista[i]['SINCRONIZADO']!='S'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
@@ -209,10 +296,10 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder:(context) => AtendimentoDomiciliarTela(name: visitHome[i]['NOME_CIDADAO'],username: widget.username,dados: visitHome[i],)),
|
||||
// );
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder:(context) => VisitaDomiciliarTela(name: visitaDomiciliarLista[i]['NOME_CIDADAO'],username: widget.username,dados: visitaDomiciliarLista[i],)),
|
||||
);
|
||||
},
|
||||
):Container(),
|
||||
],
|
||||
@@ -269,10 +356,45 @@ class _AttendanceListScreenState extends State<AttendanceListScreen> {
|
||||
),
|
||||
child: Icon(Icons.delete, color: Colors.white, size: 40,),
|
||||
),
|
||||
onPressed: (){},
|
||||
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]['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]['SINCRONIZADO']=='N'?IconButton(
|
||||
cadastroCidadaoLista[i]['SINCRONIZADO']=='N'?IconButton(
|
||||
icon: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user