Operation constructor

Operation(
  1. String key,
  2. int? length,
  3. Object? data,
  4. Map? attributes,
)

Implementation

Operation(this.key, this.length, this.data, Map? attributes)
    : assert(_validKeys.contains(key), 'Invalid operation key "$key".'),
      assert(() {
        if (key != Operation.insertKey) return true;
        return data is String ? data.length == length : length == 1;
      }(), 'Length of insert operation must be equal to the data length.'),
      _attributes =
          attributes != null ? Map<String, dynamic>.from(attributes) : null;