$route function

String $route(
  1. Type type
)

Returns the name of type

  • preceded with backslash /
  • lowercase first letter
  • removed Page word

i.e. TypeNamePage -> "/typeName"

Implementation

String $route(Type type) =>
    "/${$name(type).lowercaseFirst.replaceAll("Page", "")}";