From f3f483650f228d4bf47fb08f549b2071fed4a46f Mon Sep 17 00:00:00 2001 From: matt Sullivan Date: Mon, 14 Jun 2021 13:14:48 -0700 Subject: [PATCH] Fixes exports and adds tests --- lib/rive.dart | 1 - test/simple_animation_test.dart | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/rive.dart b/lib/rive.dart index 2c5ee87..b7920ce 100644 --- a/lib/rive.dart +++ b/lib/rive.dart @@ -22,4 +22,3 @@ export 'package:rive/src/rive_file.dart'; export 'package:rive/src/runtime_artboard.dart'; export 'package:rive/src/state_machine_controller.dart'; export 'package:rive/src/widgets/rive_animation.dart'; -export 'package:rive/src/widgets/rive_controller_animation.dart'; diff --git a/test/simple_animation_test.dart b/test/simple_animation_test.dart index 224789a..1031afe 100644 --- a/test/simple_animation_test.dart +++ b/test/simple_animation_test.dart @@ -33,4 +33,25 @@ void main() { expect(secondController.animationName, 'Animation 2'); expect(secondController.mix, 0.8); }); + + test('SimpleAnimation exposes autoplay', () { + final firstController = SimpleAnimation( + riveFile.mainArtboard.animations.first.name, + ); + // Autoplay defaults to true + expect(firstController.autoplay, isTrue); + // Controller should be active after being added to an artboard + riveFile.mainArtboard.addController(firstController); + expect(firstController.isActive, isTrue); + + final secondController = SimpleAnimation( + riveFile.mainArtboard.animations.first.name, + autoplay: false, + ); + // Autoplay defaults to true + expect(secondController.autoplay, isFalse); + // Controller should be inactive after being added to an artboard + riveFile.mainArtboard.addController(secondController); + expect(secondController.isActive, isFalse); + }); }