cast method

T cast(
  1. dynamic value
)

Casts the argument to this data type, otherwise throw an ArgumentError.

Implementation

T cast(dynamic value) => throw ArgumentError.value(
    value, 'value', 'Unable to cast "$value" to $this.');