ModelFormUtilities class

ModelFormUtilities is a statis class utility that provides methods to validate your form with BlOcs.

Constructors

ModelFormUtilities()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Methods

getDeepCopy<TViewmodel>(TViewmodel viewmodel) → TViewmodel
Provides a deep copy of your viewmodel.
getErrorMessage<TFormState extends ModelFormState<TModel>, TModel>(TFormState state, String propertyName) String
getErrorMessage provides an error message to display. state is your current state, that contains your viewmodel to validate. protpertyName is the name of the property you wan't to get the error message.
refreshWhen<TFormState extends ModelFormState<TModel>, TModel>(TFormState previous, TFormState current, [bool condition(TFormState p, TFormState c)]) bool
refreshWhen refreshes your widget. previous and current are both states of your application, before and after changes. condition is an optional parameter function. If you provide it, you can refresh each widget for its own property into the viewmodel. If you don't provide it, all your inputs will be refreshed (and so validated) each time you will change a value into the viewmodel.