FakeWatchBridgePlatform class
A platform that stays in memory. Use it alone to script a watch, or as one end of a SimulatedWatchLink.
- Inheritance
-
- Object
- PlatformInterface
- FlutterWatchBridgePlatform
- FakeWatchBridgePlatform
Constructors
- FakeWatchBridgePlatform({WatchStatus status = const WatchStatus(supported: true, paired: true, appInstalled: true, reachable: true, activated: true, watchName: 'Fake Watch')})
Properties
-
cancelledTransfers
→ List<
String> -
final
-
enqueued
→ List<
String> -
final
-
fileStream
→ Stream<
RawIncomingFile> -
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- initializeError ↔ Object?
-
Stops initialize from succeeding, to test failure paths.
getter/setter pair
-
messageStream
→ Stream<
RawMessage> -
no setteroverride
-
queuedStream
→ Stream<
String> -
no setteroverride
- replyBuilder ↔ String? Function(String json)?
-
When there is no peer, a request is answered with this (null = empty).
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sentFiles
→ List<
String> -
final
-
sentMessages
→ List<
String> -
What this end sent, for assertions.
final
-
stateStream
→ Stream<
RawStateUpdate> -
no setteroverride
- status ↔ WatchStatus
-
getter/setter pair
-
statusStream
→ Stream<
WatchStatus> -
no setteroverride
-
syncedState
→ Map<
String, String> -
final
-
transferStream
→ Stream<
TransferProgress> -
no setteroverride
Methods
-
cancelTransfer(
String id) → Future< void> -
override
-
emitFile(
String path, {String? metadataJson}) → void -
emitMessage(
String json, {String? id, bool expectsReply = false}) → void - Pretends the watch sent a message.
-
emitQueued(
String json) → void -
emitState(
String key, String json) → void -
emitTransfer(
TransferProgress progress) → void -
enqueue(
String json) → Future< void> -
override
-
getState(
) → Future< Map< String, String> > -
override
-
getStatus(
) → Future< WatchStatus> -
override
-
initialize(
) → Future< void> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replyToMessage(
String id, String? json) → Future< void> -
override
-
sendFile(
String path, String? metadataJson) → Future< String> -
Starts a file transfer and returns its id.
override
-
sendMessage(
String json, {Duration? replyTimeout}) → Future< String?> -
Sends a live message. With a null
replyTimeoutit is fire-and-forget and resolves with null. Otherwise it waits for the watch to reply and resolves with the reply JSON (null for an empty reply), or throwsWatchTimeoutException.override -
syncState(
String key, String json) → Future< void> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited