flame_lottie 0.2.1+1 flame_lottie: ^0.2.1+1 copied to clipboard
Flame wrapper for Lottie by AirBnB. This package implements a bridge between Lottie and Flame, allowing to load and display Lottie animations.
import 'package:flame/game.dart';
import 'package:flame_lottie/flame_lottie.dart';
import 'package:flutter/material.dart';
void main() async {
runApp(GameWidget(game: LottieExampleGame()));
}
class LottieExampleGame extends FlameGame {
@override
Future<void> onLoad() async {
final asset = await loadLottie(Lottie.asset('assets/LottieLogo1.json'));
add(
LottieComponent(
asset,
size: Vector2.all(400),
repeating: true,
),
);
}
}