nekos_best 1.0.2 copy "nekos_best: ^1.0.2" to clipboard
nekos_best: ^1.0.2 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 #

CI Pub Package

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 #

Future<Map<String, dynamic>> fetch([String? endpoint]) #

Fetch results from an optionally specified category. If mentioned, it'll fetch from that category. If not mentioned, it will use a random category. Returns a single response map

Future<List<Map<String, dynamic>>> fetchMultiple(String endpoint, {int amount = 5}) #

Fetch multiple results from a specified endpoint. Endpoint is must, the amount is optional. If left unspecified, it defaults to 5. Maximum is 20. If provided value is more than 20, it resets to 20. Returns a list of response map

Examples are in example/fetch.dart file.

Response #

A nb response has the following fields. Refer to the officials nekos.best docs for more info.

// Image response
{
  url: string,
  artist_href: string,
  artist_name: string,
  source_url: string,
}
// gif response
{
  url: string,
  anime_name: string,
}

You can access the fields like you would for a Map class.

var neko = nb.fetch('neko');
print('Neko url: ${neko["url"]} Neko artist: ${neko["artist_name"]}');

Author #

nekos_best_dart © Yakiyo. Authored and maintained by Yakiyo.

Released under MIT License

2
likes
120
pub points
12%
popularity

Publisher

unverified uploader

A dart package for interacting with nekos.best api. Easy and simple package to make requests to nekos.best and fetch results.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http

More

Packages that depend on nekos_best