From beb9b661d3c1213d2e2147d733a91df4a99863ac Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot Date: Fri, 6 Nov 2020 13:59:51 +0000 Subject: [PATCH] Add default noop implementations --- CHANGELOG.md | 6 ++++++ lib/src/controllers/simple_controller.dart | 9 --------- lib/src/rive_core/rive_animation_controller.dart | 6 +++--- pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc16998..2cff503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.6.2+1] - 2020-11-?? ??:??:?? + +- Added default noop implementation to `onActivate`, `onDeactivate`, and `dispose` + in `RiveAnimationController`, which removes the need for noop overrides in subclasses + like `SimpleAnimation`. + ## [0.6.2] - 2020-10-02 15:45:10 - Exposed major and minor runtime version (issue #15) via riveVersion. diff --git a/lib/src/controllers/simple_controller.dart b/lib/src/controllers/simple_controller.dart index ebac99d..873046c 100644 --- a/lib/src/controllers/simple_controller.dart +++ b/lib/src/controllers/simple_controller.dart @@ -34,13 +34,4 @@ class SimpleAnimation extends RiveAnimationController { isActive = false; } } - - @override - void dispose() {} - - @override - void onActivate() {} - - @override - void onDeactivate() {} } diff --git a/lib/src/rive_core/rive_animation_controller.dart b/lib/src/rive_core/rive_animation_controller.dart index 991a8fc..e64948e 100644 --- a/lib/src/rive_core/rive_animation_controller.dart +++ b/lib/src/rive_core/rive_animation_controller.dart @@ -17,10 +17,10 @@ abstract class RiveAnimationController { } @protected - void onActivate(); + void onActivate() {} @protected - void onDeactivate(); + void onDeactivate() {} void apply(T core, double elapsedSeconds); bool init(T core) => true; - void dispose(); + void dispose() {} } diff --git a/pubspec.yaml b/pubspec.yaml index 19cedc6..976b311 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: rive description: Rive 2 Flutter Runtime. This package provides runtime functionality for playing back and interacting with animations built with the Rive editor available at https://rive.app. -version: 0.6.2 +version: 0.6.2+1 repository: https://github.com/rive-app/rive-flutter homepage: https://rive.app