root property

RouteNode get root

Implementation

RouteNode get root {
  if (_root == null) {
    _root = new RouteNode();
    allActions.allClassNames.forEach((className) {
      String name = className;
      if (name.startsWith('module_')) {
        name = name.substring(7);
      }
      if (name.endsWith('Action')) {
        name = name.substring(0, name.length - 6);
      }
      var path = name.split('.').map((e) => e[0].toLowerCase() + e.substring(1)).toList();
      var exts = ['Json', 'Txt', 'Ico'];
      for (var ext in exts) {
        if (path.last.endsWith(ext)) {
          path.last = path.last.substring(0, path.last.length - ext.length) + '.' + ext.toLowerCase();
        }
      }
      _root!.add(
          path,
          className
      );
    });
  }
  return _root!;
}