https://github.com/101loop/apimanager-flutter
APIManager-Flutter is a flutter library that can manage the API calls from a single place.
https://github.com/101loop/apimanager-flutter
api apimanager-flutter flutter flutter-package hacktoberfest
Last synced: 10 months ago
JSON representation
APIManager-Flutter is a flutter library that can manage the API calls from a single place.
- Host: GitHub
- URL: https://github.com/101loop/apimanager-flutter
- Owner: 101Loop
- License: mit
- Created: 2020-09-27T11:16:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T17:31:35.000Z (about 2 years ago)
- Last Synced: 2025-04-30T15:09:31.355Z (10 months ago)
- Topics: api, apimanager-flutter, flutter, flutter-package, hacktoberfest
- Language: Dart
- Homepage:
- Size: 153 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# APIManager-Flutter
[](https://pub.dev/packages/flutter_api_manager)



[](https://github.com/ellerbrock/open-source-badges/)
`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
- [x] Manage token transaction
- [x] Secured token transaction
- [x] Basic CRUD operations
- [x] 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
...
}
}
```
## Installation
To install this package, run
> flutter pub add flutter_api_manager
### Usage
Create a singleton and make requests
``` dart
import 'package:flutter_api_manager/flutter_api_manager.dart';
class APIController {
APIManager _apiManager = APIManager.getInstance(baseUrl: '');
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
```dart
...
static login() {
String token = _getToken();
_apiManager.login(token);
}
...
```
Logout when you want to clear the token
```dart
...
static logout() {
_apiManager.logout();
}
...
```
## Want to Contribute
[Here's a way to start contributing](https://github.com/101Loop/APIManager-Flutter/blob/master/CONTRIBUTING.md)
You are always WELCOME! We are excited to see your awesome PRs.
NOTE: Please abide by the
[CODE OF CONDUCT.](https://github.com/101Loop/APIManager-Flutter/blob/master/CODE_OF_CONDUCT.md)