Options class

A macro that in combination with Controller macro will register a route

Requirements:

  • method must be inside a class annotated with Controller
  • method can't have optional parameters
  • can optionally return Response and accept a Request
  • instead of Response you can also use following types:
@Controller()
class MyController {
  @Get('/hello')
  Response hello(Request r) => Response.ok('Hello');

  @Get('/wave')
  String wave() => '_o/';
}

See also:

  • Controller, which is required for a route to be registered.

Constructors

Options.new(String route)
A macro that in combination with Controller macro will register a route
const

Properties

hashCode int
The hash code for this object.
no setterinherited
route String
Route for this method
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildDeclarationsForMethod(MethodDeclaration method, MemberDeclarationBuilder builder) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited