insert method
Insere values em table e retorna o id gerado.
Implementation
@override
Future<int> insert(String table, Map<String, Object?> values) async {
final rows = await _readAll(table);
final id =
rows.fold<int>(
0,
(m, r) => (r['id'] as int? ?? 0) > m ? r['id'] as int : m,
) +
1;
rows.add({'id': id, ...values});
await _writeAll(table, rows);
return id;
}