Manager Dio Cookies in non web environments.
- Stores cookies in single file when changed
- Keep cookies in memory to provide when needed
- Supports Expires, Max-Age attributes.
- No Other attribute support.
- Cookies loaded from file when needed. No Async/Await setup needed
pubspec.yaml
dependencies:
dio_cookie_caching_handler: ^0.0.7
Run this command
flutter pub get
Setup:
import 'package:dio/dio.dart';
import 'package:dio_cookie_caching_handler/dio_cookie_caching_handler.dart';
import 'package:flutter/foundation.dart';
final dio = Dio();
if (!kIsWeb) {
dio.interceptors.add(cookieCachedHandler());
}