This package is a custom network layer for Flutter that leverages the popular Dio HTTP client library to manage API requests. It provides a generic response model and supports optional request-based caching. The caching feature reduces unnecessary network traffic and improves application performance when the same API request is made multiple times.

With this package, you can easily manage your application’s network layer and develop faster, more efficient applications.


  • Generic response model
  • Request-based caching
  • Customizable request headers, query parameters, and request body, including support for multipart file uploads.

Getting Started


Add the following dependency to your pubspec.yaml file:

  busbus: ^0.1.0


Import the package

import 'package:busbus/busbus.dart';

Create a new Network Manager instance

INetworkManager manager = NetworkManager<SampleResponseModel>()
          responseModel: SampleResponseModel(),
          cacheStoreKey: 'boilerplate_cache',
          entityKey: 'body', // optional - defaults to 'body' || 'data' || 'result'

Make a request

final response = await coreDio.send<SamplePostModel, SamplePostModel>(
      parserModel: const SamplePostModel(),
      type: HttpTypes.get,
      cachePolicy: CachePolicy.forceCache, // optional - defaults to CachePolicy.noCache
      maxStale: const Duration(seconds: 10), // optional - defaults to 10 seconds if cachePolicy is CachePolicy.forceCache
    ) as SampleResponseModel;

    switch (response.statusCode) {
      case 1:
        return as SamplePostModel;
        return null;


This project is licensed under the MIT License – see the LICENSE file for details


View Github