apsl_api_call 0.0.2 copy "apsl_api_call: ^0.0.2" to clipboard
apsl_api_call: ^0.0.2 copied to clipboard

A robust Flutter package for streamlined API calls. Simplifies error handling, supports multipart requests, and integrates seamlessly with various backends. Ideal for apps requiring reliable network c [...]

APSL API Call Package #

A Dart package designed to simplify the process of making API calls and handling exceptions.

Table of Contents #

Features #

  • API Calls: Provides methods for making both regular and multipart API calls.
  • Exception Handling: Handles common exceptions such as no internet, server errors, timeouts, and more.
  • Connectivity Checks: Automatically checks for internet connectivity before making an API call.
  • Predefined Error Messages: Includes a collection of predefined error messages for various API call scenarios.

Installation #

To use the apsl_api_call package, add it as a dependency in your pubspec.yaml file:

dependencies:
  apsl_api_call: ^1.0.0

Example #

Making an API Call

import 'package:apsl_api_call/apsl_api_call.dart';

// Define your API request information
APIRequestInfoObj requestInfo = APIRequestInfoObj(
    requestType: HTTPRequestType.get,
    url: "https://api.example.com/data",
    headers: {
        "Authorization": "Bearer YOUR_TOKEN"
    },
    serviceName: "GetData"
);

// Make the API call
http.Response response = await ApiCall.callService(requestInfo: requestInfo);

Contributing #

Contributions are welcome! Please read our contributing guidelines to get started.

2
likes
120
points
47
downloads

Publisher

verified publisherappstonelab.com

Weekly Downloads

A robust Flutter package for streamlined API calls. Simplifies error handling, supports multipart requests, and integrates seamlessly with various backends. Ideal for apps requiring reliable network communication.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

connectivity_plus, flutter, http, path

More

Packages that depend on apsl_api_call