hm21 / pro_image_editor

The pro_image_editor is a Flutter widget designed for image editing within your application. It provides a flexible and convenient way to integrate image editing capabilities into your Flutter project.
https://hm21.github.io/pro_image_editor/
BSD 3-Clause "New" or "Revised" License
94 stars 59 forks source link

[Bug]: Exception on web, vibration package is broken #139

Closed sgehrman closed 2 months ago

sgehrman commented 2 months ago

Package Version

4.0.8

Flutter Version

3.22

Platforms

Web

How to reproduce?

Screenshot-20240625205458-1878x1590

Logs (optional)

No response

Example code (optional)

set the debugger to break on all exceptions

Device Model (optional)

linux

sgehrman commented 2 months ago

check out the pubspec. It seems web is commented out?

https://github.com/benjamindean/flutter_vibration/blob/master/vibration/pubspec.yaml

https://github.com/benjamindean/flutter_vibration/issues/103

sgehrman commented 2 months ago

I added a lame hack that seems to work

    if (!kIsWeb) {
      Vibration.hasVibrator().then(
          (value) => layerInteractionManager.deviceCanVibrate = value ?? false);
      Vibration.hasCustomVibrationsSupport().then((value) =>
          layerInteractionManager.deviceCanCustomVibrate = value ?? false);
    }
hm21 commented 2 months ago

Okay, good that you open a new issue in the vibration package because the issue is from that package and not from my package. However, I released version 4.1.1 which also doesn't check Vibration.hasVibrator() when you disable hitVibration inside the helperline configs like below.

configs: ProImageEditorConfigs(
      helperLines: const HelperLines(
        hitVibration: !kIsWeb,
      ),
)
sgehrman commented 2 months ago

ok, thanks.