insta_image_viewer 1.0.4 insta_image_viewer: ^1.0.4 copied to clipboard
A simple widget for full screen with swipe to dismiss, pinch & zoom.
import 'package:flutter/material.dart';
import 'package:insta_image_viewer/insta_image_viewer.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Insta Image Viewer Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
width: 100,
height: 140,
child: InstaImageViewer(
child: Image(
image: Image.network("https://picsum.photos/id/429/1080/1920")
.image,
),
),
),
const SizedBox(height: 20),
SizedBox(
width: 100,
height: 140,
child: InstaImageViewer(
child: Image(
image:
Image.network("https://picsum.photos/id/507/1000").image,
),
),
),
],
),
),
);
}
}