패키지, 저장소 및 앱 카테고리 검색

avatar_stack 표지
패키지 상세v3.0.0

avatar_stack

설정이 있는 고급이고 유연한 아바타 스택입니다. 작은 공간에 많은 아바타 또는 다른 위젯을 배치할 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
7.5천
좋아요
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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트