fluttercandies / flutter_scrollview_observer

A widget for observing data related to the child widgets being displayed in a ScrollView. Maintainer: @LinXunFeng
https://pub.dev/packages/scrollview_observer
MIT License
451 stars 46 forks source link

[Bug report]: This package breaks my web support for flutter_iconpicker #90

Closed Ahmadre closed 2 months ago

Ahmadre commented 2 months ago

Version

1.21.1

Platforms

Web

Device Model

Web (Chrome 128.0..)

flutter info

[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [Version 10.0.22631.4037], locale de-DE)
    • Flutter version 3.24.1 on channel stable at C:\Users\rebar\fvm\versions\stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (10 days ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

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

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\rebar\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

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

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.15)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.32510.428
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\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.11+9-b60-7590822)

[√] VS Code (version 1.70.0)
    • VS Code at C:\Users\rebar\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.60.0

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

[√] Network resources
    • All expected network resources are available.

• No issues found!

How to reproduce?

These platforms are not supported:

Package not compatible with platform Web
Because:

package:flutter_iconpicker/flutter_iconpicker.dart that imports:
package:flutter_iconpicker/Dialogs/default_dialog.dart that imports:
package:flutter_iconpicker/IconPicker/icon_picker.dart that imports:
package:scrollview_observer/scrollview_observer.dart that imports:
package:scrollview_observer/src/sliver/sliver_observer_view.dart that imports:
package:scrollview_observer/src/listview/list_observer_view.dart that imports:
package:scrollview_observer/src/common/observer_widget.dart that imports:
--> dart:io <--

Useful Links

See your own support for web: https://pub.dev/packages/scrollview_observer/score (Platform support)

Example code (optional)

No response

Contact

@Ahmadre or mail@ahmadre.com

LinXunFeng commented 2 months ago

Why are we checking for kIsWeb when this package is not even compilable for web (because of the dart:io import)?

image

This doesn't make sense...you don't need Platform.* from dart:oi to check a platform...

I didn't encounter this error on my Mac and Windows.