カテゴリー・パッケージ・リポジトリを検索

progressive_image のカバー
パッケージ詳細v2.0.1

progressive_image

低品質の画像プレースホルダーを使用して、段階的に大きな画像を読み込むFlutterウィジェットです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1100
いいね数
390
Pub ポイント
150

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

flutter pub add progressive_image

パッケージ概要

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

ProgressiveImage は、フル解像度の画像が読み込まれる間に徐々に品質を向上させる低品質のプレースホルダーアイコンを最初に表示することで、画像の読み込みパフォーマンスを向上させるFlutterウィジェットです。このテクニックにより、認識される読み込み時間が短縮され、特に遅いネットワーク環境でのユーザー体験が向上します。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームアプリケーションに適しています。既存の画像読み込みワークフローとシームレスに統合でき、NetworkImageなどの人気のある画像プロバイダーとも良好に連携します。

用途

  • 画像が多く含まれるアプリのパフォーマンスの感覚を向上させる
  • 遅いネットワーク接続でのUXの向上
  • 高解像度の画像をスムーズなトランジションで表示する
  • ギャラリーまたはフィードに大きな画像を読み込む
  • eコマースアプリにおける画像の読み込み最適化

主な機能

  • 低品質画像プレースホルダ (LQIP) のサポート
  • スムーズなプログレッシブ画像レンダリング
  • クロスプラットフォーム互換性
  • 既存の画像ローダーとの簡単な統合
  • ネットワークおよびローカル画像ソースをサポート

適している対象

  • 高解像度画像を多数含むアプリ
  • スムーズな読み込み体験を重視するユーザーインターフェース
  • 画像の読み込み中に改善された視覚フィードバックを求める開発者
  • 複数のプラットフォームをターゲットにするプロジェクト
  • パフォーマンス重視のモバイルおよびWebアプリケーション

注意事項

  • 適切な低品質のプレースホルダ画像が必要です
  • 初期のメモリ使用量がわずかに増える可能性があります
  • 非常に小さな画像ではLQIPの利点が最小限であるため、理想的ではありません
  • 適切な画像アセット管理に依存する
  • プレビュー版と最終版の間に顕著なサイズの違いがある画像と併用するのが最適です

元の README

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

Progressive Image

A flutter widget which progressively loads large images using Low Quality Image Placeholders.

Snapshots

Features

  • Displays placeholder and thumbnail image until the target Image loads.
  • Smooth Fade-in animations for preventing immediate image popups on load.
  • Blur effect for low resolution thumbnail to prevent the pixelated view.
  • Effectively resolves thumbnail image before the target image starts to fetch for quick first impression.
  • Placeholder widgets instead of placeholder images can now be added in v2.0.0

Installing

Following steps will help you add this library as a dependency in your flutter project.

  • In the pubspec.yaml file in the root of your project
dependencies:
  progressive_image: ^2.0.0
  • Run the following command to get packages:
$ flutter packages get
  • Import the package in your project file:
import 'package:progressive_image/progressive_image.dart';

Usage

For a more detailed look at how to use this library, there is a sweet project in the example directory and various examples can be found here

A simple example usage of the ProgressiveImage widget is shown below:

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Progressive Image Example')),
        body: ProgressiveImageExample(),
      ),
    );
  }
}

class ProgressiveImageExample extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        return Container(
            child: ProgressiveImage(
                placeholder: AssetImage('assets/placeholder.jpg'),
                // size: 1.87KB
                thumbnail: NetworkImage('https://i.imgur.com/7XL923M.jpg'),
                // size: 1.29MB
                image: NetworkImage('https://i.imgur.com/xVS07vQ.jpg'),
                height: 300,
                width: 500,
            ),
        );
    }
}

カテゴリー

ソースリポジトリ

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

データはまだありません。