All Projects → fireslime → Photo_view

fireslime / Photo_view

Licence: mit
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Photo view

Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (-61.87%)
Mutual labels:  images, photos, pinch-to-zoom, gallery
Rocket-Notes
The World's Fastest Note Taking App. Fast. Simple. Create a note in one tap! Create image and text notes directly from your home screen!
Stars: ✭ 20 (-98.44%)
Mutual labels:  photos, gallery, widget
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (+35.47%)
Mutual labels:  pinch-to-zoom, gallery, zoom
React Grid Gallery
Justified image gallery component for React
Stars: ✭ 571 (-55.39%)
Mutual labels:  images, photos, gallery
Zoom
Javascript library to do pinch zoom that preserves scale and rotation correctly.
Stars: ✭ 130 (-89.84%)
Mutual labels:  pinch-to-zoom, zoom, rotate
hes-gallery
Light, dependency free, responsive gallery script
Stars: ✭ 27 (-97.89%)
Mutual labels:  photos, gallery, images
Photobrowser.forms
Full screen image viewer(Xamarin.Forms) that includes "pinch to zoom" and "swipe to dismiss" gestures.
Stars: ✭ 75 (-94.14%)
Mutual labels:  images, photos, pinch-to-zoom
React Viewer
react image viewer, supports rotation, scale, zoom and so on
Stars: ✭ 502 (-60.78%)
Mutual labels:  photos, gallery
React Native Image Gallery
Pure JavaScript image gallery component for iOS and Android with high-performance and native feeling in mind
Stars: ✭ 601 (-53.05%)
Mutual labels:  images, gallery
Paparazzo
Custom iOS camera and photo picker with editing capabilities
Stars: ✭ 714 (-44.22%)
Mutual labels:  photos, gallery
React Prismazoom
A pan and zoom component for React, using CSS transformations.
Stars: ✭ 29 (-97.73%)
Mutual labels:  pinch-to-zoom, zoom
Thumbsup
Generate static HTML photo / video galleries
Stars: ✭ 493 (-61.48%)
Mutual labels:  photos, gallery
Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (-63.52%)
Mutual labels:  photos, gallery
Lychee
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
Stars: ✭ 816 (-36.25%)
Mutual labels:  photos, gallery
Photo Affix
📷 Stitch your photos together vertically or horizontally easily!
Stars: ✭ 969 (-24.3%)
Mutual labels:  images, photos
T Scroll
A modern reveal-on-scroll library with useful options and animations. (Animate Elements On Reveal)
Stars: ✭ 642 (-49.84%)
Mutual labels:  zoom, rotate
Zoomy
Zoomy is an easy to use pinch-to-zoom Android library
Stars: ✭ 842 (-34.22%)
Mutual labels:  pinch-to-zoom, zoom
Photo Blog
The Photo Blog Application based on Laravel 5 and Vue.js 2 + Prerender
Stars: ✭ 55 (-95.7%)
Mutual labels:  photos, gallery
Extended image
A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Stars: ✭ 1,021 (-20.23%)
Mutual labels:  zoom, rotate
Imageselector
图片选择器, 支持多图选择和图片预览
Stars: ✭ 62 (-95.16%)
Mutual labels:  photos, widget

Flutter Photo View

Tests status Pub Chat

A simple zoomable image/content widget for Flutter.

PhotoView enables images to become able to zoom and pan with user gestures such as pinch, rotate and drag.

It also can show any widget instead of an image, such as Container, Text or a SVG.

Even though being super simple to use, PhotoView is extremely customizable though its options and the controllers.

Installation

Add photo_view as a dependency in your pubspec.yaml file (what?).

Import Photo View:

import 'package:photo_view/photo_view.dart';

Docs & API

The API Docs some detailed information about how to use PhotoView.

If you want to see it in practice, check the example app that explores most of Photo View's use cases or download the latest version apk on the releases page

(Very) Basic usage

Given a ImageProvider imageProvider (such as AssetImage or NetworkImage):

@override
Widget build(BuildContext context) {
  return Container(
    child: PhotoView(
      imageProvider: AssetImage("assets/large-image.jpg"),
    )
  );
}

Result:

In action

Read more about the PhotoView widget here.

Gallery

To show several images and let user change between them, use PhotoViewGallery.

Read more about the gallery here.

import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
// ...


@override
Widget build(BuildContext context) {
  return Container(
    child: PhotoViewGallery.builder(
      scrollPhysics: const BouncingScrollPhysics(),
      builder: (BuildContext context, int index) {
        return PhotoViewGalleryPageOptions(
          imageProvider: AssetImage(widget.galleryItems[index].image),
          initialScale: PhotoViewComputedScale.contained * 0.8,
          heroAttributes: PhotoViewHeroAttributes(tag: galleryItems[index].id),
        );
      },
      itemCount: galleryItems.length,
      loadingBuilder: (context, event) => Center(
        child: Container(
          width: 20.0,
          height: 20.0,
          child: CircularProgressIndicator(
            value: event == null
                ? 0
                : event.cumulativeBytesLoaded / event.expectedTotalBytes,
          ),
        ),
      ),
      backgroundDecoration: widget.backgroundDecoration,
      pageController: widget.pageController,
      onPageChanged: onPageChanged,
    )
  );
}

Gallery sample in the example app:

In action

See the code here.

Usage with controllers

When you need to interact with PhotoView's internal state values, PhotoViewController and PhotoViewScaleStateController are the way to.

Controllers, when specified to PhotoView widget, enables the author(you) to listen for state updates through a Stream and change those values externally.

Read more about controllers here.

In the example app, we can see what can be achieved with controllers:

In action

More screenshots

Custom background,
small image
and custom alignment
Limited scale Hero animation
In action In action In action
Part of the screen Custom child
In action In action

Support us

You can support us by becoming a patron on Patreon, any support is much appreciated.

Patreon

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].