getById method
Implementation
Future<T?> getById(String tableName, int id, FromMap<T> fromMap) async {
final result =
await database!.query(tableName, where: 'id = ?', whereArgs: [id]);
if (result.isNotEmpty) {
return fromMap(result.first);
}
return null;
}