nekos_best 2.0.0 nekos_best: ^2.0.0 copied to clipboard
A dart package for interacting with nekos.best api. Easy and simple package to make requests to nekos.best and fetch results.
Nekos.Best Dart #
A minimal Dart package for interacting with Nekos.best api.
Getting started #
Add the package to your project's pubspec.yaml
file. You can use the dart cli
$ dart pub add nekos_best
Usage #
Import the package in your dart file and use the methods
import 'package:nekos_best/nekos_best.dart' as nb;
var res = nb.fetch('neko');
Methods #
The package only exports a single function
Future<List<NBResonse>> fetch({String? endpoint = null, int amount = 1})
#
You can specify endpoint
and amount
thought both are optional. By default amount is set to 1. If endpoint is not specified, it chooses a random one.
The function returns a List<NBResponse>
Examples are in example/fetch.dart file.
Response #
A nb response class has the following fields. Refer to the officials nekos.best docs for more info.
class NBResponse {
final String url;
final String? artist_href;
final String? artist_name;
final String? source_url;
final String? anime_name;
}
You can access the fields with dot notation i.e.
var neko_url = neko.url; // neko is an instance of NBResponse
Author #
nekos_best_dart © Yakiyo. Authored and maintained by Yakiyo.
Released under MIT License