A widget that shows an image which can be scaled and dragged using gestures.

Overview

[DISCONTINUED] - 24.05.2021

While this widget was useful in the early days of Flutter, the Flutter team introduced an own way to zoom and pan, see InteractiveViewer.

scalable_image

A widget that shows an image which can be scaled and dragged using gestures. This package was designed for quadratic images. It can happen that it don't behave as you expect for non quadratic images. A workaround is to wrap this image in an AspectRatio with an aspect ratio of the target image. This has the drawback that it does not fill the whole space while zooming since it will contain the aspect ratio. Feel free to fork on github.

Getting Started

You can also try using an other ImageProvider, like NetworkImage and FileImage.

new ScalableImage(
          imageProvider: new AssetImage('assets/example.png'),
          dragSpeed: 4.0,
          maxScale: 16.0
        )

That's all you need. See below and example/ for an example.

demo!

You might also like...

Flutter app to browse Reddit with swiping gestures

Flutter app to browse Reddit with swiping gestures

Diaporama (for Reddit) A pretty simple Flutter app to browse Reddit with swiping gestures You select your content source (list of subreddits) and you

Nov 23, 2021

"Login Demo" app which shows how to use google sign in Android and iOS using Flutter.

⚠️ ARCHIVED: This repository is using Flutter 1.7 for the sample app. You can find the latest version of the similar implementation on this new repo.

Dec 2, 2022

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

Dec 14, 2021

This is a Flutter app which shows how to use the Selectable Text in your app

selectable_text A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Oct 25, 2021

This is a Flutter app which shows how to use the PageView Class in your Flutter App

page_view_class A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Oct 25, 2021

This is a Flutter app which shows how to add a Fitted Box in you App

fittedbox A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Oct 25, 2021

Flutter App Build for the machine Learning model which shows sentiments of instagram user by analysing their captions

Flutter App Build for the machine Learning model which shows sentiments of instagram user by analysing their captions

InstaKnow Front-end By @ketanchoyal Back-end By @namas191297 Front-end Application Flutter application that allows user to analyze sentiments of other

Oct 28, 2022

This is a Flutter Food Recipe App this shows food recipes of any food which you want.

food_recipe_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Oct 31, 2022
Comments
  • Incompatible with flutter v1.7.8

    Incompatible with flutter v1.7.8

    I think this package is no longer compatable with the latest stable build of flutter due to the errors below. Flutter version is Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.15 19A512f, locale en-GB)

    Compiler message:
    lib/scalable_image.dart:60:38: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
          oldImageStream?.removeListener(_updateImage);
                                         ^
    lib/scalable_image.dart:61:32: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
          _imageStream.addListener(_updateImage);
                                   ^
    lib/scalable_image.dart:74:33: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///Users/user/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
        _imageStream.removeListener(_updateImage);
    

    I have tried changing the return type of _updateImage to ImageStreamListener, but it seems this then does not expect parameters to be passed to it. Using removeListener(_updateImage as ImageStreamListener); seems to suppress errors, but the no images display.

    Unfortunately, I don't know enough about the inner workings of flutter to fix this myself, but happy to give it a go if you can point me in the right direction.

    opened by hcaz 3
Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar movies or shows, Browse all genres, video trailers, backdrops, logos, and posters.

MovieDB App Features. Dynamic Theming Search Functionality Onboarding-Screen Select favourite movie Home Screen Tranding movie Movies different catego

Ansh rathod 80 Dec 12, 2022
A flutter package which will help you to create a draggable widget that can be dragged around the screen.

A flutter package which will help you to create a draggable widget that can be dragged around the screen. Demo Features ?? Manually Control the positi

Adar 31 Aug 10, 2022
Scale the entire UI design proportionally. Button, image, font, everything is scaled automatically

Scale the entire UI design proportionally. Button, image, font, everything is scaled automatically. Before: 250x250 square is the same size across dev

Wildcard 3 Sep 25, 2022
A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents.

Sliding Sheet A widget that can be dragged and scrolled in a single gesture and snapped to a list of extents. Click here to view the full example. Ins

null 394 Mar 3, 2022
Draggable Scrollbar - A scrollbar that can be dragged for quickly navigation through a vertical list.

A scrollbar that can be dragged for quickly navigation through a vertical list. Additionaly it can show label next to scrollthumb with information about current item, for example date of picture created

Flutter Community 425 Dec 10, 2022
FLUTTER API: It's powerful navigation by gestures and taps. You can scroll from left to right or tap on the navigation icons.

scroll_navigation My other APIs Video Viewer Video Editor Helpers Features Fancy animations. Customizable colors. Works with the back button. Scrollin

Luis Felipe Murguia Ramos 14 Jun 14, 2022
Responsive Scaffold - On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item. Maintainer: @rodydavis

responsive_scaffold View the online demo here! On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item.

Flutter Community 346 Dec 2, 2022
Flutter page widget that is dismissed by swipe gestures, with Hero style animations, Inspired by Facebook and Instagram stories.

dismissible_page ?? ?? Creates page that is dismissed by swipe gestures, with Hero style animations, Inspired by FB, IG stories. Live Demo Contents Su

Tornike 76 Dec 22, 2022
Easy to use, reliable and lightweight gesture detector for Flutter apps, exposing simple API for basic gestures

Simple Gesture Detector Easy to use, reliable and lightweight gesture detector for Flutter apps. Exposes simple API to react to basic gestures. Featur

Aleksander Woźniak 26 Nov 4, 2022