flutter_zoom_box 0.1.5 copy "flutter_zoom_box: ^0.1.5" to clipboard
flutter_zoom_box: ^0.1.5 copied to clipboard

A box that makes child widgets zoomable and draggable inside container like box.

flutter_zoom_box #

A widget that makes child widget zoomable. This widget can be applicable for not only images but also any other widgets.

zoom_box_demo zoom_box2_demo

It works on Android and iOS.

How to use #

import 'package:flutter_zoom_box/zoom_box.dart';

Use widget named 'ZoomBox' and give width, height and child which you want to wrap with as parameters. These three parameters are required ones.

Scaffold(
  body: Center(
    child: ZoomBox(
    width: 250,
    height: 250,
    child: Image.network('https://picsum.photos/250?image=9'),
    ),
  )
)

Additionally, if you want to add a border in ZoomBox like gif shown, refer to the codes below.


double borderWidth = 4;
double radius = 20;

return Scaffold(
  body: Center(
    child: Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(radius + borderWidth)),
        border: Border.all(width: borderWidth)),
      child: ZoomBox(
        borderRadius: BorderRadius.all(Radius.circular(radius)),
        width: 250,
        height: 250,
        child: Image.network('https://picsum.photos/250?image=9'),
      ),
    ),
  )
);
11
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A box that makes child widgets zoomable and draggable inside container like box.

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, provider, vector_math

More

Packages that depend on flutter_zoom_box