api_manager_plus 1.0.2 copy "api_manager_plus: ^1.0.2" to clipboard
api_manager_plus: ^1.0.2 copied to clipboard

A lightweight and Flutter-only API manager package with built-in connectivity checks, safe API calls, unified request helpers, and standardized response handling.

example/main.dart

import 'package:api_manager_plus/api_manager_plus.dart';

void main() async {
  try {
    final getData = await SafeApiCall.call(
      () => ApiRequestHelper.get('https://httpbin.org/get'),
    );
    print('GET Response: \n$getData');

    final postData = await SafeApiCall.call(
      () => ApiRequestHelper.post('https://httpbin.org/post', {'key': 'value'}),
    );
    print('POST Response: \n$postData');

    final putData = await SafeApiCall.call(
      () => ApiRequestHelper.put('https://httpbin.org/put', {'key': 'updated'}),
    );
    print('PUT Response: \n$putData');

    final deleteData = await SafeApiCall.call(
      () => ApiRequestHelper.delete('https://httpbin.org/delete'),
    );
    print('DELETE Response: \n$deleteData');

    // Replace this with an actual file path to test multipart
    // final file = File('path/to/file.png');
    // final uploadData = await SafeApiCall.call(() =>
    //   ApiRequestHelper.multipartUpload('https://httpbin.org/post', file));
    // print('Multipart Response: \n$uploadData');
  } catch (e) {
    print('Error: $e');
  }
}
1
likes
160
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight and Flutter-only API manager package with built-in connectivity checks, safe API calls, unified request helpers, and standardized response handling.

Repository (GitHub)
View/report issues

Topics

#api #http #network #connectivity #flutter

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

connectivity_plus, flutter, http

More

Packages that depend on api_manager_plus