YoussefKababe/pinch_zoom_image
画像のピンチズームを可能にするウィジェットで、解放時に初期サイズと位置に戻ります。
- Stars
- 51
- Forks
- 51
- 最終プッシュ(UTC)
- 2019/12/09
- プロジェクト状態
- 公開中
言語DartRubyKotlinSwiftObjective-C
使用している依存関係
依存関係一覧 1 件
- flutter
{"sdk":"flutter"}
元の README
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
README を開く / 閉じる
Pinch Zoom Image
A widget that makes picture pinch zoom, Instagram style!
Example one Example two
Installation
Add this to your pubspec.yml dependencies:
pinch_zoom_image: "^0.2.5"
How to use
Add the widget to your app like this (It automatically takes the size of the image you pass to it):
PinchZoomImage(
image: Image.network('https://i.imgur.com/tKg0XEb.jpg'),
zoomedBackgroundColor: Color.fromRGBO(240, 240, 240, 1.0),
hideStatusBarWhileZooming: true,
onZoomStart: () {
print('Zoom started');
},
onZoomEnd: () {
print('Zoom finished');
},
),
The zoomedBackgroundColor is the color that fills the image's space when the use is zooming it and moving it on the screen.
If you want images from internet to be cached for offline use or data saving, you can also use this with the cached_network_image widget:
PinchZoomImage(
image: CachedNetworkImage(
imageUrl: 'https://i.imgur.com/tKg0XEb.jpg',
),
zoomedBackgroundColor: Color.fromRGBO(240, 240, 240, 1.0),
hideStatusBarWhileZooming: true,
),
Enjoy!