This commit is contained in:
Mohamed Nouffer
2022-11-01 23:47:35 +05:30
parent d16d97f64f
commit 4d40b400b1
3 changed files with 163 additions and 145 deletions

View File

@ -83,12 +83,12 @@ class DatabaseHelper{
return roglist;
}
Future<Destination> getDestinationById(int id) async {
Future<List<Destination>> getDestinationById(int id) async {
Database db = await instance.database;
var rog = await db.query('destination', where: "location_id = ${id}");
List<Destination> deslist = rog.isNotEmpty
? rog.map((e) => Destination.fromMap(e)).toList() : [];
return deslist[0];
return deslist;
}
@ -204,7 +204,7 @@ class DatabaseHelper{
dest.toMap(),
conflictAlgorithm: ConflictAlgorithm.replace,
);
print("------ database helper insert ${dest.toMap()}-----------::::::::");
//print("------ database helper insert ${dest.toMap()}-----------::::::::");
return res;
}
@ -218,7 +218,7 @@ class DatabaseHelper{
"destination",
row,
where: 'location_id = ?',
whereArgs: [destination.location_id]
whereArgs: [destination.location_id!]
);
}