back method

  1. @override
void back()
override

Implementation

@override
void back() {
  while (urlChanges.isNotEmpty && urlChanges.last.startsWith('replace: ')) {
    urlChanges.removeLast();
  }
  if (urlChanges.isNotEmpty) {
    urlChanges.removeLast();
    var nextUrl = urlChanges.isNotEmpty ? urlChanges.last : '';
    if (nextUrl.startsWith('replace: ')) {
      nextUrl = nextUrl.substring('replace: '.length);
    }
    simulatePopState(nextUrl);
  }
}