fetchly 0.5.6 copy "fetchly: ^0.5.6" to clipboard
fetchly: ^0.5.6 copied to clipboard

Fetchly provides a streamlined and user-friendly approach to harnessing the power of Dio within your Flutter applications.

example/lib/main.dart

import 'package:example/request_handler.dart';
import 'package:fetchly/fetchly.dart';
import 'package:flutter/material.dart';

import 'screens/todo_view.dart';

void main() {
  Fetchly.init(
      baseUrl: 'https://dummyjson.com/',
      onRequest: RequestHandler.onRequest,
      onError: RequestHandler.onError,
      printType: PrintType.print,
      config: FetchlyConfig(printLimit: 3000, showHeader: true));

  // to set token in header when user logged in
  Fetchly.setToken('token_value');

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fetchly Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const TodoView(),
    );
  }
}
3
likes
150
points
77
downloads

Publisher

unverified uploader

Weekly Downloads

Fetchly provides a streamlined and user-friendly approach to harnessing the power of Dio within your Flutter applications.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

ansicolor, dio, flutter, intl, yaml

More

Packages that depend on fetchly