ControllerMaid<Box> class

ControllerMaid wrap a _box and holding it. Provide a controller-like interface.

Maid will be spawned by ControllerMaid.of with an initial box. You can ask her to serve the box to you, or take another box.

She will call you after taking something new if you request a callMeOnTaken.

Implementers

Constructors

ControllerMaid.of(Box box, [bool vow = false])
Spawn with initial box. By default, maid would not vow to secure the box forever. So it can be take by another box.
factory

Properties

box ↔ Box
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callMeOnTaken(void request(Box oldBox, Box newBox)) → void
request is a function that takes two arguments, the old box and the new box.
cancelRequest(void request(Box oldBox, Box newBox)) → void
Cancel a previous request added by callMeOnTaken.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serve() → Box
Serve the box that maid is holding.
take(Box box) → Box
Take another box then return the old box.
toString() String
A string representation of this object.
inherited

Operators

operator +(void request(Box oldBox, Box newBox)) ControllerMaid<Box>
C# style operator overloading of callMeOnTaken.
operator -(void request(Box oldBox, Box newBox)) ControllerMaid<Box>
C# style operator overloading of cancelRequest.
operator <=(Box box) → Box
Alternative of take.
operator ==(Object other) bool
The equality operator.
inherited
operator ~() → Box
Alternative of serve.