When I am adding an entry to the table, I need to know the number of elements in the table.
onPressed: () {
final db = Provider.of<AppDb>(context);
final habitCount = 0; /* Number of entries in the "Habits" table */
db.into(db.habits)
.insert(HabitsCompanion.insert(name: "Sleep", order: habitCount * 2 ));
},
How can I do this as easily as possible?