Skip to content

Add missing FileReader event getters #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.0-wip
- Added missing `FileReader` event getters: `onAbort`, `onError`, `onLoad`,
`onLoadStart`, `onProgress`.

## 1.1.0

- Added `HttpStatus` class that declares http status codes. This is a copy of
Expand Down
12 changes: 11 additions & 1 deletion web/lib/src/helpers/events/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,19 @@ extension EventSourceEventGetters on EventSource {
Stream<Event> get onOpen => EventStreamProviders.openEvent.forTarget(this);
}

extension FileReaderEventGEtters on FileReader {
extension FileReaderEventGetters on FileReader {
Stream<ProgressEvent> get onAbort =>
EventStreamProviders.abortEvent.forTarget(this);
Stream<ProgressEvent> get onError =>
EventStreamProviders.errorEvent.forTarget(this);
Stream<ProgressEvent> get onLoad =>
EventStreamProviders.loadEvent.forTarget(this);
Stream<ProgressEvent> get onLoadEnd =>
EventStreamProviders.loadEndEvent.forTarget(this);
Stream<ProgressEvent> get onLoadStart =>
EventStreamProviders.loadStartEvent.forTarget(this);
Stream<ProgressEvent> get onProgress =>
EventStreamProviders.progressEvent.forTarget(this);
}

extension AutoElementEventGetters on AudioNode {
Expand Down
2 changes: 1 addition & 1 deletion web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: web
version: 1.1.0
version: 1.2.0-wip
description: Lightweight browser API bindings built around JS interop.
repository: https://github.com/dart-lang/web

Expand Down
Loading