diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e803d59..c473e785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ - Deprecate the top-level `createElementTag`, `createCanvasElement`, `createIFrameElement`, and `querySelector` functions. Instead, use the standard creation and query methods on `document`. +- Deprecate the `client` extension methods on `MouseEvent` and `Touch`. + Instead, directly use the `clientX` and `clientY` properties. ## 0.4.2 diff --git a/lib/src/helpers/extensions.dart b/lib/src/helpers/extensions.dart index 01356444..7bebde91 100644 --- a/lib/src/helpers/extensions.dart +++ b/lib/src/helpers/extensions.dart @@ -74,10 +74,22 @@ extension NodeGlue on Node { } extension EventGlue on MouseEvent { + /// A [Point] representation of the [clientX] and [clientY] properties + /// of this [MouseEvent]. + /// + /// **Deprecated:** Prefer directly accessing + /// the [clientX] and [clientY] properties on [MouseEvent]. + @Deprecated('Instead directly access the clientX and clientY properties.') Point get client => Point(clientX, clientY); } extension TouchGlue on Touch { + /// A [Point] representation of the [clientX] and [clientY] properties + /// of this [Touch] event. + /// + /// **Deprecated:** Prefer directly accessing + /// the [clientX] and [clientY] properties on [Touch]. + @Deprecated('Instead directly access the clientX and clientY properties.') Point get client => Point(clientX, clientY); }