Buscar pacotes, repositórios e categorias de apps

Capa de overflow_view
Detalhes do pacotev0.7.0

overflow_view

Um widget que exibe filhos em uma linha com um indicador de excesso no final se não houver espaço suficiente.

AndroidiOSWebmacOSWindowsLinux
Downloads em 30 dias
30,3 mil
Curtidas
227
Pontos Pub
150

Instalar pacote

flutter pub add overflow_view

Visão geral do pacote

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

OverflowView é um widget Flutter que organiza seus filhos em uma linha horizontal e exibe um indicador de sobrecarga (como um '+' ou contagem) quando não há espaço suficiente para mostrar todos os filhos. É ideal para layouts compactos, como avatares de usuários em interfaces de chat ou listas de perfis. O widget gerencia automaticamente o excesso de conteúdo cortando-o e adicionando um indicador visual, melhorando a usabilidade em telas pequenas. Ele suporta múltiplas plataformas, incluindo dispositivos móveis, web e desktop.

Casos de uso

  • avatares de cabeçalho de bate-papo
  • Visualizações da lista de usuários
  • Exibição de perfil compacto
  • Componentes de interface responsiva
  • Grupos de avatares dinâmicos

Principais recursos

  • Detecção automática de overflow
  • indicador de overflow personalizável
  • Layout horizontal com espaçamento
  • Suporte multiplataforma
  • Tamanho infantil flexível

Indicado para

  • UIs com listas dinâmicas de avatares
  • Designs responsivos com foco em dispositivos móveis
  • Aplicativos de bate-papo e mensagens
  • Layouts de cartões de perfil
  • Interfaces com restrição de espaço

Considerações

  • Pode exigir estilização personalizada para o indicador de overflow
  • Tratamento de excesso vertical limitado
  • Desempenho com grandes quantidades de filhos
  • Não adequado para layouts complexos
  • Depende das restrições do contêiner pai

README original

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

overflow_view

A widget displaying children in a line with an overflow indicator at the end if there is not enough space.

Pub

Features

  • Renders children horizontally or vertically.
  • Has an overflow indicator builder so that you can display a widget showing the number of elements not rendered.
  • Can either constrain the children to the size of the first child or let them have the size they want.
  • Children can overlap each other by setting a negative spacing.

Overview

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  overflow_view:

In your library add the following import:

import 'package:overflow_view/overflow_view.dart';

Usage

OverflowView(
  // Either layout the children horizontally (the default)
  // or vertically.
  direction: Axis.horizontal,
  // The amount of space between children.
  spacing: 4,
  // The widgets to display until there is not enough space.
  children: <Widget>[
    for (int i = 0; i < _counter; i++)
      AvatarWidget(
        text: avatars[i].initials,
        color: avatars[i].color,
      )
  ],
  // The overview indicator showed if there is not enough space for
  // all chidren.
  builder: (context, remaining) {
    // You can return any widget here.
    // You can either show a +n widget or a more complex widget
    // which can show a thumbnail of not rendered widgets.
    return AvatarWidget(
      text: '+$remaining',
      color: Colors.red,
    );
  },
)
Constructors

There are two constuctors depending on what you want to do.

The OverflowView constructor will constrain all children to have the same size as the first one. This can be used for an avatar list for example.

The OverflowView.flexible constructor will let all children to determine their own size. This is less performant than the default one, but it's more flexible. This can be used for a menu bar for example.

Sponsoring

I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me. By doing so, I will prioritize your issues or your pull-requests before the others.

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

Categorias

Dependências

Lista de dependências 1 itens

Repositório-fonte

Projetos que usam este pacote