Skip to main content

dio_bolt 0.0.1 copy "dio_bolt: ^0.0.1" to clipboard
dio_bolt: ^0.0.1 copied to clipboard

A lightweight production networking layer built on top of Dio that removes boilerplate while keeping Dio fully accessible.

example/main.dart

import 'package:dio_bolt/dio_bolt.dart';

void main() async {
  // 1. Initialize DioBolt with readable status logging enabled
  final api = DioBolt(enableLogging: true);

  print('DioBolt initialized successfully with logging enabled!');
  print('Underlying Dio instance accessible: ${api.dio.runtimeType}');

  // 2. Universal non-throwing DioBoltResponse API
  // No try/catch needed for normal HTTP or network failures!
  final response = await api.get(
    'https://jsonplaceholder.typicode.com/posts/1',
  );

  if (response.isSuccess) {
    print('Application handler: Success (HTTP ${response.statusCode})');
  } else if (response.statusCode == 0) {
    print(
      'Application handler: Transport/network failure: ${response.message}',
    );
  } else {
    print(
      'Application handler: Server returned error HTTP ${response.statusCode}: ${response.message}',
    );
  }
}
1
likes
160
points
193
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight production networking layer built on top of Dio that removes boilerplate while keeping Dio fully accessible.

Repository (GitHub)
View/report issues

Topics

#dio #networking #http #rest #flutter

License

MIT (license)

Dependencies

dio

More

Packages that depend on dio_bolt