Skip to content

DaeHyeonNam/flutter_zoom_box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'),
      ),
    ),
  )
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published