I have PageView with photo, and i want open photos from my PageView to fullscreen, when i click on photo, how can i make it?
my code:
class BannerItem extends StatelessWidget {
final AppBanner appBanner;
const BannerItem({Key? key, required this.appBanner}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 14.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
image: DecorationImage(
image: NetworkImage(appBanner.url), fit: BoxFit.cover)),
);
}
}
2
Answers
You define
Inkwell
like this:and after that define another class like this:
1: Add the photo_view package, which offers zoom in/out/scaling image functionality, by running
flutter pub add photo_view
command.2: Add the below class to your app
3: Finally, wrap the
Container
in yourBannerItem
class with theInkwell
widget and set theonTap
to:…or simply update your
BannerItem
class with this updated code: