From 3b06da99e390a9ed85bfca692c4e86d60911ad68 Mon Sep 17 00:00:00 2001 From: KennethHung Date: Thu, 9 Jan 2025 13:23:07 +0800 Subject: [PATCH] Add missing FileReader event getters (#333) --- web/CHANGELOG.md | 4 ++++ web/lib/src/helpers/events/events.dart | 12 +++++++++++- web/pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index f49316b8..62241c22 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -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 diff --git a/web/lib/src/helpers/events/events.dart b/web/lib/src/helpers/events/events.dart index 64b360fa..6a966696 100644 --- a/web/lib/src/helpers/events/events.dart +++ b/web/lib/src/helpers/events/events.dart @@ -243,9 +243,19 @@ extension EventSourceEventGetters on EventSource { Stream get onOpen => EventStreamProviders.openEvent.forTarget(this); } -extension FileReaderEventGEtters on FileReader { +extension FileReaderEventGetters on FileReader { + Stream get onAbort => + EventStreamProviders.abortEvent.forTarget(this); + Stream get onError => + EventStreamProviders.errorEvent.forTarget(this); + Stream get onLoad => + EventStreamProviders.loadEvent.forTarget(this); Stream get onLoadEnd => EventStreamProviders.loadEndEvent.forTarget(this); + Stream get onLoadStart => + EventStreamProviders.loadStartEvent.forTarget(this); + Stream get onProgress => + EventStreamProviders.progressEvent.forTarget(this); } extension AutoElementEventGetters on AudioNode { diff --git a/web/pubspec.yaml b/web/pubspec.yaml index ab951465..39a5078a 100644 --- a/web/pubspec.yaml +++ b/web/pubspec.yaml @@ -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