lemmy_api_client 0.5.0

Dart native js
Flutter Android iOS web

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

Lemmy Dart API client #

pub package style: effective dart

A Dart client for the Lemmy API

Features #

  • Future-based
  • Works both for Web and Native environments
  • Simple 1:1 translation of the Lemmy API docs
  • Strictly typed responses
  • Http and websocket interface

Example #

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
  var token = await lemmy.login(usernameOrEmail: 'asd', password: 'ads');
  var messages =
      await lemmy.getPrivateMessages(unreadOnly: true, auth: token.raw);

  print(messages);
}

check out Lemmur, a mobile Lemmy client in Flutter


Original Lemmy logo made by Andy Cuccaro (@andycuccaro) under the CC-BY-SA 4.0 license. Remixed by Marcin Wojnarowski (@shilangyu) and re-released under the CC-BY-SA 4.0 license.

0
likes
110
pub points
47%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

xmarcinmarcin@gmail.com

License

MIT (LICENSE)

Dependencies

http, json_annotation, meta

More

Packages that depend on lemmy_api_client