addController method Null safety
- Object controller
Add controller
into Dartness and handles
the methods annotated with Bind children to Controller.path and Bind.path.
In order to add the controller
the class must be annotated with Controller
Just the methods that are static and are annotated with any Bind annotation will be handled.
If the Bind annotation in the method is Get the method will also be called for Head requests matching Bind.path. This is because handling Get requests without handling Head is always wrong. To explicitly implement a Head handler the method must be created before the Get handler.
throws ArgumentError if controller
is not annotated with Controller
Implementation
void addController(final Object controller) {
_server.addController(controller);
}