commit | 3e4c60ef53dbfd0ca1996aeeca18228fe4f1b114 | [log] [tgz] |
---|---|---|
author | Rutvik Tak <65209850+rutvik110@users.noreply.github.com> | Fri Aug 23 21:52:23 2024 +0530 |
committer | GitHub <noreply@github.com> | Fri Aug 23 09:22:23 2024 -0700 |
tree | b68ad28949b2231435bdc60418b2e9dbf48a02e7 | |
parent | 01e861efc5547cbc7802d3262ec1a99037d4b57a [diff] |
[feat] Adds helpers to convert js lists to a dart list (Resolves #281) (#286) * Made TouchListWrapper a generic JS list wrapper * made item method on JSObject non-nullable * docs updated * renaming js list wrapper, docs updates * updated JSImmutableListWrapper to receive both list type and list item type * change JSObject extension to an extension type of JS list, JSImmutableListWrapper updated to use new extension type * added entry for deprecated TouchListWrapper * deprecated TouchListConvert, removed newly added converters in favour of direct usage of JSImmutableListWrapper * dart formatting changes * docs updated * removed _original parameter from JSImmutableListWrapper in favour of _jsList * test added * dart formatting updates * added changelog
Lightweight browser API bindings built around JS interop.
This package exposes browser APIs. It's generated from the Web IDL definitions and uses recent Dart language features for zero-overhead bindings.
This package is intended to replace dart:html
and similar Dart SDK libraries. It will support access to browser APIs from Dart code compiled to either JavaScript or WebAssembly.
import 'package:web/web.dart'; void main() { final div = document.querySelector('div')!; div.text = 'Text set at ${DateTime.now()}'; }
package:web
is replacing dart:html
and other web libraries as Dart's long-term web interop solution. To learn how to migrate from dart:html
APIs to package:web
, see our migration guide.
The generator scripts use a number of conventions to consistently handle Web IDL definitions:
JSObject
.implements
between extension types.JSArray
and JSPromise
.String
.JSFunction
.String
instead of JSString
.JSAny?
.JSObject
.Most of the APIs in this package are generated from public assets. See tool/README.md for information on the spec and IDL versions the package was generated from, and for the process for updating the package.