duplicateRemovalRoutes method

List<Route> duplicateRemovalRoutes({
  1. List<String> ruleOutRouteNames = const [],
})

去重后路由集合 ruleOutRouteName 排除路由名称

Implementation

List<Route> duplicateRemovalRoutes({List<String> ruleOutRouteNames = const []}) {
  List<Route> lst = [];
  Set<String> keys = HashSet();
  _routeMap.forEach((key, value) {
    var signList = key.split("#hash#");
    if (!ruleOutRouteNames.contains(signList[0]) && !keys.contains(signList[0])) {
      keys.add(signList[0]);
      lst.add(value);
    }
  });
  return lst;
}