fluttium_protocol 0.1.0 copy "fluttium_protocol: ^0.1.0" to clipboard
fluttium_protocol: ^0.1.0 copied to clipboard

The protocol for the communication between the runner and the driver of Fluttium

fluttium logo

Pub ci coverage style: very good analysis License: MIT


The protocol for the communication between the runner and the driver of Fluttium.


The protocol is used to communicate from the Fluttium runner to the Fluttium driver. It exists out of three parts: Message, Emitter and the Listener.

The Message describes a single message being send from the runner to the driver. It has a type that indicates what type of message it is and depending on that type it's data is different:

  • start: String the step that is starting
  • done: String the step that is done
  • fail: List<String> with the step and the reason
  • store: List<dynamic> with the file name and then list of bytes.

The Emitter then handles emitting a message from the runner to the driver. The message can contain quite a bit of data, for instance storing a screenshot, and for that reason the Emitter emits the message in chunks. Firstly it emits a start object:

{"type": "start"}

After that it will emit one or more data chunks that make up the Message:

{"type": "data", "data": "... data ..."}

Each data chunk's data should be stored until the done object has been received:

{"type": "done"}

Once the done object has been received the data can be parsed as JSON and passed to the Message.fromJson constructor.

Listening to the data from an Emitter can be done by applying the logic above, or by using the Listener which expects a Stream of raw utf8 bytes. It assumes that any prefix to the messages, like flutter: added by Flutter, are removed by the one using the listener.

Once the listener has successfully constructed an emitted message it will add it to the messages stream.

1
likes
160
pub points
6%
popularity

Publisher

verified publisherfluttium.dev

The protocol for the communication between the runner and the driver of Fluttium

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

equatable, meta, yaml

More

Packages that depend on fluttium_protocol