Flutter Animation Tutorial - Understand the Basics & Animate with Ease

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • 📗 Learn from the written tutorial 👇👇
    resocoder.com/flutter-animati...
    👨‍💻 Do you write good code? Find out now 👇
    resocoder.com/good-code-quiz
    Apps are boring! Of course, only until you add good looking animations into them. Since Flutter renders everything to the screen itself without relying on those pesky native views, you can animate literally everything. As they say though, with great power comes great... confusion? In this tutorial, we will dispell this fog surrounding custom animations and you will finally gain clarity in this matter.
    Much of the aforementioned confusion stems from the fact that there are many ways to do the same thing. Repeatedly calling setState in a StatefulWidget? Possible. What about extending an AnimatedWidget? Oh, and what's that AnimatedBuilder all about? Let's take a look at them one by one. All of them will be demonstrated on a rotation animation.
    Go to the website for more information, code examples, and articles:
    ● resocoder.com
    Follow me on social media:
    ● / resocoder
    ● / resocoder
    ● / resocoder
    ● gab.ai/resocoder

Komentáře • 39

  • @RobertWildling
    @RobertWildling Před 5 lety +1

    Fantastic tute! Can't wait for part 2!

  • @sirloathsome
    @sirloathsome Před 4 lety +3

    Finally got my animation to work thanks to this video! YEAH!

  • @marcosrodriguez9454
    @marcosrodriguez9454 Před 5 lety +1

    Estaba esperando esto hace rato!!!!! I was waiting for This!!!!!

  • @testtask2649
    @testtask2649 Před 4 lety

    Watched many tutorials on animation ,but not understand and watched this one,and fully satisfied.Thamks man

  • @richardmiho
    @richardmiho Před 5 lety +1

    best animation introduction ever!!!

  • @timomuller4334
    @timomuller4334 Před 4 lety

    I AM TOTALLY CONFUSED. Now I start watching!

  • @0877adri
    @0877adri Před 4 lety +1

    Amazing work, even better than the official videos. Thanks a lot for your efforts, will recommend you any time :-)

  • @newtonmunene
    @newtonmunene Před 5 lety

    Can't wait for the next part

  • @rizalord
    @rizalord Před 4 lety

    Thank you sir, your tutorial is really easy to understand.

  • @FilledStacks
    @FilledStacks Před 5 lety +6

    Awesome. I like seeing the community trying to clear up the animations api. In my animation video I also show how to use reactHooks to reduce the animation code, as well as the a AnimatedWidget and the SequenceBuilder. Looking forward to part2.

    • @ResoCoder
      @ResoCoder  Před 5 lety

      Great stuff! I feel like animations are surrounded with a cloud of mystery for sure.

  • @ronaldnats5815
    @ronaldnats5815 Před rokem

    You are the best teacher for the animation process, easy to follow and can understand it simple ever day language!!!

  • @sab_tech
    @sab_tech Před 4 lety

    Simply AWESOME.... no other word but AWESOME... thanks a ton...

  • @christianseidel4111
    @christianseidel4111 Před 4 lety

    Great video. Thank you very much!!

  • @lindermannla
    @lindermannla Před 5 lety

    Thanxz by the tutorial!

  • @mightytechno
    @mightytechno Před 4 lety

    Great tutorial

  • @PranjalJoshi
    @PranjalJoshi Před 4 lety +2

    A humble request to set background of color of scaffold to black from now onwards. It's just too much bright while watching your videos during night time.
    And thanks for good tuts! :)
    - Dark theme fan!

  • @n92
    @n92 Před 4 lety

    pretty good explanation.

  • @mksoftwaresolutions9303

    Awesome.

  • @zakariachahboun
    @zakariachahboun Před 4 lety

    simple thanks

  • @maurodibert7612
    @maurodibert7612 Před 3 lety

    @Reso Coder: awesome as each piece of any tutorial from you! Is now there part 2?

  • @zohaibiftikhar2593
    @zohaibiftikhar2593 Před 4 lety

    well explained

  • @indrian16
    @indrian16 Před 5 lety

    Thanks

  • @devjai5160
    @devjai5160 Před 3 lety

    Excellent

  • @anoopts9869
    @anoopts9869 Před 4 lety

    Nice presentation....

  • @mohamedatta7866
    @mohamedatta7866 Před 5 lety +1

    great introduction waiting for second one

  • @raghav.bhardwaj
    @raghav.bhardwaj Před 4 lety

    Thank you for your video. Help me in creating Shimmer loader for my application.

  • @sb-dor
    @sb-dor Před rokem

    Good job sir! What theme are u using ?

  • @ismailkoyuncu5518
    @ismailkoyuncu5518 Před 4 lety

    Thanks for help and explation. Wich one are you uses theme ? Thanks.

  • @rich_something
    @rich_something Před 4 lety +1

    How do you increase the speed of the rotation?

  • @voicheci007
    @voicheci007 Před 5 lety

    Hi Matej! Any chance for a flutter gallery app which loads images from an API? Thanks

  • @aytunch
    @aytunch Před 5 lety +2

    This was a long time confusion among us. Thanks for clarifying. One question: Since our animation keeps going on for forever, does this mean everything under the scaffold along with the animating asset builds? If thats the case, how can we limit the rebuilding to only the animation portion of the build tree? Are the next part of the animation tutorials a way to accomplish this? Or is there a way to accomplish this with this approach? To be clear, we didn't have anything else in the scaffold except the animating child, but lets say we did:)

    • @ResoCoder
      @ResoCoder  Před 5 lety +4

      I'm glad you got it cleared up! I'm not entirely sure but on the official Flutter channel, I've heard that the widget tree is rebuilt in the most performant way possible. Since animation is really just a regular UI rebuild, Flutter will apply the same optimizations as with any other setState call.

    • @RobertWildling
      @RobertWildling Před 5 lety +2

      Would like to know that, too!

    • @ashutoshpatole9144
      @ashutoshpatole9144 Před 4 lety

      @@ResoCoder @MTECHVIRAL Hello sir, i request you to create a tutorial on setting wallpapers in flutter. I'm trying to find this from past 2 weeks but no video has perfect explanation and most of them not even works....

  • @prajwalsbelagavi6896
    @prajwalsbelagavi6896 Před 4 lety

    the AnimationController object has duration as 5 seconds and since it is made parent of CurvedAnimation object, Shouldn't the animation last only 5 seconds?

  • @emperorharsh5220
    @emperorharsh5220 Před 3 lety

    Can you say me the theme name please. I ❤️ this theme but don't know it's name😭

  • @faisalfotoh1909
    @faisalfotoh1909 Před 2 lety

    import 'package:flutter/material.dart';
    class TwoCards extends StatefulWidget {
    const TwoCards({Key? key}) : super(key: key);
    @override
    State createState() => _TwoCardsState();
    }
    class _TwoCardsState extends State
    with SingleTickerProviderStateMixin {
    late AnimationController controller;
    late Animation scaleOne;
    late Animation scaleTwo;
    late Animation leftRotation;
    late Animation rightRotation;
    @override
    void initState() {
    super.initState();
    controller = AnimationController(
    vsync: this, duration: const Duration(milliseconds: 1300));
    scaleOne = Tween(begin: 0, end: 1).animate(
    CurvedAnimation(parent: controller, curve: const Interval(0.0, 0.5)));
    leftRotation = Tween(begin: 5, end: 0).animate(
    CurvedAnimation(parent: controller, curve: const Interval(0.0, 0.5)));
    scaleTwo = Tween(begin: 0, end: 1).animate(
    CurvedAnimation(parent: controller, curve: const Interval(0.5, 1.0)));
    rightRotation = Tween(begin: 5, end: 0).animate(
    CurvedAnimation(parent: controller, curve: const Interval(0.5, 1.0)));
    controller.forward();
    controller.addListener(() {
    setState(() {});
    });
    }
    @override
    void dispose() {
    controller.dispose();
    super.dispose();
    }
    @override
    Widget build(BuildContext context) {
    return Scaffold(
    appBar: AppBar(
    backgroundColor: Colors.black,
    ),
    body: Center(
    child: Row(
    mainAxisSize: MainAxisSize.min,
    children: [
    CustomCard(
    color: Colors.black,
    rotation: leftRotation.value,
    scale: scaleOne.value),
    CustomCard(
    color: Colors.blue.withOpacity(0.5),
    rotation: rightRotation.value,
    scale: scaleTwo.value),
    ],
    ),
    ),
    );
    }
    }
    class CustomCard extends StatelessWidget {
    CustomCard(
    {Key? key,
    required this.color,
    required this.rotation,
    required this.scale})
    : super(key: key);
    double scale;
    double rotation;
    Color color;
    @override
    Widget build(BuildContext context) {
    return Expanded(
    child: Transform(
    alignment: Alignment.center,
    transform: Matrix4.identity()
    ..scale(scale)
    ..rotateZ(rotation),
    child: Container(
    margin: const EdgeInsets.all(20),
    color: color,
    width: 200,
    height: 200,
    ),
    ),
    );
    }
    }