removeRoute<T> method

void removeRoute<T>(
  1. SintPage<T> route
)

Implementation

void removeRoute<T>(SintPage<T> route) {
  for (final page in [route, ..._flattenPage(route)]) {
    // Children may share the same relative Page key under different
    // parents. Their fully qualified name identifies the right branch.
    final index = routes.indexWhere(
      (candidate) => candidate.name == page.name && candidate.key == page.key,
    );
    if (index >= 0) routes.removeAt(index);
  }
}