| commit | f6a7d3839494f2287f0f15debbfbc775530938cb | [log] [tgz] |
|---|---|---|
| author | Srujan Gaddam <58529443+srujzs@users.noreply.github.com> | Tue Jun 18 08:52:22 2024 -0700 |
| committer | GitHub <noreply@github.com> | Tue Jun 18 08:52:22 2024 -0700 |
| tree | 318d400d41d0a7c82ef6954e19fb8b6651bfe636 | |
| parent | 6d2229417d5188562468debb94804521d987fff4 [diff] |
Emit double as return value instead of num (#256) Emit double as return value instead of num Closes https://github.com/dart-lang/web/issues/57 In cases where the return type is known to be a double value, prefer double over num so users don't try and downcast the type, which won't work consistently on all compilers. In order to do this, _typeReference is amended to take an extra option 'returnType' which determines if the `_RawType` is used in a return type context.
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.