clean_api 1.2.0 copy "clean_api: ^1.2.0" to clipboard
clean_api: ^1.2.0 copied to clipboard

Cleanest way to implement Rest Api with caching using functional programming aproach.

Getting started #

First setup your base url

void main() {
  cleanApi.instance().setup(baseUrl: 'https://catfact.ninja/', showLogs: true);
  runApp(const MyApp());
}

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);
13
likes
150
points
94
downloads

Publisher

verified publishersquadhead.com

Weekly Downloads

Cleanest way to implement Rest Api with caching using functional programming aproach.

Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

equatable, flutter, flutter_easylogger, fpdart, http

More

Packages that depend on clean_api