IndexError class

A specialized RangeError used when an index is not in the range 0..indexable.length-1.

Also contains the indexable object, its length at the time of the error, and the invalid index itself.

Inheritance
Implemented types

Constructors

IndexError(int invalidValue, dynamic indexable, [String? name, String? message, int? length])
Creates a new IndexError stating that invalidValue is not a valid index into indexable. [...]

Properties

endint
read-only, override
The maximum value that value is allowed to assume.
hashCodeint
read-only, inherited
The hash code for this object. [...]
indexable → dynamic
final
The indexable object that invalidValue was not a valid index into.
invalidValue → dynamic
final, inherited
The invalid value.
lengthint
final
The length of indexable at the time of the error.
message → dynamic
final, inherited
Message describing the problem.
nameString?
final, inherited
Name of the invalid argument, if available.
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.
stackTraceStackTrace?
read-only, inherited
The stack trace at the point where this error was first thrown. [...]
startint
read-only, override
The minimum value that value is allowed to assume.

Methods

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

Operators

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

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-core/IndexError-class.html