My question is actually similar to a previous topic ( Link ), I tested but it doesn't work....
I want to acheive a simple screen with an infinite Horizontal Flip animation; I want, since the loading of my window, to have an image that makes an infinite horizantal roation using the folowing code:
import 'dart:math';
import 'package:flip_card/flip_card.dart';
import 'package:flutter/material.dart';
class FlipCardPage extends StatefulWidget {
@override
_FlipCardPageState createState() => _FlipCardPageState();
}
class _FlipCardPageState extends State<FlipCardPage>
with SingleTickerProviderStateMixin {
AnimationController animationController;
@override
void initState() {
super.initState();
animationController = new AnimationController(
vsync: this,
duration: new Duration(seconds: 7),
);
animationController.repeat();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: animationController,
builder: (context, child){
return Transform(
transform: Matrix4.rotationY((1 - animationController.value ) * pi / 2),
child: FlipCard(
direction: FlipDirection.HORIZONTAL, // default
front: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("pictures/css.png"),
fit: BoxFit.scaleDown,
),
shape: BoxShape.rectangle,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
back: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("pictures/css.png"),
fit: BoxFit.scaleDown,
),
shape: BoxShape.rectangle,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
),
),
);
}
);
// _controller.forward();
// _controller.reverse();
}
}
I executed the above code, but i got nothing (... just a white screen :/ )
Any suggestions to fix it? Thank you in advance