setFieldEnhancement method
- {required AnkiMapping mapping,
- required Field field,
- required int slotNumber,
- required Enhancement enhancement}
Updates a given mapping
's persisted enhancement for a given field
and slotNumber
.
Implementation
void setFieldEnhancement({
required AnkiMapping mapping,
required Field field,
required int slotNumber,
required Enhancement enhancement,
}) async {
mapping.enhancements![field.uniqueKey] ??= {};
mapping.enhancements![field.uniqueKey]![slotNumber] = enhancement.uniqueKey;
_database.writeTxnSync(() {
_database.ankiMappings.putSync(mapping);
});
}