hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

How I can disable this plugin for non Android / IOS / MACOS apps #123

Closed StancuFlorin closed 1 year ago

StancuFlorin commented 1 year ago

The web app is failing the error bellow and it would be nice to run the web app without cache

main.dart.js:4311 Uncaught MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
TianyongWang commented 1 year ago

来信已收到

StancuFlorin commented 1 year ago

Closing it since you can do

import 'package:flutter/foundation.dart' show kIsWeb;

with

    if (!kIsWeb) {
      dio.interceptors.add(DioCacheManager(CacheConfig(baseUrl: "https://google.com")).interceptor);
    }