0 purchases
clean api
Getting started #
First setup your base url
void main() {
cleanApi.instance().setup(baseUrl: 'https://catfact.ninja/', showLogs: true);
runApp(const MyApp());
}
copied to clipboard
Fetch your data #
final Either<ApiFailure, CatModel> response = await cleanApi.get(
fromJson: (json) => CatModel.fromJson(json), endPoint: 'fact');
changeState = response.fold((l) => l.toString(), (r) => r.fact);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.