hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
1k stars 392 forks source link

Wasm Support #490

Closed ps6067966 closed 5 months ago

ps6067966 commented 6 months ago

It will be great if this package support WASM

lukassgramm commented 6 months ago

https://github.com/hnvn/flutter_image_cropper/pull/489

OlegShNayax commented 6 months ago

Any updates?

hnvn commented 6 months ago

I will work on it when I am available, but I am not much experience in Web development, so it would take more time for me to work on it. It is much appreciated if there's any helps from community

GenildoNogueira commented 5 months ago

Hello @hnvn,

I hope you're doing well. I wanted to share an update regarding the Wasm compilation issue.

After some investigation and testing, I managed to compile it correctly for Wasm.

However, I'm facing this issue: dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3 throw_ dart-sdk/lib/_internal/js_shared/lib/rti.dart 1388:3 _failedAsCheck dart-sdk/lib/_internal/js_shared/lib/rti.dart 1366:3 _generalAsCheckImplementation packages/image_cropper_for_web/src/croppie/croppie_dart.dart 262:7 _completerForPromise packages/image_cropper_for_web/src/croppie/croppie_dart.dart 189:49 resultBlob packages/image_cropper_for_web/image_cropper_for_web.dart 146:33 doCrop dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async packages/image_cropper_for_web/image_cropper_for_web.dart 145:27 doCrop packages/image_cropper_for_web/src/cropper_dialog.dart 125:38 <fn> dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54 runBody dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5 _async packages/image_cropper_for_web/src/cropper_dialog.dart 124:22 <fn> packages/flutter/src/material/ink_well.dart 1171:21 handleTap packages/flutter/src/gestures/recognizer.dart 344:24 invokeCallback packages/flutter/src/gestures/tap.dart 652:11 handleTapUp packages/flutter/src/gestures/tap.dart 309:5 [_checkUp] packages/flutter/src/gestures/tap.dart 242:7 handlePrimaryPointer packages/flutter/src/gestures/recognizer.dart 696:9 handleEvent packages/flutter/src/gestures/pointer_router.dart 98:7 [_dispatch] packages/flutter/src/gestures/pointer_router.dart 143:9 <fn> dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:7 forEach packages/flutter/src/gestures/pointer_router.dart 141:17 [_dispatchEventToRoutes] packages/flutter/src/gestures/pointer_router.dart 127:7 route packages/flutter/src/gestures/binding.dart 495:5 handleEvent packages/flutter/src/gestures/binding.dart 475:14 dispatchEvent packages/flutter/src/rendering/binding.dart 425:11 dispatchEvent packages/flutter/src/gestures/binding.dart 420:7 [_handlePointerEventImmediately] packages/flutter/src/gestures/binding.dart 383:5 handlePointerEvent packages/flutter/src/gestures/binding.dart 330:7 [_flushPointerEventQueue] packages/flutter/src/gestures/binding.dart 299:9 [_handlePointerDataPacket] lib/_engine/engine/platform_dispatcher.dart 1419:5 invoke1 lib/_engine/engine/platform_dispatcher.dart 333:5 invokeOnPointerDataPacket lib/_engine/engine/pointer_binding.dart 398:30 [_sendToFramework] lib/_engine/engine/pointer_binding.dart 224:7 onPointerData lib/_engine/engine/pointer_binding.dart 1001:20 <fn> lib/_engine/engine/pointer_binding.dart 930:7 <fn> lib/_engine/engine/pointer_binding.dart 531:9 loggedHandler dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 426:37 _checkAndCall dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 431:39 dcall

Looking forward to your guidance on how to proceed.

hnvn commented 5 months ago

Hi everyone,

I've successfully migrated our plug-in to use the new JS library, Cropper.js, instead of Croppie. This change addresses many existing issues on the web platform, including support for WebAssembly (Wasm).

Please take some time to test the plug-in and help identify and fix any breaking features (I have not released new version yet, so please get the new codes directly from github). Your assistance is greatly appreciated.

Thank you!

GenildoNogueira commented 5 months ago

Awesome work on migrating to Cropper.js! I'm excited to test it out and see the improvements.

hnvn commented 5 months ago

Released new version v7.0.0