flutter_pear 0.2.1 copy "flutter_pear: ^0.2.1" to clipboard
flutter_pear: ^0.2.1 copied to clipboard

Dart-idiomatic Flutter API for the Pear P2P stack (Hyperswarm, Hypercore, Hyperbee, Hyperdrive, Autobase, blind pairing) over a bundled Bare worklet.

example/README.md

Example #

A full runnable two-phone chat demo lives at packages/flutter_pear_example in this repo (a separate Flutter app, since flutter_pear itself is a plugin, not an app).

Minimal usage — join a topic and exchange bytes with whoever else joins it:

import 'dart:convert';
import 'package:flutter_pear/flutter_pear.dart';

final pear = await Pear.start();
final topic = PearCrypto.unsafeTopicFromString('my-secret-room');
final swarm = await pear.join(topic);

swarm.connections.listen((PearConnection conn) {
  conn.data.listen((bytes) => print('peer: ${utf8.decode(bytes)}'));
  conn.write(utf8.encode('hello from Flutter'));
});

See the repository README's quick start for the full walkthrough and expected output.

0
likes
0
points
348
downloads

Publisher

unverified uploader

Weekly Downloads

Dart-idiomatic Flutter API for the Pear P2P stack (Hyperswarm, Hypercore, Hyperbee, Hyperdrive, Autobase, blind pairing) over a bundled Bare worklet.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, flutter, flutter_pear_bare

More

Packages that depend on flutter_pear