Files
lottie-flutter/test/frame_rate_test.dart
Xavier H 548c77dc45 Add FrameRate and improve performance (#93)
- Run the animation at the exported frame rate
- Wrap the animation in a RepaintBoundary
- Don't paint during "static" periods
2020-08-04 22:02:02 +02:00

15 lines
543 B
Dart

import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
import 'package:lottie/lottie.dart';
void main() {
test('Frame rate round', () async {
var composition = await LottieComposition.fromBytes(
File('example/assets/LottieLogo1.json').readAsBytesSync());
expect(composition.roundProgress(0, frameRate: FrameRate.composition), 0);
expect(
composition.roundProgress(0.0001, frameRate: FrameRate.composition), 0);
expect(composition.roundProgress(0.0001, frameRate: FrameRate.max), 0.0001);
});
}