Dart API Referencedart:coreCastException

CastException Class

Thrown by the 'as' operator if the cast isn't valid.

Implements

TypeError

Constructors

Code new CastException(Object actualType, Object expectedType) #

CastException(this.actualType, this.expectedType);

Methods

Code String toString() #

String toString() {
  return "CastException: Casting value of type $actualType to"
         " incompatible type $expectedType";
}

Fields

Code final Object actualType #

final Object actualType;

Code final Object expectedType #

final Object expectedType;