Skip to content

Commit 130f9d9

Browse files
committed
Set List Variable Action #3
* Change type of index from int to String.
1 parent 0eddd2c commit 130f9d9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

lib/src/api/models/action/set_variable_action.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@ class SetVariableAction extends ActionModel
6363
final ListOperation listOperation;
6464

6565
/// Index of the value to be updated/removed/inserted.
66+
/// Can be a discrete value or a variable refered by '${}' syntax.
6667
/// Used for list type variable.
67-
final int index;
68+
final String index;
6869

6970
/// Creates a new [SetValueAction].
7071
SetVariableAction({
7172
required this.variable,
7273
required this.newValue,
7374
this.toggled = false,
7475
this.listOperation = ListOperation.replace,
75-
this.index = 0,
76+
this.index = '0',
7677
}) : super(type: ActionType.setVariable);
7778

7879
@override
@@ -84,7 +85,7 @@ class SetVariableAction extends ActionModel
8485
String? newValue,
8586
bool? toggled,
8687
ListOperation? listOperation,
87-
int? index,
88+
String? index,
8889
}) =>
8990
SetVariableAction(
9091
variable: variable ?? this.variable,

lib/src/api/models/action/set_variable_action.g.dart

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)