nookipedia_flutter 0.2.5 nookipedia_flutter: ^0.2.5 copied to clipboard
Flutter wrapper for Nookipedia API. The Nookipedia API provides endpoints for retrieving Animal Crossing data pulled from the Nookipedia wiki.
Dart wrapper for Nookipedia API. It provides simple methods for retrieving Animal Crossing data.
Features #
Contains wrapper methods for the following endpoints:
- Artwork
- Clothing
- Events
- Furniture
- Interiors
- Miscellaneous items available in the game
- Photos and Posters
- Recipes
- Tools
- Villagers
- Insects
- Fish
- Sea Creatures
- Fossils
Getting started #
Import the package:
import 'package:nookipedia_flutter/nookipedia_flutter.dart';
Initialize NookipediaClient
before using it:
void main() {
NookipediaClient.initialize(
apiKey: NOOKIPEDIA_API_KEY,
version: API_VERSION_HERE
);
runApp(const MyApp());
}
apiKey
is mandatory. You will have to apply for one here.
version
is optional. It controls which version of the API you are calling.
Usage #
Call the methods exposed by the API by using the client instance:
FutureBuilder(
future: NookipediaClient.instance.clothing
.fetchNames(category: ClothingCategory.dressUp),
builder: ((context, AsyncSnapshot<List<String>> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const Center(child: CircularProgressIndicator());
}
if (snapshot.hasError) {
return Text(snapshot.error?.toString() ?? "Something went wrong");
}
var data = snapshot.data!;
return ListView.builder(
itemCount: data.length,
itemBuilder: ((context, index) {
return ListTile(title: Text(data[index]));
}),
);
}),
)