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

outdated

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

example/main.dart

import 'dart:io';

import 'package:lemmy_api_client/lemmy_api_client.dart';

void main() async {
  // instantiate your lemmy instance with
  // the host uri and choose the API version
  var lemmy = LemmyApi('dev.lemmy.ml').v1;

  // call methods that are named after op codes from the lemmy docs
  for (var i = 0; i < 200; i++) {
    await lemmy.getPosts(
        type: PostListingType.all, sort: SortType.active, communityId: 14799);
    stdout.write("$i\r");
  }
  // var token = await lemmy.login(usernameOrEmail: 'asd', password: 'ads');
  // var messages =
  //     await lemmy.getPrivateMessages(unreadOnly: true, auth: token.raw);

  // print(messages);
}
1
likes
0
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

License

unknown (LICENSE)

Dependencies

http, json_annotation, meta

More

Packages that depend on lemmy_api_client