lemmy_api_client 0.21.0 copy "lemmy_api_client: ^0.21.0" to clipboard
lemmy_api_client: ^0.21.0 copied to clipboard

Future-based http client for the Lemmy API. Provides an easy interface and statically typed responses.

example/lib/main.dart

import 'package:lemmy_api_client/v3.dart';

Future<void> main() async {
  // instantiate your lemmy instance with the host uri
  const lemmy = LemmyApiV3('lemmy.ml');

  // call methods that are named after op codes from the lemmy docs
  final response =
      await lemmy.run(const Login(usernameOrEmail: 'asd', password: 'ads'));

  final messages = await lemmy
      .run(GetPrivateMessages(unreadOnly: true, auth: response.jwt!.raw));

  print(messages);
}
1
likes
120
pub points
0%
popularity

Publisher

unverified uploader

Future-based http client for the Lemmy API. Provides an easy interface and statically typed responses.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

freezed_annotation, http, json_annotation, web_socket_channel

More

Packages that depend on lemmy_api_client