Option<T extends Object>.from constructor

Option<T extends Object>.from(
  1. T? v
)

Create a option from a nullable value.

Passing a non-null value will result in a Some. Passing a null value will result in a None.

Implementation

factory Option.from(T? v) {
  return v == null ? None<T>() : Some(v);
}