toOption method

Option<T> toOption()

Convert a nullable type T? to Option:

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

Implementation

Option<T> toOption() => Option.fromNullable(this);