nextMappingOrder property

int nextMappingOrder

Get the newest available order for a new mapping.

Implementation

int get nextMappingOrder {
  AnkiMapping? highestOrderMapping =
      _database.ankiMappings.where().sortByOrderDesc().findFirstSync();
  late int order;
  if (highestOrderMapping != null) {
    order = highestOrderMapping.order + 1;
  } else {
    order = 0;
  }

  return order;
}