UnitBuilder<Unit, Args> mixin

A mixin that provides functionality for building and arranging units in test scenarios.

This mixin is typically used in conjunction with TestDirector to create flexible and reusable test setups for Flutter widgets and other units.

The Unit type parameter represents the type of object being built (e.g., a Widget), while Args represents the type of arguments used to construct the unit.

Usage:

class MyTestDirector extends TestDirector<Widget, String> {
  MyTestDirector() {
    setUnitFactory((args) => MyWidget(text: args));
    addUnitArrangement((widget) => Container(child: widget));
  }
}
Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unit ↔ Unit
The built unit, available after buildUnit is called.
latefinal

Methods

addUnitArrangement(Unit arrangement(Unit)) → void
Adds an arrangement function to modify or wrap the unit after its initial creation.
buildUnit(Args args) → Unit
Builds the unit using the factory and applies all arrangements.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setUnitFactory(UnitFactory<Unit, Args> unitFactory) → void
Sets the factory function used to create the initial unit.
toString() String
A string representation of this object.
inherited

Operators

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