CreatorModel class

A scoped model for parameters that affect the card creator. RiverPod is used for global state management across multiple layers, and is useful for showing the creator and sharing code across the entire application.

Mixed in types

Constructors

CreatorModel()

Properties

controllersByField Map<Field, TextEditingController>
A map of TextEditingController for every creator field.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
hasListeners bool
Whether any listeners are currently registered.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scrollController ScrollController
Scroll controller for the Creator page.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
appendSentenceAndCloze(String sentence) → void
Append the appropriate fields for cloze compatibility.
clearAll({required bool overrideLocks, required String savedTags}) → void
Clear all fields and current context.
clearField(Field field, {required String savedTags, bool overrideLocks = false, bool notify = true}) → void
Clear a controller for a particular field.
copyContext(CreatorFieldValues creatorFieldValues) → void
Clone the CreatorFieldValues's contents into the model.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getExportDetails(WidgetRef ref) CreatorFieldValues
Get a snapshot of the relevant parameters of the model for card export.
getFieldController(Field field) TextEditingController
Get the TextEditingController for a particular field.
getLockedNotifier(Field field) ValueNotifier<bool>
Get the ValueNotifier for a particular field.
initialise() → void
Prepare the CreatorModel's final variables for use.
isLocked(Field field) bool
Whether or not a field is locked and should not be cleared on export.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh() → void
Refresh state for the Card Creator.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setSentenceAndCloze(JidoujishoTextSelection selection) → void
Set the sentence and cloze fields with a new selection.
toggleLock(Field field) → void
Get the TextEditingController for a particular field.
toString() String
A string representation of this object.
inherited

Operators

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