operator [] method

dynamic operator [](
  1. int index
)

Provides index-based access to results using bracket notation.

Returns the result as dynamic. For type-safe access, use getRequestByIndex<T>.

Example:

final result = results[0]; // Returns dynamic
final typedResult = results.getRequestByIndex<UserInfo>(0); // Type-safe

Throws:

  • RangeError if index is out of bounds [0, length)
  • The original error if the request at this index failed

Note: Prefer getRequestByIndex<T> for type safety.

Implementation

dynamic operator [](int index) {
  // Delegate to getRequestByIndex for consistent behavior
  return getRequestByIndex<dynamic>(index);
}