GameTester<T extends Game> class
Customize this class with your specific Game type T
and a custom
provider () -> T
, plus some additional configurations including a game
widget builder createGameWidget, a custom pumpWidget function and a
custom gameSize.
- Implementers
Constructors
-
GameTester(GameCreateFunction<
T> createGame, {Vector2? gameSize, GameWidgetCreateFunction<T> ? createGameWidget, PumpWidgetFunction<T> ? pumpWidget})
Properties
-
createGame
→ GameCreateFunction<
T> -
Use createGame to create your game instance.
final
-
createGameWidget
→ GameWidgetCreateFunction<
T> ? -
Use createGameWidget to create the
GameWidget
. If omitted, the game instance returned by createGame will be wrapped into an emptyGameWidget
instance.final - gameSize → Vector2?
-
Override the game size to be provided during
onGameResize
. By default it will be a 500x500 square.final - hashCode → int
-
The hash code for this object.
no setterinherited
- makeReady ↔ bool
-
If true, the game will be brought into the "fully ready" state (meaning
all its pending lifecycle events will be resolved) before the start of
the test.
getter/setter pair
-
pumpWidget
→ PumpWidgetFunction<
T> ? -
Use pumpWidget to define your own function to pump widgets into
the Flutter test environment. When omitted, testGameWidget simply
will pass the created game widget instance to the test.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
configure(
{GameCreateFunction< T> ? createGame, Vector2? gameSize, GameWidgetCreateFunction<T> ? createGameWidget, PumpWidgetFunction<T> ? pumpWidget}) → GameTester<T> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
testGameWidget(
String description, {WidgetSetupFunction< T> ? setUp, WidgetVerifyFunction<T> ? verify, bool? skip, Timeout? timeout, bool? semanticsEnabled, dynamic tags}) → void -
Creates a
Game
specific test case with givendescription
which runs inside the Flutter test environment. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited