pub repository
mirror.p-hatan.irweb
0.4.1Lightweight browser API bindings built around JS static interop.
Readme
Dart CI pub package package publisher
Lightweight browser API bindings built around JS static interop.
What's this?
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.
Status
The APIs in this package are still fairly provisional and could change rapidly. We'll continue to use semantic versioning as we evolve the APIs.
Usage
import 'package:web/web.dart';
void main() {
final div = document.querySelector('div') as HTMLDivElement;
div.text = 'Text set at ${DateTime.now()}';
}
Web IDL version
Based on:
For instructions on re-generating the DOM bindings, see bindings_generator/README.md.
Changelog
0.4.1
- Exported the helper libraries from
web.dart. - Deprecated the
helpers.dartlibrary in favor ofweb.dart. - Updated the readme to include usage info and package status.
- Added an example.
- Added event extensions for
WebSocket - Fixes to the return types of the
append()andclone()extension methods onNode. - Deprecated
NodeGlue.appendin favor ofNode.appendChild. - Deprecated
NodeGlue.clonein favor ofNode.cloneNode. - Updated
@webref/cssto6.10.0.
0.4.0
- Remove
implements JSObjectfrom all types. This is needed to move the JS types exposed indart:js_interopto extension types. This subtyping will be added back in a future version when we move allpackage:webtypes to extension types. - Add
onMessagegetter toWindowEventGettersextension methods. helpers.dart: expose theEventStreamProvidersclass.- Add
createIFrameElementmethod tohelpers.dart. - Updated types to account for union types.
- Fixed issue where all
JSAnys were treated as nullable. - Changed
JSVoidtovoid. interface mixins are no longer emitted as interfaces. Their members are instead added to the interface that mixes them in.
0.3.0
- Updated source IDL to
v3.39.1. - Fixed a bug where
typedefs were not declared with the IDL type's nullability. - Types that were aliased to
doubleare now aliased tonum. This is to make it easier for users to pass integer values without going through a cast and to make migration fromdart:htmleasier.
0.2.2-beta
- Updates SDK version minimum to 3.2.0-194.0.dev.
- Removes
isInstanceOfDomTypeasdart:js_interopnow exposesinstanceOfString.
0.2.1-beta
helpers.dart- Expose
EventStreamProvider
- Expose
0.2.0-beta
- Added
helpers.darttop-level library. - Require Dart 3.2 pre-release.
- Update to IDL 3.38.2
0.1.4-beta
- Support
bool,int,double,Stringin APIs.
0.1.3-beta
- CSS properties can now be accessed directly.
0.1.2-beta
JSAnyas an IDL type now includesnull.
0.1.1-beta
- Objects now inherit from JSObject.
0.1.0-beta
- First release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add webpubspec.yaml
name: web
version: 0.4.1
description: Lightweight browser API bindings built around JS static interop.
repository: https://github.com/dart-lang/web
environment:
sdk: ^3.2.0
dev_dependencies:
analyzer: ^6.3.0
args: ^2.4.0
build_runner: ^2.4.0
build_web_compilers: ^4.0.7
code_builder: ^4.9.0
dart_flutter_team_lints: ^2.0.0
dart_style: ^2.2.4
io: ^1.0.4
path: ^1.8.3
test: ^1.22.2
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | 2015-07-31T00:10:03.379Z | Download | ed511c92013b89f55926e92cbf5a33e2a47e1d2226925d48d8aed78f7b8fa209 |
| 0.1.0-beta | 2023-05-02T17:10:36.390652Z | Download | 4682cbe455e394c8dcacf1c1e53917eeea446737884ce0983e738a7e2f446761 |
| 0.1.1-beta | 2023-05-15T19:38:58.731494Z | Download | ad8dae821733dd5b425cd98d707084956c9bfece337c8374e17072c6e54af5a7 |
| 0.1.2-beta | 2023-05-15T22:28:04.455621Z | Download | abf85421e1f06c6bb2fe6d81b544e0c1c86437aa4e2fab57153ff6829a8d084d |
| 0.1.3-beta | 2023-05-22T17:34:48.550847Z | Download | 47e396fadea4d65295c81f06f482c8bf6bc804f46f8caf11df160806c4a53785 |
| 0.1.4-beta | 2023-06-14T17:43:18.439747Z | Download | dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 |
| 0.2.0-beta | 2023-09-19T18:03:28.888791Z | Download | 6106a51fd43fe8f82749994ec6f4f8a18025c2bff3651170bebf1f63d420bebc |
| 0.2.1-beta | 2023-09-19T23:14:49.313295Z | Download | 14f1f70c51119012600c5f1f60ca68efda5a9b6077748163c6af2893ec5df8fc |
| 0.2.2-beta | 2023-09-27T21:13:00.893497Z | Download | ccbbfbf29732ee1b391c4c6d13e7032d851f675f47365e81904e4c6fd669c854 |
| 0.3.0 | 2023-10-11T21:50:44.833239Z | Download | afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 |
| 0.3.1-dev | 2023-11-10T23:33:09.415823Z | Download | 03ce602c4639f0b483d22fdfc2dab35d2766912fa76dc2ebe82a8e8fd952dfe0 |
| 0.4.0 | 2023-11-14T20:19:48.904397Z | Download | edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa |
| 0.4.1 | 2024-01-11T19:52:10.711418Z | Download | a4fcead029d8cbde2df1674cdc4585640a28bddd1e46878b9ceebeaf9d7a5913 |
| 0.4.2 | 2024-01-12T01:31:50.952455Z | Download | 4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05 |
| 0.5.0 | 2024-02-13T20:25:54.210715Z | Download | 1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad |
| 0.5.1 | 2024-03-05T19:22:22.757953Z | Download | 97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27 |
| 1.0.0 | 2024-07-16T01:34:24.237084Z | Download | d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 |
| 1.1.0 | 2024-09-24T22:36:58.026862Z | Download | cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb |
| 1.1.1 | 2025-02-26T21:23:27.138850Z | Download | 868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a |
| 1.1.2 | 2026-10-23T00:25:24.742112Z | Download | e119e82ac4795c7925103b7cf3768191f33941b99e7ccffbd6c645201d9f606b |
Dependencies
No direct dependencies declared.