Skip to main content

Flutter Development (Day-15):


  • All source code : Click Here.
  • In this post we are going to extend our knowledge by exploring more about animations in Flutter.
  • In the last two posts we  have discussed about basic delay animations by creating a simple Login and SignUp Screens.
  • In this post we are going to talk another two types of animations PARENT,VALUE CHANGED ANIMATION.
  •  Parenting animation  -> In the below example one is the box moving along the x axis, and the same box is resizing.
  • Value Changed Animation -> IN the below example the value is changing between 10 to 1 by including some Animation.

       Demo:


      Explanation

  • Define the animations like

  •  
      void initState() {
          super.initState();
          animationController = AnimationController(
            vsync: this,
            duration: Duration(
              seconds: 4,
            ),
          );
          parentAnimation = Tween<double>(
            begin: -0.50,
            end: 0.0,
          ).animate(
            CurvedAnimation(
              curve: Curves.fastOutSlowIn,
              parent: animationController,
            ),
          );
          // Delayed animation
          childAnimation = Tween<double>(
            begin: 2.0,
            end: 100.0,
          ).animate(
            CurvedAnimation(
              parent: animationController,
              curve: Curves.fastOutSlowIn,
            ),
          );
          counterAnimation = IntTween(begin: 10, end: 0).animate(
            CurvedAnimation(
              parent: animationController,
              curve: Curves.bounceInOut,
            ),
          );
  • Add the value in a Text Widget  

    Text("${counterAnimation.value}",)


  • Transform widget must be of parentAnimation like below that it starts from the left side of the screen.


    Transform(
    transform: Matrix4.translationValues(                  
    parentAnimation.value * width,0.0,0.0,),);
  •  And the Child Animation is given to container height and width that we can resize the container size.                

    Container(
    height: childAnimation.value * 2, 
    width: childAnimation.value * 2,
    );
  • If you are following this tutorial / blog please leave your opinion 👀 / say Hii ✋/ Your e-mail in the comment section that I can improve myself and it will gives boost for me to do more tutorials.
  • If you have any doubts feel free to ask me in the comment section or email me ramubugudi4@gmail.com I can definetly give reply.

Follow me on:
 Twitter  Github   LinkedIn

Comments

  1. Thanks for the coding man! It has helped me a lot to clear all my projects.
    top flutter app development companies

    ReplyDelete
  2. Very good insightful post about Flutter development. Parkav InfoTech company is Flutter app development in tamilnadu with Our experience team develop a flutter app to fulfil customer needs, launched in both android and iPhone platform.

    ReplyDelete

Post a Comment

Popular posts from this blog

Flutter Development (Day-00): This is the First Post from this Blog.This blog will tell you about Flutter.If you don't know about it then the upcoming posts will explain you everything.This is 30 day tutorial which explains about Flutter for absolute beginners. prerequsites:  If you are enthusiastic and Curious. All source code :  Click Here . If you are following this tutorial / blog please leave your opinion 👀 / say Hii ✋/ Your e-mail in the comment section that I can improve myself and it will gives boost for me to do more tutorials. If you have any doubts feel free to ask me in the comment section or email me ramubugudi4@gmail.com I can definetly give reply. Follow me on:   Twitter   Github     LinkedIn
Flutter Development (Day-16): All source code :  Click Here . Sorry for the last two days I haven't posted anything because I am ready to leave my hometown to attend my college.Is there anyone from AndhraPradesh or Tamilnadu .If yes please provide your city name in the comment section. In this post we are going to proceed the next level of our todo app.We are going add animations to our app,Code clean Up and some UI changes. We add the animation to our FloationgActionButton.You may ask why you haven't add animations to others as well? I tried it but it is looking weird. Adding animations to  FloationgActionButton is very much similar to our previous basic animation tutorial. From the next we are going to deal with some of the important widgets which we will be using in further tutorials. If you are following this tutorial / blog please leave your opinion 👀 / say Hii ✋/ Your e-mail in the comment section that I can improve myself and it will gives boost for me t...
Flutter Development (Day-02): This is the 3rd post from this blog.Today we are going to see some of the basic widgets in flutter and how ,where to use those widgets. In Flutter everything is a widget like view in Android.Text,Padding,Margin are also widgets in Flutter. All source code :  Click Here Scaffold: Implements the basic Material Design visual layout structure. This class provides APIs for showing drawers, snack bars, and bottom sheets. Appbar: A Material Design app bar. An app bar consists of a toolbar and potentially other widgets, such as a TabBar and a FlexibleSpaceBar. Container: A convenience widget that combines common positioning of the widgets. Row: Layout a list of child widgets in the horizontal direction. Column: Layout a list of child widgets in the vertical direction. Text: A run of text with a single style. Image: A widget that displays an image. Icon: A Material Design icon. Raised...