Skip to content

rishad13/dio_with_extension

Repository files navigation

🌐 Network API Service in Flutter

A modular and reusable Network API Service built with Dio in Flutter. This implementation emphasizes clean code, error handling, and structured responses using modern Flutter practices.


🚀 Features

  • GET, POST, PUT, DELETE requests handled efficiently.
  • Built with Dio for flexible and robust HTTP handling.
  • Error handling with Dio interceptors for logging and debugging.
  • Records for managing structured API responses.
  • Extensions for cleaner, scalable code.

🛠️ How to Use

  1. Clone the repository:

    git clone https://github.com/rishad13/dio_with_extension
  2. Install dependencies:

    flutter pub get
  3. Use the NetworkApiService class to handle API requests in your project:

    void _getApi() async {
        NetworkApiService apiService = NetworkApiService();
        var response = await apiService.getAPIResponse(
            "https://jsonplaceholder.typicode.com/posts", {}, null);
        if (response.fail != null) {
            throw response.fail!.message;
        } else {
            log(response.success!.response.data.toString());
        }
    }

🔗 Links


🤝 Contributing

We welcome contributions! Feel free to fork the repository, submit a pull request, or create an issue for any bugs or improvements.


💡 Let’s create robust and scalable APIs in Flutter!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published