Skip to content

network_sdk Free

HTTP client abstraction with Dio or http implementation.

Version: 2.0.0

Variables

VariableTypeDefaultDescription
appNamestringThe name of your application
networkLibraryenum (dio, http)dioThe HTTP client library to use
isForMonorepobooleantrueWhether this is being generated as part of a monorepo

Usage

Interactive

bash
archipelago generate network_sdk

Non-interactive (CI)

bash
archipelago generate network_sdk --config my_config.json

Config Template

json
{
  "@appName": "The name of your application",
  "appName": "MyApp",
  "@networkLibrary": "The HTTP client library to use (dio | http)",
  "networkLibrary": "dio",
  "@isForMonorepo": "Whether this is being generated as part of a monorepo",
  "isForMonorepo": true
}

Generated Structure

Always generated:

infrastructure/
└── network_sdk_api/
    ├── lib/
    │   ├── network_sdk_api.dart
    │   └── src/
    │       ├── client/
    │       │   └── http_client.dart
    │       ├── enums/
    │       │   └── http_method.dart
    │       ├── exception/
    │       │   ├── http_cancelled_exception.dart
    │       │   ├── http_exception.dart
    │       │   ├── http_network_exception.dart
    │       │   ├── http_parse_exception.dart
    │       │   ├── http_request_exception.dart
    │       │   └── http_timeout_exception.dart
    │       ├── interceptor/
    │       │   └── http_interceptor.dart
    │       ├── request/
    │       │   ├── http_request.dart
    │       │   └── request_options.dart
    │       └── response/
    │           └── http_response.dart
    ├── pubspec.yaml
    └── README.md

When networkLibrary is dio:

infrastructure/
└── network_sdk_dio/
    ├── lib/
    │   ├── network_sdk_dio.dart
    │   └── src/
    │       ├── client/
    │       │   └── dio_http_client.dart
    │       ├── config/
    │       │   └── dio_config.dart
    │       ├── di/
    │       │   ├── injector.dart
    │       │   ├── injector.module.dart
    │       │   └── register_module.dart
    │       └── interceptor/
    │           └── dio_interceptor_adapter.dart
    ├── pubspec.yaml
    └── README.md

When networkLibrary is http:

infrastructure/
└── network_sdk_http/
    ├── lib/
    │   ├── network_sdk_http.dart
    │   └── src/
    │       ├── client/
    │       │   └── dart_http_client.dart
    │       ├── config/
    │       │   └── http_config.dart
    │       └── di/
    │           ├── injector.dart
    │           ├── injector.module.dart
    │           └── register_module.dart
    ├── pubspec.yaml
    └── README.md

Built by Banua Coder