update method

Future<int> update(
  1. int id,
  2. String tableName,
  3. T item,
  4. ToMap<T> toMap,
)

Implementation

Future<int> update(int id, String tableName, T item, ToMap<T> toMap) async {
  final data = toMap(item)..remove('id');
  return await database!
      .update(tableName, data, where: 'id = ?', whereArgs: [id]);
}