waifuim_dart 2.0.0-dev.1
waifuim_dart: ^2.0.0-dev.1 copied to clipboard
A Dart package that allows you to easily interact with the waifu.im API.
example/example.dart
import 'dart:convert';
import 'dart:io';
import 'package:waifuim_dart/waifuim_dart.dart';
void main() async {
final waifuClient = WaifuImClient(token: 'WAIFUIM_TOKEN_HERE', debug: true);
// With v7 of the Waifu.im API, things have changed massively from v6 of the API.
final imageId = 1699;
try {
final image = await waifuClient.getImage(imageId);
print('Image URL: ${image['url']}');
print('Tags: ${image['tags']}');
print("Image obtained from: https://www.waifu.im");
} catch (e) {
print('An error occured: $e');
}
}