deleteMapping method

void deleteMapping(
  1. AnkiMapping mapping
)

Delete a selected mapping from the database.

Implementation

void deleteMapping(AnkiMapping mapping) async {
  _database.writeTxnSync(() {
    _database.ankiMappings.deleteSync(mapping.id!);
  });

  if (mapping.label == lastSelectedMappingName) {
    await setLastSelectedMapping(mappings.first);
  }
}