addMapping method

void addMapping(
  1. AnkiMapping mapping
)

Add a selected mapping to the database.

Implementation

void addMapping(AnkiMapping mapping) async {
  _database.writeTxnSync(() {
    if (mapping.id != null &&
        _database.ankiMappings.getSync(mapping.id!) != null) {
      _database.ankiMappings.deleteSync(mapping.id!);
    }
    _database.ankiMappings.putSync(mapping);
  });
}