v1.0.12
universal_image
모든 플랫폼에서 모든 이미지 유형을 표시하기 위한 플러터 패키지
36좋아요 4.4만30일 다운로드160Pub 점수
AndroidiOSWebmacOSWindowsLinux
모든 플랫폼(모바일, 데스크톱 및 웹)에서 모든 이미지 형식을 표시하기 위한 플러터 유니버설 이미지 패키지
{"sdk":"flutter"}^2.2.4^10.0.1{"sdk":"flutter"}^2.1.1아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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
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
);
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(),
);
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(),
);
var image = UniversalImage(
Icons.add,
color: Colors.black,
size: 30,
textDirection: TextDirection.ltr
);
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,
);
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,
);
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.