diff --git a/lib/transport_helper.dart b/lib/transport_helper.dart index 955e090..2289b73 100644 --- a/lib/transport_helper.dart +++ b/lib/transport_helper.dart @@ -409,7 +409,11 @@ class Segment { void dbInsert() async { Database database = DbHelper.db; - id = await database.insert(tableName, toMap()); + id = await database.insert( + tableName, + toMap(), + conflictAlgorithm: ConflictAlgorithm.ignore, + ); } void dbUpdate() async { @@ -532,7 +536,11 @@ class Station { void dbInsert() async { Database database = DbHelper.db; - database.insert(tableName, _toMap()); + database.insert( + tableName, + _toMap(), + conflictAlgorithm: ConflictAlgorithm.ignore, + ); } void _dbInsertStationLines() async { @@ -636,7 +644,11 @@ class Vehicle { void dbInsert() async { Database database = DbHelper.db; - database.insert(tableName, _toMap()); + database.insert( + tableName, + _toMap(), + conflictAlgorithm: ConflictAlgorithm.ignore, + ); } void dbUpdate() async { @@ -740,7 +752,11 @@ class Line { void dbInsert() async { Database database = DbHelper.db; - database.insert(tableName, _toMap()); + database.insert( + tableName, + _toMap(), + conflictAlgorithm: ConflictAlgorithm.ignore, + ); } void dbUpdate() async { @@ -802,7 +818,7 @@ class Departure { factory Departure.fromJson(Map json) { Vehicle vehicle = Vehicle.fromJson(json["Product"][0]); // try { - // vehicle.dbInsert(); + vehicle.dbInsert(); // } catch (e) { // vehicle.dbUpdate(); // } @@ -812,7 +828,7 @@ class Departure { transportLines: [], ); // try { - // station.dbInsert(); + station.dbInsert(); // } catch (e) { // station.dbUpdate(); // } @@ -907,7 +923,11 @@ class Departure { void dbInsert() async { Database database = DbHelper.db; - id = await database.insert(tableName, _toMap()); + id = await database.insert( + tableName, + _toMap(), + conflictAlgorithm: ConflictAlgorithm.ignore, + ); } void dbUpdate() async {