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

flutter_skeleton_ui 표지
패키지 상세v0.0.6

flutter_skeleton_ui

로딩 중에 페이지 레이아웃을 모방하는 사용자 정의 스켈레톤 위젯을 만들기 위한 플러터 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.2만
좋아요
43
Pub 점수
150

패키지 설치

flutter pub add flutter_skeleton_ui

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_skeleton_ui는 로딩 상태 중에 UI 요소용 사용자 정의 가능한 스켈레톤 플레이스홀더를 생성할 수 있는 Flutter 패키지입니다. 실제 콘텐츠의 레이아웃을 모방하여 데이터가 완전히 로드되기 전에 페이지 구조를 표시함으로써 부드러운 사용자 경험을 제공합니다. 카드, 목록, 텍스트 플레이스홀더 등 다양한 위젯을 지원하며, 애니메이션 및 스타일링 옵션이 있습니다. 앱의 인식된 성능 향상과 시각적 지연 감소에 이상적입니다.

사용 사례

  • 로딩 화면 자리표시자
  • 데이터 가져오기 중 레이아웃 이동 방지
  • 네트워크 지연 중 사용자 경험 향상
  • 프로토타입에서 콘텐츠 구조 시뮬레이션
  • 인식된 앱 반응성 향상
  • 화면 간에 일관된 로딩 상태 만들기

주요 기능

  • 사용자 정의 가능한 스켈레톤 형태
  • 내장된 애니메이션 반짝임 효과
  • 목록 및 그리드 레이아웃 지원
  • 기존 위젯과의 간편한 통합
  • 사용자 지정 가능한 색상 및 크기
  • 반응형 디자인 호환성

적합한 대상

  • 더 나은 로딩 UX를 찾는 개발자
  • 자주 데이터를 가져오는 앱
  • 인터랙티브 UI 프로토타이핑
  • 시각적 완성도를 우선시하는 팀
  • 프론트엔드 중심의 플러터 프로젝트
  • 일관된 플레이스홀더 디자인을 필요로 하는 프로젝트

고려 사항

  • 초기 번들 크기를 약간 증가시킬 수 있습니다
  • 복잡한 레이아웃을 위해 수동 설정이 필요합니다
  • 애니메이션 성능은 장치에 따라 달라집니다
  • 정적 콘텐츠에 적합하지 않습니다
  • 기본 스타일링을 넘어서는 사용자 정의가 제한적
  • 적절한 로딩 상태 관리와 함께 사용하는 것이 가장 좋습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter Skeletons

Clone of skeletons

A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

Installation

flutter pub add flutter_skeleton_ui

Examples

Items ListView (Default)
items paragraphs listview_default
ListView (Custom) ListView (Complex Cards) SkeletonTheme
listview_custom listview_cards skeleton_theme
Light/Dark modes Right-To-Left Custom Shimmer
light_dark_modes rtl custom_shimmer

All examples can be found here examples.

How To Use

Can be used by encapsulating the child widget in a Skeleton widget:

import 'package:flutter_skeleton_ui/flutter_skeleton_ui.dart';

Skeleton(
        isLoading: _isLoading,
        skeleton: SkeletonListView(),
        child: Container(child: Center(child: Text("Content"))),
      )

or directly:

Container(
    child: _isLoading
    ? SkeletonListView()
    : Container(child: Center(
                       child: Text("Content"))),
)

a SkeletonTheme can be used to set the default configs for all skeleton descendants in the tree.

SkeletonTheme(
    // themeMode: ThemeMode.light,
    shimmerGradient: LinearGradient(
        colors: [
          Color(0xFFD8E3E7),
          Color(0xFFC8D5DA),
          Color(0xFFD8E3E7),
        ],
        stops: [
          0.1,
          0.5,
          0.9,
        ],
      ),
      darkShimmerGradient: LinearGradient(
        colors: [
          Color(0xFF222222),
          Color(0xFF242424),
          Color(0xFF2B2B2B),
          Color(0xFF242424),
          Color(0xFF222222),
        ],
        stops: [
          0.0,
          0.2,
          0.5,
          0.8,
          1,
        ],
        begin: Alignment(-2.4, -0.2),
        end: Alignment(2.4, 0.2),
        tileMode: TileMode.clamp,
      ),
        child: MateriaApp(
            ...
        ),
      ),

More Customization:

ListView (Complex Cards)
listview_cards

for more complex shapes you can build your skeleton inside a SkeletonItem widget:

ListView.builder(
  physics: NeverScrollableScrollPhysics(),
  itemCount: 5,
  itemBuilder: (context, index) => Padding(
    padding: const EdgeInsets.all(8.0),
    child: Container(
      padding: const EdgeInsets.all(8.0),
      decoration: BoxDecoration(color: Colors.white),
      child: SkeletonItem(
          child: Column(
        children: [
          Row(
            children: [
              SkeletonAvatar(
                style: SkeletonAvatarStyle(
                    shape: BoxShape.circle, width: 50, height: 50),
              ),
              SizedBox(width: 8),
              Expanded(
                child: SkeletonParagraph(
                  style: SkeletonParagraphStyle(
                      lines: 3,
                      spacing: 6,
                      lineStyle: SkeletonLineStyle(
                        randomLength: true,
                        height: 10,
                        borderRadius: BorderRadius.circular(8),
                        minLength: MediaQuery.of(context).size.width / 6,
                        maxLength: MediaQuery.of(context).size.width / 3,
                      )),
                ),
              )
            ],
          ),
          SizedBox(height: 12),
          SkeletonParagraph(
            style: SkeletonParagraphStyle(
                lines: 3,
                spacing: 6,
                lineStyle: SkeletonLineStyle(
                  randomLength: true,
                  height: 10,
                  borderRadius: BorderRadius.circular(8),
                  minLength: MediaQuery.of(context).size.width / 2,
                )),
          ),
          SizedBox(height: 12),
          SkeletonAvatar(
            style: SkeletonAvatarStyle(
              width: double.infinity,
              minHeight: MediaQuery.of(context).size.height / 8,
              maxHeight: MediaQuery.of(context).size.height / 3,
            ),
          ),
          SizedBox(height: 8),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  SkeletonAvatar(
                      style: SkeletonAvatarStyle(width: 20, height: 20)),
                  SizedBox(width: 8),
                  SkeletonAvatar(
                      style: SkeletonAvatarStyle(width: 20, height: 20)),
                  SizedBox(width: 8),
                  SkeletonAvatar(
                      style: SkeletonAvatarStyle(width: 20, height: 20)),
                ],
              ),
              SkeletonLine(
                style: SkeletonLineStyle(
                    height: 16,
                    width: 64,
                    borderRadius: BorderRadius.circular(8)),
              )
            ],
          )
        ],
      )),
    ),
  ),
);

Issues and feedback

For issues, please report here. Contributions are welcome.

카테고리

소스 저장소

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

아직 데이터가 없습니다.