WasmComponentValueData constructor

WasmComponentValueData({
  1. required WasmComponentValueDataKind kind,
  2. required Uint8List rawBytes,
  3. bool? boolean,
  4. Object? integer,
  5. double? floatingPoint,
  6. String? string,
  7. List<WasmComponentValueData> items = const <WasmComponentValueData>[],
  8. List<Object?>? runtimeItems,
  9. int? index,
  10. String? label,
  11. List<String> labels = const <String>[],
  12. WasmComponentValueData? associatedValue,
  13. Object? associatedPayload,
  14. bool? isSome,
  15. bool? isOk,
})

Implementation

WasmComponentValueData({
  required this.kind,
  required this.rawBytes,
  this.boolean,
  this.integer,
  this.floatingPoint,
  this.string,
  this.items = const <WasmComponentValueData>[],
  this.runtimeItems,
  this.index,
  this.label,
  this.labels = const <String>[],
  this.associatedValue,
  this.associatedPayload,
  this.isSome,
  this.isOk,
}) {
  if (associatedValue != null && associatedPayload != null) {
    throw ArgumentError(
      'A Wasm component value cannot have both associatedValue and '
      'associatedPayload.',
    );
  }
  if (runtimeItems != null && items.isNotEmpty) {
    throw ArgumentError(
      'A Wasm component value cannot have both static items and runtime '
      'items.',
    );
  }
}