paintMultiple method
It takes a list of positions and a list of colors, and for each position, it goes to that position and paints it with the corresponding color
Args:
positions (List<Pair<int, int>>): A list of pairs of integers. Each pair
represents the row and column of the cell to be painted.
colors (List
Implementation
void paintMultiple(
List<Pair<int, int>> positions,
List<String> colors,
String languageCode, {
required bool copyCommands,
}) {
final List<String> command = CommandsInspector.main(
positions,
colors,
copyCommands: copyCommands,
);
_interpreter.validateOnScheme(
command.joinToString(),
SchemasReader().currentIndex,
);
if (copyCommands) {
copyCommandsBuffer.addAll(command);
} else {
validCommandsBuffer.addAll(command);
allCommandsBuffer.addAll(
command
.map(
(String element) => parseToContainer(element, languageCode),
)
.flatten(),
);
}
notifyListeners();
}