Orientação gerada a partir de informações públicas. Apenas para referência.
Backdrop é um pacote do Flutter que implementa o componente Material Design Backdrop, permitindo transições suaves entre uma área principal de conteúdo e um painel secundário (como um drawer ou sheet). Ele suporta fundos interativos com efeitos de paralaxe e animações personalizáveis. Projetado para uso em Android, iOS, Web, macOS, Windows e Linux, ele aprimora a experiência do usuário ao fornecer navegação intuitiva e interfaces em camadas. O pacote se integra perfeitamente aos aplicativos Flutter usando padrões de widget padrão.
Casos de uso
Criando painéis laterais deslizantes
Implementando planos de fundo interativos com paralaxe
Construindo painéis de navegação responsivos
Aumentando a profundidade da interface com layouts em camadas
Design de componentes de interface com foco em dispositivos móveis
Equipes focadas em interações de usuário aprimoradas
Considerações
Requer conhecimento do sistema de animação do Flutter
Pode afetar o desempenho em dispositivos de baixa gama
Requer um design cuidadoso para evitar o acúmulo
Personalização limitada além das configurações básicas
Mais adequado para padrões de layout específicos em vez de uso geral
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
backdrop
ARCHIVE NOTE: Backdrop was based on the Material 2 Backdrop specification, which is no longer actively maintained. Material 3 does not include a Backdrop specification. As a result, this package is no longer actively developed and is limited to maintenance and critical fixes.
To use backdrop for navigation, use the provided BackdropNavigationBackLayer as backLayer.
The BackdropNavigationBackLayer contains a property items representing the list elements shown on the back layer. The front layer has to be "manually" set depending on the current index, which can be accessed with the onTap callback.
To access backdrop related functionalities, use Backdrop.of(context) to get underlying BackdropScaffoldState.
BackdropScaffoldState exposes various properties and methods like:
properties
animationController -> AnimationController
scaffoldKey -> GlobalKey<ScaffoldState>
isBackLayerConcealed -> bool
isBackLayerRevealed -> bool
methods
fling()
concealBackLayer()
revealBackLayer()
Note:Backdrop is an InheritedWidget and therefore like Scaffold.of, Theme.of and MediaQuery.of, the BuildContext context passed to Backdrop.of(context) should be of a Widget that is under the BackdropScaffold in the "widget tree". In other words, Backdrop.of called inside a widget where the BackdropScaffold is initalized will not work explicitly, since the context passed is of the widget that will build BackdropScaffold therefore above BackdropScaffold. This can be solved by either making a seperate Widget where Backdrop.of needs to be used and make it the "child" of BackdropScaffold or wrap the Backdrop.of usage around Builder widget so that the "correct" context (from Builder) is passed to Backdrop.of. This answere on SO and FWotW video on Builder gives a very good idea of how and why Builder works in later case.