mirror of
https://github.com/xvrh/lottie-flutter.git
synced 2025-08-06 16:39:36 +08:00

- Run the animation at the exported frame rate - Wrap the animation in a RepaintBoundary - Don't paint during "static" periods
15 lines
543 B
Dart
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);
|
|
});
|
|
}
|