@@ -10,14 +10,14 @@ import 'action.dart';
1010
1111part 'set_value_action.g.dart' ;
1212
13- /// An action that sets a value to a property on a node.
13+ /// An action that sets value of a property of the node.
1414@JsonSerializable ()
1515class SetValueAction extends ActionModel
1616 with EquatableMixin , SerializableMixin {
17- /// ID of the node to set the value on .
17+ /// ID of the node whose values are to be set .
1818 final String nodeID;
1919
20- /// Values to set on the node.
20+ /// List of values to be set in the node.
2121 @JsonKey (fromJson: valuesFromJson)
2222 final List <ValueModel > values;
2323
@@ -52,14 +52,19 @@ enum SetValueMode {
5252 /// Sets the value directly.
5353 discrete,
5454
55- /// Toggles the value before setting it. Only applies to toggleable values
56- /// like booleans.
55+ /// Toggles the value before setting it.
56+ /// Only applicable on toggleable values, such as booleans.
5757 toggle,
5858
59- ///
59+ /// Syncs the value with the internal value of the node that is performing the
60+ /// action. [syncValue] works only if both the values are of same type.
61+ /// For example, if a checkbox node is performing an action to change the
62+ /// visibility of a node, the visibility will sync with checkbox's internal
63+ /// value, i.e., [checked -> visible] and [unchecked -> invisible] .
64+ /// In this case, both the values are of type [bool] .
6065 syncValue;
6166
62- /// Displayable string representation of this enum .
67+ /// Displayable string representation of [SetValueMode] .
6368 String get prettify {
6469 switch (this ) {
6570 case SetValueMode .discrete:
@@ -72,9 +77,9 @@ enum SetValueMode {
7277 }
7378}
7479
75- /// Represents a value to set on a node.
80+ /// Represents a value to set in a node.
7681abstract class ValueModel <T > with SerializableMixin {
77- /// The name of the property to set the value on .
82+ /// The name of the property to set the value of .
7883 final String name;
7984
8085 /// Describes how to set the value.
@@ -111,7 +116,7 @@ abstract class ValueModel<T> with SerializableMixin {
111116List <ValueModel > valuesFromJson (List values) =>
112117 values.map ((value) => ValueModel .fromJson (value)).toList ();
113118
114- /// A boolean type of value .
119+ /// Value of boolean type.
115120@JsonSerializable ()
116121class BoolValue extends ValueModel <bool ?> with SerializableMixin {
117122 /// Whether this property is nullable.
@@ -146,7 +151,7 @@ class BoolValue extends ValueModel<bool?> with SerializableMixin {
146151 Map toJson () => _$BoolValueToJson (this );
147152}
148153
149- /// An integer type of value .
154+ /// Value of integer type.
150155@JsonSerializable ()
151156class IntValue extends ValueModel <int > with SerializableMixin {
152157 /// Creates a new [IntValue] .
@@ -158,7 +163,8 @@ class IntValue extends ValueModel<int> with SerializableMixin {
158163 assert (mode != SetValueMode .toggle, '${mode .prettify } mode not supported.' );
159164 }
160165
161- /// Creates a new [IntValue] where the default value is 0 and mode is discrete.
166+ /// Creates a new [IntValue] where the default value is 0 and mode is
167+ /// discrete.
162168 const IntValue .discreteZero ({
163169 required super .name,
164170 super .value = 0 ,
@@ -183,7 +189,7 @@ class IntValue extends ValueModel<int> with SerializableMixin {
183189 Map toJson () => _$IntValueToJson (this );
184190}
185191
186- /// A double type of value .
192+ /// Value of double type.
187193@JsonSerializable ()
188194class DoubleValue extends ValueModel <double > with SerializableMixin {
189195 /// Creates a new [DoubleValue] .
@@ -195,7 +201,8 @@ class DoubleValue extends ValueModel<double> with SerializableMixin {
195201 assert (mode != SetValueMode .toggle, '${mode .prettify } mode not supported.' );
196202 }
197203
198- /// Creates a new [DoubleValue] where the default value is 0 and mode is discrete.
204+ /// Creates a new [DoubleValue] where the default value is 0 and mode is
205+ /// discrete.
199206 const DoubleValue .discreteZero ({
200207 required super .name,
201208 super .value = 0 ,
@@ -220,7 +227,7 @@ class DoubleValue extends ValueModel<double> with SerializableMixin {
220227 Map toJson () => _$DoubleValueToJson (this );
221228}
222229
223- /// A string type of value .
230+ /// Value of string type.
224231@JsonSerializable ()
225232class StringValue extends ValueModel <String > with SerializableMixin {
226233 /// Creates a new [StringValue] .
0 commit comments