pinch_zoom 2.0.0 copy "pinch_zoom: ^2.0.0" to clipboard
pinch_zoom: ^2.0.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: Column(
        children: [
          PinchZoom(
            child: Image.network('https://placekitten.com/640/360'),
            maxScale: 2.5,
            onZoomStart: (){print('Start zooming cat');},
            onZoomEnd: (){print('Stop zooming cat');},
          ),
          PinchZoom(
            child: Image.network('https://placedog.net/640/360'),
            maxScale: 2.5,
            onZoomStart: (){print('Start zooming dog');},
            onZoomEnd: (){print('Stop zooming dog');},
          ),
        ],
      ),
    );
  }
}
191
likes
140
pub points
97%
popularity

Publisher

verified publisherjelter.net

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

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

ISC (LICENSE)

Dependencies

flutter

More

Packages that depend on pinch_zoom