Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2024-01-06 19:40:44 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7e11556b4c89f6d5027015f6fb5f1d5a95d55dc9
7e11556b
1 parent
d697e2d5
add JS interop stub for the JS Map class
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
lib/src/web/javascript_map.dart
lib/src/web/javascript_map.dart
0 → 100644
View file @
7e11556
import
'dart:js_interop'
;
/// A static interop stub for the `Map` class.
///
/// This stub is here because the `js_types` from the Dart SDK do not yet provide a `Map` equivalent:
/// https://github.com/dart-lang/sdk/issues/54365
///
/// See also: https://github.com/dart-lang/sdk/issues/54365#issuecomment-1856995463
///
/// Object literals can be made using [jsify].
@JS
(
'Map'
)
@staticInterop
class
JsMap
<
K
extends
JSAny
,
V
extends
JSAny
>
implements
JSAny
{
external
factory
JsMap
();
}
extension
JsMapExtension
<
K
extends
JSAny
,
V
extends
JSAny
>
on
JsMap
<
K
,
V
>
{
external
V
?
get
(
K
key
);
external
JSVoid
set
(
K
key
,
V
?
value
);
}
...
...
Please
register
or
login
to post a comment