lichess_client_dio 0.0.9 lichess_client_dio: ^0.0.9 copied to clipboard
Lichess HTTP client based on Dio. Cross-platform API wrapper written in pure Dart.
Lichess for Dart #
This is a library for interacting with Lichess API. It works on all platforms and exposes a collection of data classes and a extendable client interface.
Notice: This is not an official Lichess project. It is maintained by volunteers.
Installation #
dependencies:
lichess_client_dio: ^<latest-version>
Import:
import 'package:lichess_client_dio/lichess_client_dio.dart';
Usage #
The usage is pretty straightforward:
final lichess = LichessClientDio.create();
final user = await lichess.users.getPublicData(username: 'alexrintt');
// If you wanna make authenticated requests:
final lichess = LichessClientDio.create(accessToken: '<your-access-token>');
final email = await lichess.account.getEmailAddress();
Services that are currently available (complete or partially complete):
- ✅ Account.
- ✅ Users.
- ✅ Relations.
- ✅ Games.
- ✅ TV.
- ✅ Puzzles.
- ✅ Teams.
- ✅ Board.
- ❌ Bot.
- ❌ Challenges.
- ❌ Bulk pairings.
- ❌ Arena tournaments.
- ❌ Swiss tournaments.
- ❌ Simuls.
- ❌ Studies.
- ❌ Messaging.
- ❌ Broadcasts.
- ❌ Analysis.
- ❌ External engine.
- ❌ Opening Explorer.
- ❌ Tablebase.
- ❌ OAuth.
All services are accessible by lichess.<service-name>.<endpoint-name>(...)
.
Custom Dio instance #
By default, this package uses fresh Dio instance for handling HTTP requests, if you want to provide a custom instance, use dio
argument:
final myDioInstance = Dio();
final lichess = LichessClientDio.create(dio: myDioInstance);
Retrieve access token #
TL;DR: This package doesn't handle authentication for Lichess.
That said, to get an access token for your platform and for your use-case refer to the Lichess authentication section.
Contributing #
TODO.