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

パッケージ詳細v1.0.12

universal_image

すべてのプラットフォームですべての画像形式を表示するためのFlutterパッケージ

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
9.6万
いいね数
38
Pub ポイント
160

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

flutter pub add universal_image

パッケージ概要

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

Universal Image は、Android、iOS、Web、macOS、Windows、Linux を含むすべての主要プラットフォームでさまざまな画像形式を表示するように設計されたFlutterパッケージです。一貫したAPIを提供することで、画像処理を簡素化し、プラットフォームのネイティブな画像サポートに自動的に適応します。追加の構成やプラットフォーム固有のコードなしに、一般的な画像形式を信頼性高くレンダリングします。最小限のセットアップで広範な画像互換性が必要なアプリに最適です。

用途

  • クロスプラットフォーム画像表示
  • 複数の画像形式のサポート
  • マルチプラットフォームアプリにおける統合画像処理
  • Web およびデスクトップアプリケーションにおける画像の簡易ロード
  • プラットフォーム固有の画像コードの削減
  • 既存のFlutterプロジェクトへの迅速な統合

主な機能

  • すべての標準画像形式をサポートしています
  • 自動プラットフォーム適応
  • 必要な最小構成
  • プラットフォーム間で一貫した API
  • 組み込みのフォールバックメカニズム
  • すべてのターゲットでのパフォーマンス最適化

適している対象

  • 複数のプラットフォームをターゲットにする開発者
  • さまざまな画像形式のサポートを必要とするアプリ
  • コードのシンプルさを目指すプロジェクト
  • プラットフォーム固有の画像ロジックを回避する
  • 動的な画像またはユーザーがアップロードした画像を持つアプリケーション
  • 画像が必要なデスクトップおよびウェブアプリケーション

注意事項

  • まれなまたは実験的な画像形式をサポートしない可能性があります
  • 下位プラットフォームの画像ライブラリに依存しています
  • 専門パッケージと比べてカスタマイズの選択肢が限られている
  • 組み込みコーデックによるサイズオーバーヘッドの可能性
  • リモート画像の読み込みにはインターネット接続が必要です
  • 高度な画像処理よりも一般的な用途に適している

元の README

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

universal_image

pub package

A comprehensive image package that provides a unified solution for displaying all major image formats across mobile, desktop, and web platforms in Flutter applications.
Skip the hassle of Image.network(), Image.asset(), or Image.memory() - simply pass your image source and let UniversalImage handle the rest

Key Features

  • Supports a wide range of image formats, including JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP from the built-in Image widget.
  • Seamless integration with flutter_svg for rendering SVG images.
  • Powerful caching capabilities with extended_image for optimal performance.
  • Streamlined usage with imageUri, eliminating the need to specify network, asset, or file paths separately.
  • Ability to work with Icons font and memory-based images.

Example usage:

  • Assets provider
    var image = UniversalImage(
      'assets/image.png', // path must start with 'assets'
      color: Colors.black,
      matchTextDirection: false,
      scale: 1.0,
      width: 100,
      height: 100,
      frameBuilder: null,
      errorBuilder: null,
      semanticLabel: null,
      excludeFromSemantics: false,
      colorBlendMode: BlendMode.clear,
      fit: BoxFit.cover,
      alignment: Alignment.center,
      repeat: ImageRepeat.noRepeat,
      centerSlice: Rect.fromLTWH(0, 0, 100, 100),
      gaplessPlayback: false,
      isAntiAlias: false,
      filterQuality: FilterQuality.low,
      cacheWidth: 100,
      cacheHeight: 100,
      allowDrawingOutsideViewBox: false,
      placeholder: Container(),
      svgSkiaMode: true, // using flutter_svg on web, make sure building with FLUTTER_WEB_USE_SKIA=true
    );
  • File provider:
var image = UniversalImage(
      '/com.package.app/files/image.png', // image storage file path
      color: Colors.black,
      matchTextDirection: false,
      scale: 1.0,
      width: 100,
      height: 100,
      frameBuilder: null,
      errorBuilder: null,
      semanticLabel: null,
      excludeFromSemantics: false,
      colorBlendMode: BlendMode.clear,
      fit: BoxFit.cover,
      alignment: Alignment.center,
      repeat: ImageRepeat.noRepeat,
      centerSlice: Rect.fromLTWH(0, 0, 100, 100),
      gaplessPlayback: false,
      isAntiAlias: false,
      filterQuality: FilterQuality.low,
      cacheWidth: 100,
      cacheHeight: 100,
      allowDrawingOutsideViewBox: false,
      svgSkiaMode: false,
      placeholder: Container(),
    );
  • Network provider:
var image = UniversalImage(
      'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl.jpg',
      color: Colors.black,
      matchTextDirection: false,
      scale: 1.0,
      width: 100,
      height: 100,
      frameBuilder: null,
      errorBuilder: null,
      semanticLabel: null,
      excludeFromSemantics: false,
      colorBlendMode: BlendMode.clear,
      fit: BoxFit.cover,
      alignment: Alignment.center,
      repeat: ImageRepeat.noRepeat,
      centerSlice: Rect.fromLTWH(0, 0, 100, 100),
      gaplessPlayback: false,
      isAntiAlias: false,
      filterQuality: FilterQuality.low,
      cacheWidth: 100,
      cacheHeight: 100,
      allowDrawingOutsideViewBox: false,
      svgSkiaMode: false,
      placeholder: Container(),
    );
  • Icon provider:
var image = UniversalImage(
      Icons.add,
      color: Colors.black,
      size: 30,
      textDirection: TextDirection.ltr
    );
  • Base64 provider:
Uint8List data = await loadImage();
var base64String = data.base64Image; // or replace any base64 image string 
var image = UniversalImage(
      base64String,
      color: Colors.black,
      matchTextDirection: false,
      scale: 1.0,
      width: 100,
      height: 100,
      frameBuilder: null,
      errorBuilder: null,
      semanticLabel: null,
      excludeFromSemantics: false,
      colorBlendMode: BlendMode.clear,
      fit: BoxFit.cover,
      alignment: Alignment.center,
      repeat: ImageRepeat.noRepeat,
      centerSlice: Rect.fromLTWH(0, 0, 100, 100),
      gaplessPlayback: false,
      isAntiAlias: false,
      filterQuality: FilterQuality.low,
      cacheWidth: 100,
      cacheHeight: 100,
      allowDrawingOutsideViewBox: false,
    );
  • Bytes memory provider:
Uint8List data = await loadImage();
var image = UniversalImage(
      data,
      color: Colors.black,
      matchTextDirection: false,
      scale: 1.0,
      width: 100,
      height: 100,
      frameBuilder: null,
      errorBuilder: null,
      semanticLabel: null,
      excludeFromSemantics: false,
      colorBlendMode: BlendMode.clear,
      fit: BoxFit.cover,
      alignment: Alignment.center,
      repeat: ImageRepeat.noRepeat,
      centerSlice: Rect.fromLTWH(0, 0, 100, 100),
      gaplessPlayback: false,
      isAntiAlias: false,
      filterQuality: FilterQuality.low,
      cacheWidth: 100,
      cacheHeight: 100,
      allowDrawingOutsideViewBox: false,
    );

License

License

Copyright (C) 2020 ductranit

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

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

ランキング