addGroup method

bool addGroup(
  1. List middlewares,
  2. String pre,
  3. Function make
)

Implementation

bool addGroup(List middlewares, String pre, Function make) {
  this.group.using = true;

  if (pre.endsWith('/')) {
    pre = pre.substring(0, pre.length - 1);
  }

  this.group.pre = pre;

  if (middlewares.isNotEmpty) {
    this.group.middlewares = middlewares;
  }

  make();

  this.group.middlewares = [];
  this.group.using = false;

  return true;
}