PresetField class abstract
Field definition. Each field type needs to subclass this one.
There are multiple examples in the fields directory.
- Implementers
Constructors
- PresetField({required String key, required String label, IconData? icon, String? placeholder, FieldPrerequisite? prerequisite, LocationSet? locationSet})
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
Icon for the field. Displayed only in the standard fields block
in the full-page editor.
final
- key → String
-
OSM tag key for this field. If the field does not use this
attribute (or adds more keys, e.g.
contact:phoneforphone), do override the hasRelevantKey method.final - label → String
-
Field label to display alongside it. Can be overridden for
a multi-line field in
buildWidgets.final - locationSet → LocationSet?
-
Locations to determine whether to skip the field. It allows for
country-specific fields.
final
- placeholder → String?
-
Placeholder for text-based fields.
final
- prerequisite → FieldPrerequisite?
-
Tag prerequisites for moving this field into the main block.
If a field is in the "more fields" block, it's collapsed by default.
When a prerequisite matches, it is moved to the main "fields" block.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildWidget(
OsmChange element) → Widget -
Builds a field-editing widget for the given
element. -
hasRelevantKey(
Map< String, String> tags) → bool - Tests whether the object has tags matching this field. The purpose is to check whether the field has a non-empty value.
-
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