flutter_photo_view 1.0.2
flutter_photo_view: ^1.0.2 copied to clipboard
PhotoView aims to help produce an easily usable implementation of a zooming ImageView.
import 'package:flutter/material.dart';
import 'package:photo_view/flutter_photo_view.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 50),
child: TextButton(
onPressed: () {
PhotoViewController.presentWithUrls(photos: [
'https://placehold.jp/150x150.png',
'https://placehold.jp/160x160.png'
], position: 1);
},
child: const Text('show images')),
),
const Expanded(
child: PhotoView(src: 'https://placehold.jp/150x150.png'))
],
),
),
);
}
}