setAutoFieldEnhancement method
- {required AnkiMapping mapping,
- required Field field,
- required Enhancement enhancement}
Updates a given mapping
's persisted auto enhancement for a given
field
.
Implementation
void setAutoFieldEnhancement({
required AnkiMapping mapping,
required Field field,
required Enhancement enhancement,
}) async {
/// -1 is reserved for the auto enhancement.
mapping.enhancements![field.uniqueKey]![AnkiMapping.autoModeSlotNumber] =
enhancement.uniqueKey;
_database.writeTxnSync(() {
_database.ankiMappings.putSync(mapping);
});
}