pinch_zoom 0.1.0 copy "pinch_zoom: ^0.1.0" to clipboard
pinch_zoom: ^0.1.0 copied to clipboard

A widget based on Flutter's new Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pinch_zoom/pinch_zoom.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'PinchZoom demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: ExamplePage(),
    );
  }
}

class ExamplePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('PinchZoom Page'),
      ),
      body: PinchZoom(
        image: Image.network('https://placekitten.com/640/360'),
        zoomedBackgroundColor: Colors.black.withOpacity(0.5),
        resetDuration: const Duration(milliseconds: 100),
        maxScale: 2.5,
        onZoomStart: (){print('Start zooming');},
        onZoomEnd: (){print('Stop zooming');},
      ),
    );
  }
}
211
likes
130
points
9.87k
downloads

Publisher

verified publisherjelter.net

Weekly Downloads

A widget based on Flutter's new Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released.

Repository (GitHub)

Documentation

API reference

License

ISC (license)

Dependencies

flutter

More

Packages that depend on pinch_zoom