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

avatar_stack のカバー
パッケージ詳細v3.0.0

avatar_stack

設定付きの高度で柔軟なアバタースタック。小さなスペースに多数のアバターまたは他のウィジェットを配置できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
7490
いいね数
200
Pub ポイント
155

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

flutter pub add avatar_stack

パッケージ概要

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

AvatarStack は、コンパクトで視覚的に魅力的なスタックとして複数のアバターまたはウィジェットを効率的に表示できる Flutter パッケージです。チャットインターフェース、グループプロフィール、共同作業アプリ向けに設計されており、カスタマイズ可能な間隔、オーバーフロー処理、レイヤードレンダリングをサポートしています。軽量で非常に柔軟なため、開発者は最小限のコードで動的なアバター群を簡単に統合できます。Android、iOS、Web、macOS、Windows、Linux を含むすべての主要プラットフォームで動作します。

用途

  • グループチャットインジケーター
  • チームメンバーが表示
  • 共同プロジェクトアバター
  • ソーシャルメディアユーザークラスター
  • プロファイルグループのプレビュー

主な機能

  • カスタマイズ可能なアバターのスタック
  • カウントバッジ付きのオーバーフロー処理
  • アバターだけでなく、任意のウィジェットをサポート
  • デバイス間での応答性のあるレイアウト
  • スムーズなレイヤリングと z-index 制御
  • クロスプラットフォーム互換性

適している対象

  • チャットアプリケーション
  • チームコラボレーションツール
  • ソーシャルネットワーキング機能
  • ダッシュボードユーザー指標
  • 濃密なユーザー情報を持つUI

注意事項

  • アバターの数が非常に多いとパフォーマンスが低下する可能性があります
  • 基本構成以外の組み込みスタイルオプションは限定的
  • スタックされたアイテム上のタップ操作を手動で処理する必要があります
  • 非常に高い頻度の更新には最適化されていません

元の README

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

Avatar stack with animation

Build Status Coverage Status Pub

Avatar stack is used to visually represent users, places, and things in a limited space.

Example

Try Live Demo :-)

Example

import 'package:avatar_stack/animated_avatar_stack.dart';
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
  home: Scaffold(
    body: Center(
      child: AnimatedAvatarStack(
        height: 50,
        avatars: [
          for (var n = 0; n < 15; n++) NetworkImage('https://i.pravatar.cc/150?img=$n'),
        ],
      ),
    ),
  ),
));

Features

Example

Restrict amount of items

Usually the stack avatar shows all items as possible but you can restrict it by, say, five items. Restrict amount of items

Alignment

By default the stack avatar has left alignment one can change it.

center alignment

center alignment

right alignment

right alignment

Coverage

You can set how avatars will coverage each others.

max coverage is set to 70%

max coverage is set to 70%

min coverage is set to minus 50%

The negative coverage will set space between items. min coverage is set to minus 50%

Any widget for stack

You can use any widget to stack not only avatars Any widget for stack

Indent of an info item

The additional space between an info item (if exists) and other items. Indent of an info item

Stack laying

The way to tile items.

the first item is at the top

Indent of an info item

the fifth item is at the top

Indent of an info item

One can use any widget for stacking. Apply WidgetStack widget for that. For example:

import 'package:avatar_stack/avatar_stack.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(home: Example7WidgetStack()));
}

class Example7WidgetStack extends StatelessWidget {
  const Example7WidgetStack({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final settings = RestrictedPositions(
      maxCoverage: -0.1,
      minCoverage: -0.5,
      align: StackAlign.right,
    );
    return Column(
      children: [
        const Text(
          'Any widgets for stack:',
        ),
        const SizedBox(height: 10),
        SizedBox(
          height: 50,
          child: WidgetStack(
            positions: settings,
            stackedWidgets: [
              for (var n = 0; n < 12; n++)
                FlutterLogo(
                  style: FlutterLogoStyle.stacked,
                  textColor: Color(0xFF * 0x1000000 +
                      n * 10 * 0x10000 +
                      (0xFF - n * 10) * 0x100),
                ),
              const FittedBox(
                  fit: BoxFit.fitHeight,
                  child: Text('A',
                      style: TextStyle(height: 0.9, color: Colors.orange))),
              const FittedBox(
                  fit: BoxFit.fitHeight,
                  child: Text('B', style: TextStyle(height: 0.9))),
              const FittedBox(
                  fit: BoxFit.fitHeight,
                  child: Text('C',
                      style: TextStyle(height: 0.9, color: Colors.green))),
            ],
            buildInfoWidget: (surplus) {
              return Center(
                  child: Text(
                '+$surplus',
                style: Theme.of(context).textTheme.headline5,
              ));
            },
          ),
        ),
      ],
    );
  }
}

You can also use the example from github https://github.com/cyrax111/avatar_stack/tree/master/example

Ideas

If you have any ideas on how to enhance this package or have any concern, feel free to make an issue.

カテゴリー

ソースリポジトリ

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