FieldHint class final
How an inspector shows one field, and what shape its value has.
Keyed by the field's name in the thing it describes: a property of an entity, a parameter of a material, a field of a component's encoded map, an argument of a command.
Constructors
-
FieldHint(String key, FieldKind kind, {String? label, String? help, double? min, double? max, double? step, Unit? unit, List<
String> choices = const <String>[], List<String> suffixes = const <String>[], Object? defaultValue, bool readOnly = false}) -
A field of any
kind; the named constructors below say the same with only the members their kind reads.const -
FieldHint.asset(String key, {List<
String> suffixes = const <String>[], String? label, String? help, Object? defaultValue, bool readOnly = false}) -
A path to one of the project's files.
const
-
FieldHint.choice(String key, List<
String> choices, {String? label, String? help, Object? defaultValue, bool readOnly = false}) -
One of
choices.const - FieldHint.color(String key, {String? label, String? help, Object? defaultValue, bool readOnly = false})
-
A linear colour.
const
- FieldHint.entity(String key, {String? label, String? help, Object? defaultValue, bool readOnly = false})
-
The name of another entity.
const
- FieldHint.integer(String key, {String? label, String? help, double? min, double? max, Object? defaultValue, bool readOnly = false})
-
A whole number.
const
- FieldHint.number(String key, {String? label, String? help, double? min, double? max, double? step, Unit? unit, Object? defaultValue, bool readOnly = false})
-
A decimal number.
const
- FieldHint.text(String key, {String? label, String? help, Object? defaultValue, bool readOnly = false})
-
Free text.
const
- FieldHint.toggle(String key, {String? label, String? help, Object? defaultValue, bool readOnly = false})
-
Yes or no.
const
- FieldHint.vector3(String key, {String? label, String? help, Unit? unit, Object? defaultValue, bool readOnly = false})
-
Three numbers.
const
Properties
-
choices
→ List<
String> -
The words a FieldKind.choice picks from, in order.
final
- defaultValue → Object?
-
The value an inspector offers where the field is not set, or null for
a field it shows only when it is.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- help → String?
-
A sentence shown beside the control, or null.
final
-
jsonSchema
→ Map<
String, Object?> -
This field as a JSON Schema property, for a tool that takes it as an
argument: a command's, offered to an agent.
no setter
- key → String
-
The field's name in what it describes.
final
- kind → FieldKind
-
The control it is shown with.
final
- label → String?
-
What the row says, or null for key.
final
- max → double?
-
The high end of a number's control, in unit (a plain number when the
field names none), or null for none.
final
- min → double?
-
The low end of a number's control, in unit (a plain number when the
field names none), or null for none.
final
- readOnly → bool
-
Whether the inspector shows the value without letting it be changed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- step → double?
-
The step a number's control moves in, or null for a free one.
final
-
suffixes
→ List<
String> -
The file suffixes an FieldKind.asset takes (
.glb,.png); empty for any file.final - title → String
-
What the row says: label, or key.
no setter
- unit → Unit?
-
The unit a number or a vector is in, shown beside it and never applied
to it: the value is written as it was entered.
final
Methods
-
isInside(
Object? value) → bool -
Whether
value, a number, is between min and max; true for anything else and for a field without ends. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refusalOf(
Object? value) → String? -
Why
valueis not the shape this field takes, or null when it is. -
toJson(
) → Map< String, Object?> - This hint as a document writes it: key and the kind's name, then only what was given.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Object? json) → FieldHint -
The hint
jsonholds, as toJson writes it. A kind this version does not know is read as FieldKind.text, so a document a later editor wrote still opens.