value property

Object? get value

The current value of the option, if relevant. Note that the data type of this property must match the data type specified in 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')
  };
}