getStaticFieldList function

Set<String> getStaticFieldList(
  1. List<PureRouteInfo> pureRouteList,
  2. List<InterceptorRouteInfo> interceptorRouteList
)

Implementation

Set<String> getStaticFieldList(
  List<PureRouteInfo> pureRouteList,
  List<InterceptorRouteInfo> interceptorRouteList,
) {
  String buildLine(String path) {
    String variantName = path2Variant(path);
    return "static const String $variantName = '$path';";
  }

  Set<String> content = HashSet();
  for (PureRouteInfo route in pureRouteList) {
    content.add(buildLine(route.path));
  }
  for (InterceptorRouteInfo route in interceptorRouteList) {
    content.add(buildLine(route.path));
  }
  return content;
}