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

패키지 상세v1.0.12

universal_image

모든 플랫폼에서 모든 이미지 유형을 표시하기 위한 플러터 패키지

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
9.6만
좋아요
38
Pub 점수
160

패키지 설치

flutter pub add universal_image

패키지 개요

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

유니버설 이미지(Universal Image)는 안드로이드, 아이오스, 웹, 맥OS, 윈도우, 리눅스를 포함한 모든 주요 플랫폼에서 다양한 이미지 형식을 표시하도록 설계된 플러터 패키지입니다. 일관된 API를 제공하여 플랫폼의 네이티브 이미지 지원에 자동으로 적응하는 이미지 처리를 간소화합니다. 추가 구성이나 플랫폼별 코드 없이 일반적인 이미지 유형을 신뢰할 수 있게 렌더링합니다. 최소한의 설정으로 광범위한 이미지 호환성을 필요로 하는 앱에 이상적입니다.

사용 사례

  • 크로스 플랫폼 이미지 표시
  • 여러 이미지 형식 지원
  • 다중 플랫폼 앱에서의 통합 이미지 처리
  • 웹 및 데스크톱 앱에서의 간편한 이미지 로드
  • 플랫폼별 이미지 코드 줄이기
  • 기존 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 개

소스 저장소

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

순위