Buscar pacotes, repositórios e categorias de apps

Capa de expand_widget
Detalhes do pacotev3.1.1

expand_widget

Capacidade de expandir e retraír facilmente um conjunto de widgets ou texto

AndroidiOSWebmacOSWindowsLinux
Downloads em 30 dias
5,7 mil
Curtidas
147
Pontos Pub
150

Instalar pacote

flutter pub add expand_widget

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

O pacote expand_widget oferece uma maneira simples e intuitiva de animar a expansão e contração de widgets ou conteúdo de texto. Permite transições suaves entre estados colapsados e expandidos, ideal para criar elementos de interface interativos como acordeões ou seções collapsíveis. Projetado com facilidade de uso em mente, integra-se perfeitamente em aplicativos Flutter em múltiplas plataformas. O pacote suporta animações personalizadas, controle de duração e layouts flexíveis de conteúdo, tornando-o adequado tanto para componentes pequenos quanto para estruturas de UI complexas.

Casos de uso

  • Criando acordeões colapsáveis
  • Construindo seções interativas de Perguntas Frequentes
  • Animar a revelação de conteúdo em listas
  • Design de interfaces de cartão responsivas
  • Implementando seções dinâmicas de formulários

Principais recursos

  • Animações suaves de expansão/retração
  • Duração de animação personalizável
  • Suporte a qualquer widget como conteúdo
  • Integração fácil com layouts existentes
  • Mecanismos de gatilho flexíveis

Indicado para

  • Desenvolvedores em busca de controles simples de expansão
  • Designers de UI construindo cartões interativos
  • Aplicativos que exigem alternância de conteúdo dinâmico
  • Aplicações Flutter multiplataforma
  • Projetos com interfaces estilo acordeão

Considerações

  • Pode afetar o desempenho com árvores de widgets grandes
  • Requer manipulação cuidadosa da gestão de estado
  • O comportamento da animação depende das restrições de layout do pai
  • Não otimizado para alternâncias de frequência extremamente alta
  • Melhor usado com conteúdo leve para uma resposta ótima

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

Expand Widget

Package style: very good analysis Build Patreon License

This Dart package offers developers a streamlined library of Flutter widgets, useful for expanding widgets and text views, when users interact with them.

There are two main 'expand' widgets:

  • Expand Child: Useful to show more widgets related to the content already visible by the user.
  • Expand Text: Useful when texts can be quite big for a certain screen. It adds the ability to show the full content when the user wants to.

Features

  • The ExpandIndicatorStyle parameter allows you to select various render options, related to the expand arrow itself.

  • Hide the arrow widget when the view is being expanded, using the hideIndicatorOnExpand parameter.

  • Custimze the arrow widget itself: color, size, padding, icon...

  • You can also provide your own widget for the expand indicator, using the indicatorBuilder for both expaning widgets.

  • Use custom expanding hint strings! By default, it will use the ones provided by MaterialLocalizations.

  • Expand text view with swipe-down gestures, using the expandOnGesture, which by default is set to false.

  • You can also customize expand animation duration and curve easilly.

  • The collapsedVisibilityFactor (exclusive to the ExpandChild widget), allows the reveal of a section of the hidden content.

Example

Here is an example of a simple use of this package, featuring the ExpandChild & ExpandText widgets.

If you want to take a deeper look at the example, take a look at the example folder provided with the project.

  • ExpandChild
ExpandChild(
  child: Column(
    children: [
      OutlineButton(
        child: Text('Button1'),
        onPressed: () => print('Pressed button1'),
      ),
      OutlineButton(
        child: Text('Button2'),
        onPressed: () => print('Pressed button2'),
      ),
      OutlineButton(
        child: Text('Button3'),
        onPressed: () => print('Pressed button3'),
      ),
    ],
  ),
),
  • ExpandText
ExpandText(
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
  textAlign: TextAlign.justify,
),

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Built with

Authors

License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

Categorias

Repositório-fonte

Projetos que usam este pacote