FakeGame class final

A running game's VM service, answering over service as the real one answers over a socket, and recording every call it is sent.

The game has one isolate, main, whose extensions are extensions. A flutter tool attached to it is registered: its services by name, and what each answers in toolAnswers, null for success or an RPCError to refuse.

Constructors

FakeGame({Map<String, String>? registered, List<String> extensions = const <String>[]})
A game with extensions registered and, when registered is given, a flutter tool attached; none by default.

Properties

calls → List<Map<String, Object?>>
Every call, as {'method': …, 'params': …}, in order.
final
extensionAnswers → Map<String, Map<String, Object?>>
What an extension answers, by its name.
final
extensions → List<String>
The ext.* methods the main isolate lists in extensionRPCs.
final
hashCode → int
The hash code for this object.
no setterinherited
registered → Map<String, String>
The services a flutter tool registered on the game, protocol name to registered name, as flutterTool spells them; empty for a game no tool is attached to.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
service → VmService
The client end a run under test is handed in place of a connection.
latefinal
toolAnswers → Map<String, RPCError?>
What a registered method answers, by its registered name.
final

Methods

exits() → Future<void>
The game exiting, which closes the socket.
logs(String message) → void
The game calling dart:developer's log with message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
posts(String kind, {Map<String, Object?> data = const <String, Object?>{}, int time = 0}) → void
The game calling dart:developer's postEvent with kind and data — flutter3d_game's postToolEvent posts flutter3d.<kind> — at time, milliseconds since the epoch as the VM stamps it.
prints(String text) → void
The game printing text to stdout.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

flutterTool() → Map<String, String>
The flutter tool flutter run attaches, as DevTools finds it.

Constants

isolateId → const String
The id of the game's one isolate, main.