flutter_api_manager 1.0.0 copy "flutter_api_manager: ^1.0.0" to clipboard
flutter_api_manager: ^1.0.0 copied to clipboard

APIManager-Flutter is a flutter library that can manage the API calls from a single place.

APIManager-Flutter #

pub package codecov license pr-welcome Open Source Love

APIManager-Flutter is an API manager for flutter applications that can manage the API calls from a single place.

Features #

Here's the list of your all-in-one service

  • Manage token transaction
  • Secured token transaction
  • Basic CRUD operations
  • Upload file
  • Download file
  • Enable logging
  • Support Multi environment base url

Android Compatibility #

Since this package is dependent on flutter_secure_storage a minSdkVersion of >=18 is required

android > app > build.gradle

android {
    ...

    defaultConfig {
        ...
        minSdkVersion 18
        ...
    }

}

Usage #

To use this package, add flutter_api_manager as a dependency in your pubspec.yaml file.

...
flutter_api_manager: <latest_version>
...

Example #

Create a singleton and make requests

import 'package:flutter_api_manager/flutter_api_manager.dart';

class APIController {
  APIManager _apiManager = APIManager.getInstance(baseUrl: '<your-base-url>');
  
  static fetchResults() {
    _apiManager.request('endPoint', method: APIMethod.get).then((response) {
      ...    
    });
  }
  
  static uploadFile(File imageFile, String fileKey, Map data,) {
    _apiManager.uploadFile('endPoint', imageFile, fileKey, data: data).then((response) {
      ...    
    });
  }
}

Login once to set the token throughout the app

...
  static login() {
    String token = _getToken();
    _apiManager.login(token);
  }
...

Logout when you want to clear the token

...
  static logout() {
    _apiManager.logout();
  }
...

Want to Contribute #

Here's a way to start contributing

You are always WELCOME! We are are excited to see your awesome PRs.

NOTE: Please abide by the CODE OF CONDUCT.

Author & Maintainer ✒️ #

Dipanshu

3
likes
120
pub points
11%
popularity

Publisher

verified publisheriamdipanshus.in

APIManager-Flutter is a flutter library that can manage the API calls from a single place.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_secure_storage, http, http_parser, mime

More

Packages that depend on flutter_api_manager