getItem method

Future<Map<String, Object?>?> getItem(
  1. int id
)

Implementation

Future<Map<String, Object?>?> getItem(int id) async {
  Database db = await database;

  List<Map<String, Object?>> result =
      await db.rawQuery("SELECT * FROM $table WHERE id = $id");

  if (result.isEmpty) return null;

  return result.first;
}