Coder Social home page Coder Social logo

Comments (6)

luigi-rosso avatar luigi-rosso commented on July 21, 2024 4

Alright I put together a simple example here:
https://github.com/luigi-rosso/sequenced_loader

Controller and widget code are coupled together as it was pretty self contained, might be nice to split them up if you want to support other flare files/layouts/etc.
https://github.com/luigi-rosso/sequenced_loader/blob/master/lib/flare_progress_indicator.dart

Flare file is here:
https://www.2dimensions.com/a/castor/files/flare/sequencedloader

from flare-flutter.

asjqkkkk avatar asjqkkkk commented on July 21, 2024 3

FlareActor has a FlareCompletedCallback, But this is only valid in non-loop animations.

just like

new FlareActor(
                  "xxx.flr",
                  fit: BoxFit.scaleDown,
                  animation: animation,
                  callback: (name) {
                    if (name == "animation_one") {
                      ...
                    } else if (name == "animation_two") {
                      ...
                    } else if (name == "animation_three") {
                      ...
                    }
                  },
                )

But i don't kown how to use FlareController,I hope the official has a simpler example than bear animation

from flare-flutter.

luigi-rosso avatar luigi-rosso commented on July 21, 2024

We can definitely introduce a callback for the loop, but yes the FlareController might be a better way to go for now. There are a few examples of FlareControllers in the example folder here (the penguin uses it and so does the space_reload).

Have you tried simply swapping to your "finish animation" regardless of where the "idle" animation is? This should work as we have a 0.2 second mix value currently hardcoded into FlareActor. That means it'll smoothly interpolate the two animations.

In the meantime I'll cook up a sample controller, just need to finish a few things but I should be able to get it to you later tonight.

from flare-flutter.

asjqkkkk avatar asjqkkkk commented on July 21, 2024

Thank you very much, I really like flare ^_^

from flare-flutter.

jaumard avatar jaumard commented on July 21, 2024

Works really nicely @luigi-rosso ! Thanks a lot ! I'll integrate this into flare_spalsh_screen :) it will help me understand better FlareController as for now it's still obscur to me ^^

from flare-flutter.

jaumard avatar jaumard commented on July 21, 2024

flare_splash_screen has been updated to use this ! I also customize it a bit to be able to do intro, loop, complete animation with all animation optional to be able to mix whatever combination we need/want.

I was thinking ok it's great for a splash screen but it can be use for all sort of loading widget in fact ! So I created flare_loading https://github.com/jaumard/flare_loading that offer the same capabilities but that you can use for all kind of loading process.

Thanks a lot for the help @luigi-rosso !

from flare-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.