|
|
@ -9,7 +9,7 @@ import 'package:pinball/gen/assets.gen.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class BonusAnimation extends StatelessWidget {
|
|
|
|
class BonusAnimation extends StatelessWidget {
|
|
|
|
const BonusAnimation._(
|
|
|
|
const BonusAnimation._(
|
|
|
|
this.image, {
|
|
|
|
this.imagePath, {
|
|
|
|
this.onCompleted,
|
|
|
|
this.onCompleted,
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
|
}) : super(key: key);
|
|
|
|
}) : super(key: key);
|
|
|
@ -41,7 +41,7 @@ class BonusAnimation extends StatelessWidget {
|
|
|
|
key: key,
|
|
|
|
key: key,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
final String image;
|
|
|
|
final String imagePath;
|
|
|
|
|
|
|
|
|
|
|
|
final VoidCallback? onCompleted;
|
|
|
|
final VoidCallback? onCompleted;
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ class BonusAnimation extends StatelessWidget {
|
|
|
|
// TODO(arturplaczek): Load assets in parent widget, remove future builder
|
|
|
|
// TODO(arturplaczek): Load assets in parent widget, remove future builder
|
|
|
|
// and user image from cache.
|
|
|
|
// and user image from cache.
|
|
|
|
return FutureBuilder<Image>(
|
|
|
|
return FutureBuilder<Image>(
|
|
|
|
future: Flame.images.load(image),
|
|
|
|
future: Flame.images.load(imagePath),
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<Image> snapshot) {
|
|
|
|
builder: (BuildContext context, AsyncSnapshot<Image> snapshot) {
|
|
|
|
if (snapshot.hasData) {
|
|
|
|
if (snapshot.hasData) {
|
|
|
|
final spriteSheet = SpriteSheet.fromColumnsAndRows(
|
|
|
|
final spriteSheet = SpriteSheet.fromColumnsAndRows(
|
|
|
|