nekos_best 2.1.4 nekos_best: ^2.1.4 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(endpoint: 'neko');
Classes #
Detailed documentation can be found in the Package API Reference. There is also examples on general usage of the package in the Official Nekos.Best docs.
The package exports a Client
class and a fetch
method. The fetch method uses the Client
classes Client.fetch
method internally. The client class has other two methods, a search
method and a fetchFile
method.
All possible usages are listed in details in the example/ directory.
Response #
There are two classes: NBResponse & NBBufferResponse. They have 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;
}
class NBBufferResponse {
final List<int> data;
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
See example/structs_example.dart for more.
Author #
nekos_best_dart © Yakiyo. Authored and maintained by Yakiyo.
Released under MIT License