Orientação gerada a partir de informações públicas. Apenas para referência.
Flutter Villains é um pacote que simplifica a criação de transições de página envolventes em aplicativos Flutter com código mínimo. Inspirado no conceito de 'heróis' no Flutter, ele introduz os 'vilões' — elementos animados que se movem ou se transformam durante a navegação, adicionando efeitos visuais dinâmicos. Ele suporta todas as principais plataformas, incluindo Android, iOS, Web, macOS, Windows e Linux. Com APIs intuitivas, os desenvolvedores podem melhorar a experiência do usuário por meio de transições suaves e expressivas sem implementações complexas. Ideal para aplicativos que buscam se destacar com animações refinadas.
Casos de uso
Criando transições de página animadas
Melhorando a visualização de navegação do aplicativo
Adicionando efeitos dinâmicos aos fluxos de interface
Melhorando o engajamento do usuário com movimento
Criar aplicativos móveis e web visualmente ricos
Principais recursos
API simples para transições
Suporta múltiplas plataformas
Integração de animação suave
Código mínimo necessário
Extensível para efeitos personalizados
Indicado para
Desenvolvedores procurando efeitos de transição rápidos
Aplicativos focados no acabamento visual
Projetos Flutter orientados por design
Equipes que desejam reduzir o código repetitivo de animação
Desenvolvimento Flutter voltado para a interface
Considerações
Pode aumentar levemente o tamanho do pacote
Requer conhecimento do sistema de animação do Flutter
Melhor usado com design orientado para desempenho
Não ideal para aplicativos muito simples
Possível uso excessivo se não equilibrado com a UX
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
You keep seeing beautiful page transitions but you think to yourself those are too much work?
Fear no more, villains are here to save you!
When doing animations when a page transition occurs you'd usally define an AnimationController in the initState() and start it there. You'd also have to wrap your widgets in AnimatedWidgets to react to the AnimationController. Besides this being a lot of boilerplate code which clogs up you precious widgets, animating on exit isn't as trivial.
Using this library you just wrap your widget you'd like to be animated when a page transition occurs in a Villain and everything is handled automatically.
That's it. No TickerProviders, no AnimationControllers, no boilerplate, no worries.
Remember the StaggeredAnimation tutorial? This is using SequenceAnimation internally and there is therefore no need to specify durations as portions of a time-frame. It just works.
With this basic setup the Divider fades in and moves up when a page transition occures (don't forget the VillainTransitionObserver more on that under Code).
Flexible
The animation you'd like to use is not premade? Make it yourself with a few lines of code!
Villains entering the page are decoupled from the page transition, meaning they can be as long as they
want. On the other hand, if a villain leaves the page, the animation is driven by the page transition.
This means:
The exit animation is always as long a the exit page transition
Setting the duration doesn't change anything
Examples
Take a look at the example folder for three nice examples.
Features:
The villain framework takes care of:
managing page transition callbacks
supplying animations
providing premade common animations
In contrast to real world villains, these villains are very easy to handle.
Controller
Currenty there are no controllers implemented to play individual villains by themselves. If you'd like to have that implemented I opened an issue discussing it. Check it out!
Icon from https://icons8.com/
Getting Started
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.