Option<T>.from constructor

Option<T>.from(
  1. T? value
)

Creates an Option from the given nullable T value.

Creates:

  • Some if the given value is not null.
  • None if the given value is null.

Implementation

factory Option.from(T? value) => switch (value) {
	null => None(),
	_ => Some(value)
};