
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _controller; | |
Animation<Size> _myAnimation; | |
@override | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
_controller = AnimationController( | |
vsync: this, | |
duration: Duration(milliseconds: 1000), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin{ | |
//*-----defining animation and animation controller-----* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body: Center( | |
child: | |
AnimatedBuilder(animation: _myAnimation, | |
builder: (ctx, ch) => Container( | |
width: _myAnimation.value.width, | |
height: _myAnimation.value.height, | |
decoration: BoxDecoration( | |
image: new DecorationImage( | |
image: new AssetImage( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _controller; | |
Animation _myAnimation; | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
_controller = AnimationController( | |
vsync: this, | |
duration: Duration(milliseconds: 1200), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body: Center( | |
child: | |
FadeTransition( | |
opacity: _myAnimation, | |
child: Container( | |
width: 100, | |
height: 100, | |
decoration: BoxDecoration( | |
image: new DecorationImage( | |
image: new AssetImage( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _controller; | |
Animation<Offset> _myAnimation; | |
@override | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
_controller = AnimationController( | |
duration: const Duration(seconds: 2), | |
vsync: this, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body: Center( | |
child: | |
SlideTransition( | |
position: _myAnimation, | |
child: const Padding( | |
padding: EdgeInsets.all(8.0), | |
child: FlutterLogo(size: 150.0), | |
), | |
), | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AnimationController _controller; | |
Animation _myAnimation; | |
AnimationStatus _animationStatus = AnimationStatus.dismissed; | |
@override | |
void initState() { | |
super.initState(); | |
_controller = | |
AnimationController(vsync: this, duration: Duration(seconds: 1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body: Center( | |
child: Transform( | |
alignment: FractionalOffset.center, | |
transform: Matrix4.identity() | |
..setEntry(3, 2, 0.002) | |
..rotateX(pi*(_myAnimation.value)), | |
child: Container( | |
color: Colors.blueAccent, | |
width: 200, | |
height: 200, |