hurshi / dio-http-cache

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

Is Flutter dependency required? #95

Closed eseidel closed 3 years ago

eseidel commented 3 years ago

I was attempting to use dio_http_cache from a pure dart command line app and ran into:

Resolving dependencies...
Because every version of dio_http_cache from path depends on flutter any from sdk which is forbidden, dio_http_cache from path is forbidden.
So, because flutter_eng_cycle_times depends on dio_http_cache from path, version solving failed.

Flutter users should run `flutter pub get` instead of `pub get`.
exit code 69

(I was using it from a path dependency, having previously thought it was related to the path, but rather it's due to me using dart pub get instead of flutter pub get. Sigh.

I don't see any code uses for flutter in lib/, just in examples/ Should the Flutter SDK dependency be removed from the main pubspec.yaml so this (otherwise-flutter-free) project can be used from non-Flutter Dart code?

Thanks for the consideration (and all the efforts on this package so far)!

eseidel commented 3 years ago

I filed an issue with pub about the confusing error message: https://github.com/dart-lang/pub/issues/2992

eseidel commented 3 years ago

I've locally edited the pubspec. Looks like it comes through from sqflite:

[flutter_eng_cycle_times] dart pub get
Resolving dependencies...
Because every version of dio_http_cache from path depends on sqflite >=1.1.2 which requires the Flutter SDK, dio_http_cache from path is forbidden.
So, because flutter_eng_cycle_times depends on dio_http_cache from path, version solving failed.

Flutter users should run `flutter pub get` instead of `pub get`.
exit code 1
eseidel commented 3 years ago

Looks like https://pub.dev/packages/dio_cache_interceptor might be the flavor I'm looking for.

Regardless, again thank you for all the hard work.