MSchemaForm<T extends MBaseModel> class

Inheritance
Available Extensions

Constructors

MSchemaForm(BuildContext context, T model, IMSchemaDefinition? definition, {Map<JsonPath, FormFieldValidator>? validators, MSchemaRef? mtype})

Properties

autofocusNode FocusNode?
Returns the focusNode that should be autofocused based on the current form state. It's generally the first required form field that doesn't have a value
no setterinherited
buildContext BuildContext
The build context for the form
finalinherited
context → ReactiveContext
Override this method to use a custom context.
no setterinherited
definition → IMEntityDefinition?
final
errors → SunnyObservableMap<JsonPath, ValidationError?>
An observable map of errors
finalinherited
formState → SyncStream<SunnyFormState>
A stream of any change to the state of this form.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isModified bool
Whether the user has made changes to the form.
no setterinherited
lastFocusNode FocusNode?
The last focus node that was added
no setterinherited
log → Logger
no setterinherited
loggerName String
no setterinherited
mmodel ↔ T
getter/setter pairinherited
mtype → MSchemaRef
finalinherited
name String
Helpful for debugging - displays the name of the record being edited, for example
finalinherited
parent FormController?
The parent form
no setterinherited
readyChecks Map<JsonPath, SafeCompleter>
Consumers can request a completer that's used to prevent submission until the child component is ready - maybe they are uploading a file or something.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<Attribute>
observes all changes
no setterinherited
validators Map<JsonPath, FormFieldValidator>
Validators run during the validation phase of the submission.
finalinherited

Methods

addError(JsonPath path, ValidationError? error, {AttributeSource source = AttributeSource.model}) → void
Registers an error at this path
inherited
addFocusNode(JsonPath path, FocusNode? newFocusNode) → void
Adds a focusNode to this form at this path
inherited
autofocus([BuildContext? context]) → void
inherited
clearError(JsonPath path, {required AttributeSource source}) → void
Removes all errors at this path
inherited
clearErrors({required AttributeSource source}) → void
Clears out all errors
inherited
dispose() Future
inherited
disposeAll() Future
inherited
endSubmission() → void
Ends this form's submission process
inherited
focusLast([BuildContext? context]) → void
inherited
get<X>(JsonPath path) → X?
Retrieves a value from the underlying data model.
inherited
getFocusNode(JsonPath path, {bool createIfMissing = true}) FocusNode?
Retreives a focus node for the specified path
inherited
invalidateReadyCheck(JsonPath path) → void
Unregisters a ready check at the given path. (should this also complete any outstanding item?)
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observePath<X>(JsonPath path) Stream<X?>
Observes a single path
inherited
path<X>(JsonPath<X> path, [Attribute<X>? attr]) → X?
Uses the type from the JsonPath
inherited
put(JsonPath path, dynamic value, {required AttributeSource source}) → void
Put is like set, but it's not assumed that the data has been sanitized
inherited
registerDisposer(Disposer callback) → void
inherited
registerForm(FormController? form) → void
Registers a subform
inherited
registerFormValidator(String key, FormValidator? validator) → void
Registers a form validator
inherited
registerStream(Stream? stream) → void
inherited
registerSubmitHook(String key, SubmitHook? onSubmit) → void
Registers a submit hook. These run after validation
inherited
registerSubscription(StreamSubscription? subscription) → void
inherited
removeDisposer(FutureOr dispose()) → void
inherited
requestReadyCheck(JsonPath path) → SafeCompleter
Gets or puts a ready check at the given path
inherited
set(JsonPath path, dynamic value, {AttributeSource source = AttributeSource.model}) → void
Sets a value in the underlying model
inherited
startSubmission() → void
Begins this forms submission process
inherited
submit<X>(BuildContext context, {FutureOr<X?> submit()?, bool? skipIfUnmodified}) FutureOr<FormSubmitResult<X>>
Submits this form, including subforms, and returns the result
inherited
toString() String
A string representation of this object.
inherited
unregisterForm(FormController form) → void
Unregisters a subform
inherited
unregisterFormValidator(String key) → void
Unregisters a validator
inherited
unregisterSubmitHook(String key) → void
Unregisters a submit hook
inherited
updateErrors(List<ValidationError> validationErrors, {required AttributeSource source}) → void
Clears and sets a list of validationErrors
inherited
validate({required bool skipIfUnmodified}) FutureOr<Map<JsonPath, List<ValidationError>>>
Validates this form and any subforms. An empty result means that the form validated successfully
inherited
validatePath(JsonPath path) String?
inherited

Operators

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