Controller class

Annotation for creating queries for controllers.

You can define a query to retrieve the controller at static const query = _$(class name)ControllerQuery().

Used for classes inheriting from ChangeNotifier.

If autoDisposeWhenUnreferenced is set to true, it will automatically dispose of Controller when it is no longer referenced by any widget.

コントローラー用のクエリを作成するためのアノテーション。

static const query = _$(クラス名)ControllerQuery()にコントローラーを取得するためのクエリを定義できます。

ChangeNotifierを継承したクラスに対して利用します。

autoDisposeWhenUnreferencedtrueにした場合、Controllerがどのウィジェットにも参照されなくなったときに自動的に破棄します。

@controller
@listenables
class UserController extends ChangeNotifier {
  UserController();

  static const query = _$UserControllerQuery();
}
Available Extensions

Constructors

Controller({bool autoDisposeWhenUnreferenced = true})
Annotation for creating queries for controllers.
const

Properties

autoDisposeWhenUnreferenced bool
Returns true if Controller should be automatically destroyed when it is no longer referenced by any widget.
final
hashCode int
The hash code for this object.
no setterinherited
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