Closed Maksim-Nikolaev closed 5 days ago
I went back on the phone and realized that dart:html has to be imported conditionally which adds code complexity and requires some decisions, so it's not good for updating example.
For my project I will use universal_html to get around possible issues
dart:html has to be imported conditionally
How about package:web
instead? Which is a replacement for dart:html
and support WASM. You will need to use conditional import to not break the compilation for non-web platforms.
My main goal was to avoid usage of external dependencies, to make the example as light-weight as possible.
I reopened the PR to show how the conditional imports would work. I checked Android & Web (Chrome) and both are building now while supporting the image pasting.
Feel free to close it if needed.
My main goal was to avoid usage of external dependencies, to make the example as light-weight as possible.
FYI: The web
package is Dart's first-party dependency. They didn't make it part of the SDK to keep it more open to contributors, and clients can use newer versions without updating their Dart SDK. The bundle size is the same.
Though I agree this is out of scope for this example, it might be a good idea to move it into an example somewhere else.
Description
Update the example main.dart to demonstrate the support of image pasting on web by using in-built dart:html
https://github.com/user-attachments/assets/acc0d8b6-755b-4697-a9d6-1bc7fe7a8098
Type of Change