CanvasCommand class abstract

This class encapsulates a single command that was issued to a MockCanvas. Most methods of MockCanvas will use a dedicated class derived from CanvasCommand to store all the arguments and then match them against the expected values.

Each subclass is expected to implement two methods:

  • equals(), which compares the current object against another instance of the same class; and
  • toString(), which is used when printing error messages in case of a mismatch.

Use helper function eq() to implement the first method, and repr() to implement the second.

Implementers

Constructors

CanvasCommand()

Properties

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

Methods

eq(dynamic a, dynamic b) bool
Helper function to check the equality of any two objects.
equals(covariant CanvasCommand other) bool
Return true if this command is equal to other, up to the given absolute tolerance. The argument other is guaranteed to have the same type as the current command.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
repr(dynamic a) String
Helper function to generate string representations of various components of a command.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited