Skip to content

Commit

Permalink
Add missing FileReader event getters (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
maple135790 authored Jan 9, 2025
1 parent af5de5e commit 3b06da9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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

0 comments on commit 3b06da9

Please sign in to comment.