quantum_fetch 0.3.4 copy "quantum_fetch: ^0.3.4" to clipboard
quantum_fetch: ^0.3.4 copied to clipboard

a flutter package to make api call.

quantum_fetch #

A module that uses powerful http library dio for network calls. You can directly start with already setup project or you can configure it the following way in your project.

Introduction #

quantum_fetch is a network module that has been created seperately for easily maintaining code for dio. The usage of this module is pretty simple.

 class MyFetchConfig implements QuantumFetchConfig {
  @override
  String get baseUrl => 'https://api.github.com';
  @override
  String tokenPrefix = 'Bearer ';
  @override
  Future<String?> get token => Future.value("my_authrization_token");
  @override
  List<Interceptor> get interceptors => [];

  @override
  int connectTimeout = 8000;

  @override
  String contentType = "application/json";

  @override
  Map<String, String> get headers => {"myheader": "myheadervalue"};
}
final fetchConfig = MyFetchConfig();
final quantumClient = QuantumFetch(fetchConfig);

QuantumFetchConfig is part of project dependency, from which we use the baseUrl in our quantum_fetch.

Basic Usage #

 final  response = await quantumClient.get<User>("/user",decoder: User.fromJson);
  print(response.success);
6
likes
105
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

a flutter package to make api call.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dio, dio_cache_interceptor, flutter, http_parser, mime, pretty_dio_logger

More

Packages that depend on quantum_fetch