Skip to content

Commit

Permalink
Add Wasm support (#2103)
Browse files Browse the repository at this point in the history
Since dart:html is not supported when compiling to Wasm, the correct alternative now is to use dart.library.js_interop to differentiate between native and web

Source:
https://dart.dev/interop/js-interop/package-web
  • Loading branch information
h1376h authored Aug 12, 2024
1 parent ac573df commit 9c79db8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:universal_html/html.dart' as html;

import '../../../models/config/image/editor/image_web_configurations.dart';
import '../../../utils/dart_ui/dart_ui_fake.dart'
if (dart.library.html) '../../../utils/dart_ui/dart_ui_real.dart' as ui;
if (dart.library.js_interop) '../../../utils/dart_ui/dart_ui_real.dart'
as ui;
import '../../../utils/element_utils/element_web_utils.dart';
import '../../../utils/utils.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:youtube_player_flutter/youtube_player_flutter.dart'

import '../../../models/config/video/editor/video_web_configurations.dart';
import '../../../utils/dart_ui/dart_ui_fake.dart'
if (dart.library.html) '../../../utils/dart_ui/dart_ui_real.dart' as ui;
if (dart.library.js_interop) '../../../utils/dart_ui/dart_ui_real.dart'
as ui;
import '../../../utils/element_utils/element_web_utils.dart';
import '../../../utils/utils.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export 'dart:ui' if (dart.library.html) 'dart:ui_web';
export 'dart:ui' if (dart.library.js_interop) 'dart:ui_web';

0 comments on commit 9c79db8

Please sign in to comment.