Enhancement class

An entity that functionally mutates creator fields and returns an output. An enhancement is given and assigned a field at runtime in the initialisation step, and can be assigned to a field enhancement slot. In the creator, the user can then tap on the icon representing the enhancement to execute its functionality.

Implementers

Constructors

Enhancement({required String uniqueKey, required String label, required String description, required Field field, required IconData icon})
Initialise this enhancement with the predetermined and hardset values.

Properties

description String
A longer description of what the enhancement can do, or details left by or regarding the developer.
final
descriptionLocalisation Map<String, String>
Localisations for this enhancement, where the key is a locale tag and the value is the description of the enhancement. If the value for the current locale is non-null, it will be used instead of description.
final
field Field
Which field this enhancement is for.
final
hashCode int
The hash code for this object.
read-onlyinherited
icon IconData
An icon that will show the enhancement if activated by the user in the quick menu.
final
label String
Name of the enhancement that very shortly describes what it does.
final
labelLocalisation Map<String, String>
Localisations for this enhancement, where the key is a locale tag and the value is the label of the enhancement. If the value for the current locale is non-null, it will be used instead of label.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
uniqueKey String
A unique name that allows distinguishing this type from others, particularly for the purposes of differentiating between persistent settings keys.
final

Methods

enhanceCreatorParams({required BuildContext context, required WidgetRef ref, required AppModel appModel, required CreatorModel creatorModel, required EnhancementTriggerCause cause}) Future<void>
Perform a change to the CreatorModel, executing the functionality of this enhancement. An EnhancementTriggerCause may be used to modify the behavior of the enhancement's function depending on whether the enhancement is being executed on auto, manual or cascade modes.
getLocalisedDescription(AppModel appModel) String
Get the best localisation for the description of this enhancement. If there is no localisation, the fallback is description.
getLocalisedLabel(AppModel appModel) String
Get the best localisation for the label of this enhancement. If there is no localisation, the fallback is label.
initialise() Future<void>
This function is run at startup. It is not called again if already run.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareResources() Future<void>
If an enhancement requires resources to function, they can be prepared here and this function will be run once only at runtime during the initialisation step.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited