FormField<T extends Object> class

A read-only accessor for a typed form field.

Use this with FormFields to read typed values:

const ageField = IntFormField('age');
final age = form.fields.get(ageField); // typed as int

The decoder must throw an Exception for an invalid value, which FormFields reports as InvalidFormFieldException. An Error propagates unchanged. Catch the ArgumentError from a decoder such as Enum.values.byName and throw a FormatException instead.

Inheritance
Implementers

Constructors

FormField(String key, Decoder<T, String> decode)
const

Properties

decode → Decoder<T, String>
Decodes the raw value into the typed value.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
key → String
The key used to identify this value in storage.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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