lichess_client 0.0.13 copy "lichess_client: ^0.0.13" to clipboard
lichess_client: ^0.0.13 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 MyCustomGamesService implements GamesService {
  /// 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
  GamesService get games => MyCustomGamesService();
}

void main() => _tryRunAndThrowGhostImplementation();

Future<void> _tryRunAndThrowGhostImplementation() async {
  final MyCustomLichessClient customClient = MyCustomLichessClient();
  await customClient.account.getEmailAddress();
}
2
likes
0
pub points
1%
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

Funding

Consider supporting this project:

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

License

unknown (license)

Dependencies

freezed_annotation, json_annotation

More

Packages that depend on lichess_client