Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken import dart:indexed_db in package's Support sound null safety score. #891

Closed
kithe-raker opened this issue May 16, 2021 · 7 comments

Comments

@kithe-raker
Copy link

I've just published my first flutter package.
The package was built with dart null-safety, but pub.dev said that my package doesn't support Null safety with Broken import dart:indexed_db issue.

  • here is screenshot
  • dart pub outdated --mode=null-safety
Showing dependencies that are currently not opted in to null-safety.
[✗] indicates versions without null safety support.
[✓] indicates versions opting in to null safety.

All your dependencies declare support for null-safety.
  • dart migrate
See https://dart.dev/go/null-safety-migration for a migration guide.

Note: more than one project found; migrating the top-level project.

Analyzing project...
[-----------------------------------------------------------------------------------------------------------------------------------------------------------/]All sources appear to be already migrated.  Nothing to do.
  • pubspec.yaml
name: network_font
description: network_font will help you use your custom font from network, so you don't have to store those fonts in your project directory's asset folder.
version: 0.0.4
homepage: https://github.com/kithe-raker/network_font

environment:
  sdk: ">=2.12.0 <3.0.0"
  flutter: ">=1.17.0"

dependencies:
  flutter:
    sdk: flutter

  # Get user's local path
  path_provider: ^2.0.1

  # Make get request to network font
  http: ^0.13.3

  # Store data to user's local
  hive: ^2.0.4

dev_dependencies:
  flutter_test:
    sdk: flutter
@isoos isoos transferred this issue from dart-lang/pub-dev May 28, 2021
@muhammadidrees
Copy link

Any update on this?
I am facing the same issue with my package

@isoos
Copy link
Collaborator

isoos commented Jul 13, 2021

In both cases this happens because Flutter seems to block dart:indexed_db, I'm not sure why. I've found this thread which suggest to use package:idb_shim instead:
flutter/flutter#44937

@muhammadidrees
Copy link

muhammadidrees commented Jul 13, 2021

@isoos my package doesn't have a direct dependency on dart:indexed_db. I've even looked into the dependencies and non of them have a reference for dart:indexed_db. Moreover, all the dependencies pub scores don't show this issue.

Here is the list of all the package dependencies:
flutter_bloc: ^7.0.1
hydrated_bloc: ^7.0.1
equatable: ^2.0.3
http: ^0.13.3
meta: ^1.7.0

@isoos
Copy link
Collaborator

isoos commented Jul 13, 2021

Yeah, I'm not sure either, I'll need to investigate this a bit...

@isoos
Copy link
Collaborator

isoos commented Jul 14, 2021

Extra debugging (exposing it in #922 for users) revealed the following import chain:

  • package:bloc_rest_api/bloc_rest_api.dart that imports:
  • package:bloc_rest_api/src/cubits/cubits.dart that imports:
  • package:hydrated_bloc/hydrated_bloc.dart that imports:
  • package:hydrated_bloc/src/hydrated_storage.dart that imports:
  • package:hydrated_bloc/src/hydrated_cipher.dart that imports:
  • package:hive/hive.dart that imports:
  • package:hive/src/object/hive_object.dart that imports:
  • package:hive/src/object/hive_list_impl.dart that imports:
  • package:hive/src/hive_impl.dart that imports:
  • package:hive/src/backend/storage_backend.dart that imports:
  • package:hive/src/backend/js/backend_manager.dart that imports:
  • package:hive/src/backend/js/storage_backend_js.dart that imports:
  • dart:indexed_db where dart:indexed_db is not reachable.

And the reason this is revealed in some packages but not in others:

  • dart:indexed_db is inaccessible from Flutter SDK, and packages analyzed with Flutter receive a similar report.
  • However, package:hydrated_bloc and package:hive doesn't require Flutter, it is analyzed with Dart SDK, and in those dart:indexed_db is accessible.

/cc @jonasfj

@jonasfj
Copy link
Member

jonasfj commented Jul 14, 2021

In the case of bloc_rest_api it has a Flutter dependency, hence, why it doesn't work.

I guess we should find out if dart:indexed_db works in Flutter Web.

@sigurdm
Copy link
Contributor

sigurdm commented Sep 28, 2023

Closing this in favour of the flutter issue: flutter/flutter#44937

@sigurdm sigurdm closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants