mastodon_dart 0.1.0+4 mastodon_dart: ^0.1.0+4 copied to clipboard
Unofficial Mastodon API.
import 'dart:io';
import 'package:mastodon_dart/mastodon.dart';
import 'package:web_socket_channel/io.dart';
main() async {
final baseUrl = Uri.parse(Platform.environment["BASE_URL"]);
final token = Platform.environment["TOKEN"];
final mastodon = Mastodon(
baseUrl,
websocketFactory: (uri) => IOWebSocketChannel.connect(uri),
)..token = token;
mastodon.publicTimelineStream().listen(print);
}