Skip to content

Commit

Permalink
feat(storage, web): migrate web to js_interop to be compatible with W…
Browse files Browse the repository at this point in the history
…ASM (#12202)

* feat(storage, web): migrate web to js_interop to be compatible with WASM

* mapping

* interop

* more

* tests

* add typing

* fix interop
  • Loading branch information
Lyokone committed Feb 8, 2024
1 parent aac0e48 commit 7cae803
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import 'package:firebase_storage_platform_interface/firebase_storage_platform_in
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:meta/meta.dart';

import 'flutter.dart';
import 'interop/storage.dart' as storage_interop;
import 'reference_web.dart';
import 'utils/errors.dart';

/// The type for functions that implement the `ref` method of the [FirebaseStorageWeb] class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:convert';
import 'dart:html' as html;
import 'dart:typed_data';

import 'package:firebase_storage_platform_interface/firebase_storage_platform_interface.dart';
import 'package:http/http.dart' as http;
import 'package:meta/meta.dart';
import 'package:web/web.dart' as web;

import './firebase_storage_web.dart';
import './utils/errors.dart';
Expand Down Expand Up @@ -156,7 +156,7 @@ class ReferenceWeb extends ReferencePlatform {
/// Optionally, you can also set metadata onto the uploaded object.
@override
TaskPlatform putBlob(dynamic data, [SettableMetadata? metadata]) {
assert(data is html.Blob, 'data must be a dart:html Blob object.');
assert(data is web.Blob, 'data must be a package:web Blob object.');

return TaskWeb(
this,
Expand Down
Loading

0 comments on commit 7cae803

Please sign in to comment.