loader
Sets a custom loader for the configuration field.
The custom loader is responsible for converting raw parsed values (e.g., from YAML/JSON) into the final expected type of the field. This is useful for fields requiring special deserialization logic, such as parsing enums, date formats, or custom objects.
Example:
field(AppConfig::mode).loader(EnumLoader(AppMode::class))Content copied to clipboard
Return
this FieldConfigScope for method chaining
Parameters
loader
an implementation of the FieldLoader interface for custom deserialization logic