lichess_client 0.0.24 copy "lichess_client: ^0.0.24" to clipboard
lichess_client: ^0.0.24 copied to clipboard

Lichess API typed interface signatures and class/data models. Written in pure Dart with no HTTP dependencies.

example/lichess_client_example.dart

import 'dart:io';

import 'package:lichess_client/lichess_client.dart';

class MyCustomAccountService implements AccountService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomRelationsService implements RelationsService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomUsersService implements UsersService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomTeamsService implements TeamsService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomTvService implements TvService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomPuzzlesService implements PuzzlesService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomGamesService implements GamesService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomBoardService implements BoardService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomOAuthService implements OAuthService {
  /// A cool custom service implementation...

  @override
  void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}

class MyCustomLichessClient extends LichessClient {
  @override
  AccountService get account => MyCustomAccountService();

  @override
  Future<void> close({bool force = false}) async {
    stdout.write('Because you can not download RAM.');
  }

  @override
  RelationsService get relations => MyCustomRelationsService();

  @override
  UsersService get users => MyCustomUsersService();

  @override
  TeamsService get teams => MyCustomTeamsService();

  @override
  TvService get tv => MyCustomTvService();

  @override
  PuzzlesService get puzzles => MyCustomPuzzlesService();

  @override
  GamesService get games => MyCustomGamesService();

  @override
  BoardService get board => MyCustomBoardService();

  @override
  OAuthService get oauth => MyCustomOAuthService();
}

void main() => _tryRunAndThrowGhostImplementation();

Future<void> _tryRunAndThrowGhostImplementation() async {
  final MyCustomLichessClient customClient = MyCustomLichessClient();
  await customClient.account.getEmailAddress();
}
1
likes
140
pub points
34%
popularity

Publisher

verified publisheralexrintt.io

Lichess API typed interface signatures and class/data models. Written in pure Dart with no HTTP dependencies.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

Funding

Consider supporting this project:

donate.alexrintt.io
github.com
www.patreon.com

License

MIT (LICENSE)

Dependencies

freezed_annotation, json_annotation

More

Packages that depend on lichess_client