Controller class
Marks a class as a bean of the presentation layer.
It does exactly what Component does. In this package it suits objects that drive a user interface, such as Flutter view models; the web starter gives it its request-handling meaning.
// The login screen's logic, with the auth service injected.
@Controller()
class LoginController {
LoginController(this.auth);
final AuthService auth;
}
Spring (Java):
@Controller
class LoginController {
LoginController(AuthService auth) { ... }
}
Constructors
- Controller([String? name])
-
Declares the bean;
namereplaces the default bean name.const
Properties
Methods
-
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