misskey 0.0.1 copy "misskey: ^0.0.1" to clipboard
misskey: ^0.0.1 copied to clipboard

This library provides the easiest and powerful Dart/Flutter library for Misskey API.

example/example.dart

// Copyright 2023 Kato Shinya. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided the conditions.

import 'package:misskey/misskey.dart';

Future<void> main() async {
  //! You need to specify misskey instance (domain) you want to access.
  final misskey = MisskeyApi(
    instance: 'misskey.io',
    accessToken: 'YOUR_ACCESS_TOKEN',

    //! Automatic retry is available when server error or network error occurs
    //! when communicating with the API.
    retryConfig: RetryConfig(
      maxAttempts: 5,
      onExecute: (event) => print(
        'Retry after ${event.intervalInSeconds} seconds...'
        '[${event.retryCount} times]',
      ),
    ),

    //! The default timeout is 10 seconds.
    timeout: Duration(seconds: 20),
  );

  try {
    final me = await misskey.accounts.lookupMe();

    print(me);
  } on UnauthorizedException catch (e) {
    print(e);
  } on RateLimitExceededException catch (e) {
    print(e);
  } on MisskeyException catch (e) {
    print(e);
  }
}
12
likes
130
points
34
downloads

Publisher

verified publishershinyakato.dev

Weekly Downloads

This library provides the easiest and powerful Dart/Flutter library for Misskey API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

freezed_annotation, http, json_annotation, universal_io

More

Packages that depend on misskey