flutter_photo_view 1.0.3 copy "flutter_photo_view: ^1.0.3" to clipboard
flutter_photo_view: ^1.0.3 copied to clipboard

PhotoView aims to help produce an easily usable implementation of a zooming ImageView.

example/lib/main.dart

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: 100),
              child: TextButton(
                  onPressed: () {
                    PhotoViewController.presentWithUrls(photos: [
                      'https://fastly.picsum.photos/id/1/5000/3333.jpg?hmac=Asv2DU3rA_5D1xSe22xZK47WEAN0wjWeFOhzd13ujW4',
                      'https://fastly.picsum.photos/id/0/5000/3333.jpg?hmac=_j6ghY5fCfSD6tvtcV74zXivkJSPIfR9B8w34XeQmvU',
                      'https://fastly.picsum.photos/id/4/5000/3333.jpg?hmac=ghf06FdmgiD0-G4c9DdNM8RnBIN7BO0-ZGEw47khHP4',
                    ], position: 0);
                  },
                  child: Container(
                      padding: const EdgeInsets.all(10),
                      decoration: BoxDecoration(
                          borderRadius:
                              const BorderRadius.all(Radius.circular(5)),
                          border: Border.all(
                              color: Colors.deepPurpleAccent, width: 1)),
                      child: const Text('show images with urls'))),
            ),
            const Expanded(
                child: PhotoView(
                    src:
                        'https://fastly.picsum.photos/id/4/5000/3333.jpg?hmac=ghf06FdmgiD0-G4c9DdNM8RnBIN7BO0-ZGEw47khHP4'))
          ],
        ),
      ),
    );
  }
}
5
likes
140
pub points
59%
popularity

Publisher

unverified uploader

PhotoView aims to help produce an easily usable implementation of a zooming ImageView.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_photo_view