NullabilitySuffix enum Null safety

Suffix indicating the nullability of a type.

This enum describes whether a ? or * would be used at the end of the canonical representation of a type. It's subtly different the notions of "nullable", "non-nullable", "potentially nullable", and "potentially non-nullable" defined by the spec. For example, the type Null is nullable, even though it lacks a trailing ?.

Constants

none → const NullabilitySuffix

An indication that the canonical representation of the type under consideration does not end with either ? or *.

const NullabilitySuffix(2)
question → const NullabilitySuffix

An indication that the canonical representation of the type under consideration ends with ?. Types having this nullability suffix should be interpreted as being unioned with the Null type.

const NullabilitySuffix(0)
star → const NullabilitySuffix

An indication that the canonical representation of the type under consideration ends with *. Types having this nullability suffix are called "legacy types"; it has not yet been determined whether they should be unioned with the Null type.

const NullabilitySuffix(1)
values → const List<NullabilitySuffix>

A constant List of the values in this enum, in order of their declaration.

const List<NullabilitySuffix>

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited