value property

Object? get value

Indicates the value to set. Leave unset to request automatic setting for options that have autoSettable enabled. The data type supplied for value must match type.

Implementation

Object? get value => _wrapped.value?.when(
      isBool: (v) => v,
      isDouble: (v) => v,
      isArray: (v) =>
          v.toDart.cast<JSNumber>().map((e) => e.toDartDouble).toList(),
      isInt: (v) => v,
      isString: (v) => v,
    );
set value (Object? v)

Implementation

set value(Object? v) {
  _wrapped.value = switch (v) {
    bool() => v.toJS,
    double() => v.toJS,
    List<double>() => v.toJSArray((e) => e.toJS),
    int() => v.toJS,
    List<int>() => v.toJSArray((e) => e.toJS),
    String() => v.toJS,
    null => null,
    _ => throw UnsupportedError(
        'Received type: ${v.runtimeType}. Supported types are: bool, double, List<double>, int, List<int>, String')
  };
}