Skip to main content

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

A simple and opinionated Dio-based HTTP client for Flutter with built-in authentication session handling, token refresh support, unified API responses, file upload/download helpers, and model conversi [...]

example/main.dart

import 'package:easy_dio_client/src/dio_client.dart';
import 'package:flutter/material.dart';
import 'package:easy_dio_client/easy_dio_client.dart';
import 'pages/splash_screen.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  DioClient.init(
    baseUrl: "https://reqres.in/api",
    refreshTokenEndpoint: "/refresh",
    refreshTokenEndpointKey: "refresh_token",
    accessTokenKey: "access_token",
    refreshTokenKey: "refresh_token",
    onAuthFailure: () {
      debugPrint("Auth failed");
    },
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: const SplashScreen());
  }
}
0
likes
0
points
68
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and opinionated Dio-based HTTP client for Flutter with built-in authentication session handling, token refresh support, unified API responses, file upload/download helpers, and model conversion using generics.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, flutter_secure_storage, http_parser

More

Packages that depend on easy_dio_client