ListField<T> class
Field that builds DropdownMenu<T
> for List<T
> values.
Constructors
-
ListField({required String name, required List<
T> values, required T? initialValue, LabelBuilder<T> labelBuilder = defaultLabelBuilder, @Deprecated('Fields should not be aware of their context') void onChanged(BuildContext context, T? value)?})
Properties
-
codec
→ FieldCodec<
T> -
Encodes the value of Type
T
to a String format, to be used in a query parameter, or decodes a String query parameter back toT
.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → T?
-
finalinherited
-
labelBuilder
→ LabelBuilder<
T> -
final
- name → String
-
Name of this inside the query group.
finalinherited
- onChanged → void Function(BuildContext context, T? value)?
-
Callback for when Field's value changed through:
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → FieldType
-
Type of this, helps providing some metadata about this,
to help rendering proper widget by external listeners.
finalinherited
-
values
→ List<
T> -
final
Methods
-
build(
BuildContext context, String group) → Widget -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toFullJson(
) → Map< String, dynamic> -
Same as toJson put prepends some metadata like name, type and value.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this into JSON representation share information about the
available fields. Mostly used to support Fields on Widgetbook Cloud.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
toWidget(
BuildContext context, String group, T? value) → Widget -
Builds the current field into a Widget to be used for input in the
side panel.
override
-
updateField(
BuildContext context, String group, T value) → void -
inherited
-
valueFrom(
Map< String, String> groupMap) → T? -
Extracts the value from
groupMap
, fallback to initialValue if not found.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultLabelBuilder(
dynamic value) → String