toInputFormat method

List<String> toInputFormat()

Serializes the extra info into the SDK input format (list of strings).

Integer keys are serialized as single values; non-integer keys are serialized as key = value pairs.

Returns

  • List<String>: The serialized representation suitable for passing to SDK methods.

Implementation

List<String> toInputFormat() {
  final List<String> output = <String>[];
  _data.forEach((final dynamic key, final dynamic value) {
    if (key is int) {
      // If the key is an integer, it means the original input was a single value
      output.add(value);
    } else {
      // If the key is not an integer, it means the original input was a key-value pair
      output.add('$key = $value');
    }
  });
  return output;
}