serial 0.0.5 copy "serial: ^0.0.5" to clipboard
serial: ^0.0.5 copied to clipboard

Platformweb

Serial port for flutter. Wrapper around the `window.navigator.serial` for web platform.

serial is a wrapper around the window.navigator.serial. This package does not provide any additional API, but merely helps to make the dart:html package work "out of the box" without the need of manually writing any javascript code.

Web Demo #

Web Demo

Requirements #

In order to access serial ports on web, you need your web page to open from an HTTPS url.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

More information: https://developer.mozilla.org/en-US/docs/Web/API/SerialPort

Usage #

import 'dart:html';
import 'package:serial/serial.dart';

final port = await window.navigator.serial.requestPort();
await port.open(baudRate: 9600);

final writer = port.writable.writer;

await writer.ready;
await writer.write(Uint8List.fromList('Hello World.'.codeUnits));

await writer.ready;
await writer.close();
12
likes
150
points
536
downloads

Publisher

verified publisherpwa.ir

Weekly Downloads

Serial port for flutter. Wrapper around the `window.navigator.serial` for web platform.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

js

More

Packages that depend on serial