mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-07-03 05:45:07 +08:00
Fixes exports and adds tests
This commit is contained in:
@ -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';
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user