go method

  1. @override
void go([
  1. int? distance
])
override

Implementation

@override
void go([int? distance]) {
  // The effect is is asynchronous
  scheduleMicrotask(() {
    final newIndex = _index + (distance ?? 0);
    if (newIndex < 0 || newIndex >= _stack.length) {
      // Fail silently
      return;
    }
    _setStateAndDispatchEvent(_stack[newIndex]);
    _index = newIndex;
  });
}