Skip to content

Instantly share code, notes, and snippets.

View mohak1283's full-sized avatar
🎯
Focusing

Mohak Gupta mohak1283

🎯
Focusing
View GitHub Profile
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Example Animations'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
firstChild(),
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Example Animations'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
firstChild(),
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
Animation _arrowAnimation, _heartAnimation;
AnimationController _arrowAnimationController, _heartAnimationController;
Widget firstChild() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
AnimatedBuilder(
animation: _arrowAnimationController,
builder: (context, child) => Transform.rotate(
angle: _arrowAnimation.value,
child: Icon(
Icons.expand_more,
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Example Animations'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
firstChild(),
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
Animation _arrowAnimation;
AnimationController _arrowAnimationController;
AnimationController _animationController =
AnimationController(vsync: this, duration: Duration(seconds: 1));
Animation _animation = Tween(begin: 0.0, end: -0.15).animate(
CurvedAnimation(curve: Curves.ease, parent: _animationController));
Animation transformAnimation = BorderRadiusTween(
begin: BorderRadius.circular(125.0),
end: BorderRadius.circular(0.0).animate(type_of_animation);
/////////////// OR ///////////////
Animation transformAnimation = Tween<BorderRadius>(
begin: BorderRadius.circular(125.0),
end: BorderRadius.circular(0.0).animate(type_of_animation);
Animation _animation = Tween(begin: 0.0, end: 1.0).animate(type_of_animation);
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen>
with SingleTickerProviderStateMixin {
AnimationController _animationController;