api_placeholder 1.1.0
api_placeholder: ^1.1.0 copied to clipboard
Api Placeholder is a simple, light-weight package used for holding mock data in the form of API Response, that can be used for prototyping and testing, before using real API Endpoint.
API Placeholder #
A composable, light-weight package that can be used as a placeholder whenever you need some fake data. With this package, you can get some famous API Responses like, users, posts, comment, photos, todos, etc. It can be used for prototyping and testing, before using real Real API Endpoints.
Usage #
To use this plugin, add api_placeholder
as a dependency in your pubspec.yaml
void getFakeUsers() async {
String x = await ApiPlaceholder().getUsers()
// Return a list of users
print(x);
}
void getFakePhotos() async {
String x = await ApiPlaceholder().getPhotos(id: 4);
// When Id is passed, it returns only one photo with that particular Id
print(x);
}
void getFakeTodos() async {
String x = await ApiPlaceholder().getTodos(limit: 5);
// When limit is passed, it limits the number od todos.
print(x);
}
copied to clipboard
Additional information #
Everyone is welcome to contrbute, or file any issue on this package.
Github Repo: https://github.com/ViAsmit/api_placeholder_package