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) { ... }
}
Inheritance

Constructors

Controller([String? name])
Declares the bean; name replaces the default bean name.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String?
The bean name; null gives the class name in lowerCamelCase.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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