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

skeleton_text のカバー
パッケージ詳細v3.0.1

skeleton_text

Flutterプロジェクトにスケルトンテキストのロードアニメーションを簡単に追加できるパッケージです。このプロジェクトは101Loopコミュニティの一員です。

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

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

flutter pub add skeleton_text

パッケージ概要

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

データ読み込み中のユーザー体験を向上させるために、スケルトンテキストのローディングアニメーションを簡単に追加できるFlutterパッケージです。リアルなテキストレイアウトを模倣する、アニメーションされたシャイマー効果付きのプレースホルダーコンテンツをクリーンでカスタマイズ可能な方法で表示します。101Loopコミュニティの一員であり、Android、iOS、Web、macOS、Windows、Linuxなどすべての主要プラットフォームをサポートしています。UIの応答性を高めるための軽量なソリューションを探している開発者に最適です。

用途

  • ロード画面のプレースホルダー
  • プロダクトカードのプレースホルダー
  • リスト項目のスケルトン
  • プロフィールページの読み込み状態
  • 動的コンテンツプレビュー

主な機能

  • アニメーションされたシャイマー効果
  • カスタマイズ可能な幅と高さ
  • 複数行をサポート
  • 既存のウィジェットとの簡単な統合
  • 軽量でパフォーマンスに優れる

適している対象

  • UI/UXデザイナー
  • Flutter ビギナー
  • 読み込み状態が必要なアプリ開発者
  • 動的なコンテンツを備えたプロジェクト
  • パフォーマンスに配慮したアプリ

注意事項

  • テキストのみのプレースホルダに制限
  • 画像の組み込みサポートなし
  • 複雑なレイアウトには手動スタイル設定が必要です
  • テキスト以外の読み込みシナリオには適していません
  • プラットフォーム固有のレンダリングに依存します

元の README

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

skeleton_text

A package provides an easy way to add skeleton text loading animation in Flutter project

Dependency

dependencies:
  skeleton_text: 

How To Use

import 'package:skeleton_text/skeleton_text.dart';

To achieve the above example animation use the following code :

 ListView.builder(
   scrollDirection: Axis.vertical,
   physics: BouncingScrollPhysics(),
   itemCount: 5,
   itemBuilder: (BuildContext context, int index) {
     return Container(
       height: 240,
       margin: EdgeInsets.symmetric(horizontal: 20),
       child: Row(
         children: [
           Expanded(
             child: SkeletonAnimation(
               shimmerColor: Colors.grey,
               borderRadius: BorderRadius.circular(20),
               shimmerDuration: 1000,
               child: Container(
                 decoration: BoxDecoration(
                   color: Colors.grey[300],
                   borderRadius: BorderRadius.circular(20),
                   boxShadow: shadowList,
                 ),
                 margin: EdgeInsets.only(top: 40),
               ),
             ),
           ),
           Expanded(
             child: Container(
               margin: EdgeInsets.only(top: 60, bottom: 20),
               decoration: BoxDecoration(
                 color: Colors.grey,
                 boxShadow: shadowList,
                 borderRadius: BorderRadius.only(
                   topRight: Radius.circular(20),
                   bottomRight: Radius.circular(20),
                 ),
               ),
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                 crossAxisAlignment: CrossAxisAlignment.start,
                 mainAxisSize: MainAxisSize.max,
                 children: <Widget>[
                   Padding(
                     padding: const EdgeInsets.only(left: 15.0, bottom: 5.0),
                     child: SkeletonAnimation(
                       borderRadius: BorderRadius.circular(10.0),
                       shimmerColor: index % 2 != 0 ? Colors.grey : Colors.white54,
                       child: Container(
                         height: 30,
                         width: MediaQuery.of(context).size.width * 0.35,
                         decoration: BoxDecoration(
                             borderRadius: BorderRadius.circular(10.0),
                             color: Colors.grey[300]),
                       ),
                     ),
                   ),
                   Padding(
                     padding: const EdgeInsets.only(left: 15.0),
                     child: Padding(
                       padding: const EdgeInsets.only(right: 5.0),
                       child: SkeletonAnimation(
                         borderRadius: BorderRadius.circular(10.0),
                         shimmerColor: index % 2 != 0 ? Colors.grey : Colors.white54,
                         child: Container(
                           width: 60,
                           height: 30,
                           decoration: BoxDecoration(
                               borderRadius: BorderRadius.circular(10.0),
                               color: Colors.grey[300]),
                         ),
                       ),
                     ),
                   ),
                 ],
               ),
             ),
           ),
         ],
       ),
     );
   },
 )

Explanation

I have created a List builder of 5 Containers. Wrapping any widget by SkeletonAnimation would give a beautiful loading animation.

SkeletonAnimation Constructor :

  SkeletonAnimation({
      @required this.child,
      this.shimmerColor = Colors.white54,
      this.gradientColor = const Color.fromARGB(0, 244, 244, 244),
      this.curve = Curves.fastOutSlowIn,
      this.borderRadius = const BorderRadius.all(Radius.circular(0)),
      this.shimmerDuration = 1000,
      Key key,
    })

カテゴリー

ソースリポジトリ

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