update method

Future update(
  1. dynamic id
)

Implementation

Future update(id) async {
  final db = await database;

  Map<String, Object?> data = toMap();

  data.putIfAbsent("updated_at", () => DateTime.now());

  return await db.update(
    table,
    handleDataType(data),
    where: 'id = ?',
    whereArgs: [id],
  );
}