パッケージ、リポジトリ、アプリカテゴリを検索

overflow_view のカバー
パッケージ詳細v0.7.0

overflow_view

十分なスペースがなければ、末尾にオーバーフローインジケーターを表示する1行に子要素を表示するウィジェットです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
3万
いいね数
227
Pub ポイント
150

パッケージをインストール

flutter pub add overflow_view

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

OverflowView は、子要素を水平方向に配置し、すべての子要素を表示するのに十分なスペースがない場合にオーバーフローインジケーター(たとえば '+' やカウント)を表示する Flutter ウィジェットです。チャットインターフェースやプロフィールリストのようなコンパクトなレイアウトに最適です。このウィジェットは、自動的にオーバーフローを切り取り、視覚的なインジケーターを追加することで、小さな画面での使いやすさを向上させます。モバイル、Web、デスクトップなど、複数のプラットフォームをサポートしています。

用途

  • チャットヘッドアバター
  • ユーザー一覧プレビュー
  • コンパクトプロファイル表示
  • 応答性のあるUIコンポーネント
  • ダイナミックアバターグループ

主な機能

  • 自動オーバーフロー検出
  • カスタマイズ可能なオーバーフローインジケーター
  • スペース付きの水平レイアウト
  • クロスプラットフォーム対応
  • 柔軟な子供用サイズ

適している対象

  • 動的なアバター一覧を備えた UI
  • モバイルファーストのレスポンシブデザイン
  • チャットおよびメッセージングアプリ
  • プロフィールカードのレイアウト
  • スペース制限のあるインターフェース

注意事項

  • オーバーフローインジケーター用にカスタムスタイルが必要になる場合があります
  • 制限された垂直オーバーフロー処理
  • 大量の子要素がある場合のパフォーマンス
  • 複雑なレイアウトには適していません
  • 親コンテナの制約に依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト