StringOrInteger class abstract interface

An interface for a value representing String, int or BigInt data.

The optimal situation for representing integers would be just to use int. For Dart 2 it's 64 bit integer on VM enviroment. However in web enviroment (compiled with dart2js) it supports "all integers between -2^53 and 2^53, and some integers with larger magnitude". So for this reason also BigInt might be needed for storing integers out of that range.

Implementers

Constructors

StringOrInteger()

Properties

hashCode int
The hash code for this object.
no setterinherited
isBigInt bool
True if this value is stored as BigInt.
no setter
isInt bool
True if this value is stored as int.
no setter
isInteger bool
True if this value is stored as an integer (int or BigInt) value.
no setter
isString bool
True if this value is stored as a String.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asBigInt() BigInt
Returns this value as a BigInt value.
asInt() int
Returns this value as a int value.
asString() String
Returns this value as a String value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tryAsBigInt() BigInt?
This value as a BigInt value or null if cannot be converted to BigInt.
tryAsInt() int?
This value as a int value or null if cannot be converted to int.
tryAsString() String?
This value as a String value or null if cannot be converted to String.

Operators

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