deept_client 0.2.0 deept_client: ^0.2.0 copied to clipboard
Deep Translator API typed interface signatures and class/data models. Written in pure Dart with no HTTP dependencies.
example/deept_client_example.dart
import 'dart:io';
import 'package:deept_client/deept_client.dart';
class MyCustomGoogleService implements GoogleService {
/// A cool custom service implementation...
@override
void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
class MyCustomDeepTranslatorClient extends DeepTranslatorClient {
@override
MyCustomGoogleService get google => MyCustomGoogleService();
@override
Future<void> close({bool force = false}) async {
stdout.write('Because you can not download RAM.');
}
}
void main() => _tryRunAndThrowGhostImplementation();
Future<void> _tryRunAndThrowGhostImplementation() async {
final MyCustomDeepTranslatorClient customClient =
MyCustomDeepTranslatorClient();
await customClient.google.translate('Hi!', target: 'pt');
}