Fixes exports and adds tests

This commit is contained in:
matt Sullivan
2021-06-14 13:14:48 -07:00
parent 93557a8557
commit f3f483650f
2 changed files with 21 additions and 1 deletions

View File

@ -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';

View File

@ -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);
});
}