getConstantLocalPath method

String? getConstantLocalPath()

If this VRouteElement is in the route but its localPath is null we try to find a local path in path, ...aliases

This is used in buildPage to form the LocalKey Note that

  • We can't use this because animation won't play if path parameters change for example
  • Using null is not ideal because if we pop from a absolute path, this won't animate as expected

Implementation

String? getConstantLocalPath() {
  if (pathParametersKeys.isEmpty) {
    return path;
  }
  for (var i = 0; i < aliasesPathParametersKeys.length; i++) {
    if (aliasesPathParametersKeys[i].isEmpty) {
      return aliases[i];
    }
  }
  return null;
}