toNonNullable method

Kind<T> toNonNullable()

Returns a non-nullable version of this kind.

There are two cases:

  • If this kind is NullableKind<T>, returns the wrapped kind.
  • Otherwise returns this kind.

Examples

import 'package:kind/kind.dart';

StringKind().toNonNullable(); // --> StringKind()
NullableKind(StringKind()).toNonNullable(); // --> StringKind()

Implementation

Kind<T> toNonNullable() => this;