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

[device_info_plus]: According to package analysis, device_info_plus 8.1.0 is not Web compatible?? #1651

Closed
7 tasks done
Andrious opened this issue Mar 28, 2023 · 3 comments · Fixed by #2028
Closed
7 tasks done
Labels
question Further information is requested

Comments

@Andrious
Copy link

Andrious commented Mar 28, 2023

What is your question?

I want my Dart package, fluttery framework, to be Web-compatible, but it appears device_info_plus is preventing this.

When I publish it to Pub.dev, the package analysis states it's not Web compatible.

However, it's device_info_plus itself that imports device_info_plus_linux which eventually imports dart:io.

dart:io is not Web compatible! (see Platform support).

That's beyond my control! Is it not?
And so my question is, how can I use device_info_plus and be Web-compatible at the same time?

I'm importing the plus plugin in the following file:
package:fluttery_framework/src/controller/device_info.dart
import
When the app starts up, the plugin is then called:
info

Possible Solution

I was looking through the source code:

Would introducing a conditional import on the 'linux' file as well as the 'Windows' file be helpful:?:
image

This will allow device_info_plus to be used and supported on all 6 platforms.

Package Analysis

Platform support
20/20 points: Supports 5 of 6 possible platforms (iOS, Android, Web, Windows, MacOS, Linux)
✓ Android
✓ iOS
✓ Windows
✓ Linux
✓ MacOS
These platforms are not supported:

Package not compatible with platform Web
Because:

package:fluttery_framework/controller.dart that imports:
package:fluttery_framework/src/controller/device_info.dart that imports:
package:device_info_plus/device_info_plus.dart that imports:
package:device_info_plus/src/device_info_plus_linux.dart that imports:
package:file/local.dart that imports:
package:file/src/backends/local.dart that imports:
package:file/src/backends/local/local_file_system.dart that imports:
package:file/src/backends/local/local_link.dart that imports:
package:file/src/backends/local/local_file_system_entity.dart that imports:
package:file/src/backends/local/local_file.dart that imports:
package:file/src/io.dart that imports:
dart:io

System Info

package: fluttery framework
plugin: device_info_plus 8.1.0

flutter doctor -v
[√] Flutter (Channel stable, 3.7.8, on Microsoft Windows [Version 10.0.22621.1413], locale en-CA)
    • Flutter version 3.7.8 on channel stable at C:\Programs\Tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (7 days ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Programs\Tools\Android\SDK
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = C:\Programs\Tools\Android\SDK
    • ANDROID_SDK_ROOT = C:\Programs\Tools\Android\SDK
    • Java binary at: C:\Programs\Tools\Android\Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Programs\Tools\Android\Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] IntelliJ IDEA Community Edition (version 2019.1)
    • IntelliJ at C:\Programs\Tools\Dart\IntelliJ
    • Flutter plugin version 35.0.3
    • Dart plugin version 191.7019

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.1413]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 111.0.5563.146
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 111.0.1661.41

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Steps to Reproduce

Publishing with the latest version of device_info_plus.

Expected results: 20/20 points: Supports 6 of 6 possible platforms

Actual results: 20/20 points: Supports 5 of 6 possible platforms

Please, I am at a loss. What am I missing here?

analysis

Checklist before submitting a question

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I am using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@fabiancrx
Copy link
Contributor

Hi @Andrious , I see you have also raised #1654 , with mostly the same information, I think its better if we keep the discussion focused in this issue. Also if you already have a proposed fix feel free to create a PR , which is way easier for maintainers to check.

@vbuberen
Copy link
Collaborator

vbuberen commented May 1, 2023

Thanks for reporting this issue. As was suggested by a person above it would be better to create a PR to check out the proposed solution.

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
3 participants