waifuim_dart 2.0.0-dev.1 copy "waifuim_dart: ^2.0.0-dev.1" to clipboard
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');
	}
}
1
likes
150
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Dart package that allows you to easily interact with the waifu.im API.

Repository

License

MIT (license)

Dependencies

http

More

Packages that depend on waifuim_dart