choice<S, T> static method
DiagramProperty<S, T>
choice<S, T>(
- String key, {
- required String label,
- required T read(
- S subject
- required List<
DiagramPropertyOption< options(T> >- S subject
- String? verb,
- DiagramPropertyArgs<
S, T> ? args, - S update(
- S subject,
- T value
- DiagramPropertyGroup group = DiagramPropertyGroup.general,
- DiagramChoiceStyle style = DiagramChoiceStyle.swatches,
- bool labeled = true,
- bool visible(
- S subject
- bool enabled(
- S subject
- String? hint(
- T value
- String? check(
- T value
- String editLabel(
- T value
One of the options a subject offers. An inspector draws each option
by its value type, or shows its icon or label.
Implementation
static DiagramProperty<S, T> choice<S, T>(
String key, {
required String label,
required T Function(S subject) read,
required List<DiagramPropertyOption<T>> Function(S subject) options,
String? verb,
DiagramPropertyArgs<S, T>? args,
S Function(S subject, T value)? update,
DiagramPropertyGroup group = DiagramPropertyGroup.general,
DiagramChoiceStyle style = DiagramChoiceStyle.swatches,
bool labeled = true,
bool Function(S subject)? visible,
bool Function(S subject)? enabled,
String? Function(T value)? hint,
String? Function(T value)? check,
String Function(T value)? editLabel,
}) => DiagramProperty._(
key,
label: label,
presentation: DiagramChoicePresentation<T>._(
options: (subject) => options(subject as S),
style: style,
labeled: labeled,
),
read: read,
verb: verb,
args: args,
update: update,
group: group,
visible: visible,
enabled: enabled,
hint: hint,
check: check,
editLabel: editLabel,
);