FLUTTER ECOSYSTEM

YoussefKababe/pinch_zoom_image

Um widget que faz o zoom de imagem por pinça e depois retorna ao tamanho e posição inicial quando solto.

Capa do projeto pinch_zoom_image
Stars
51
Forks
51
Último push (UTC)
9 de dez. de 2019
Status do projeto
Ativo
Youssef Kababe GitHub avatar
GITHUB User

Youssef Kababe ↗

Alpcot ABEarth
LinguagensDartRubyKotlinSwiftObjective-C

Dependências usadas

Lista de dependências 1 itens
  • flutter{"sdk":"flutter"}

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher 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!