identifierWithRoute static method

String identifierWithRoute(
  1. Route? route
)

生成route的唯一标识

Implementation

static String identifierWithRoute(Route? route) {
  String identifier = "";
  if (route != null) {
    if (route.settings != null) {
      if (route is PopupRoute) {
        identifier = "${route.runtimeType.toString()}_${route.hashCode}";
      } else {
        if (route.settings.name != null) {
          identifier = "${route.settings.name}_${route.hashCode}";
        } else {
          identifier = "${route.toString()}_${route.hashCode}";
        }
      }
    }
  }
  return identifier;
}