Flutter Image Carousel单击和缩放

yvgpqqbh  于 2023-05-23  发布在  Flutter
关注(0)|答案(1)|浏览(141)

我是新的Flutter,我坚持做图像旋转木马,需要能够缩放。因为我的照片是海报。

monwx1rj

monwx1rj1#

现在,在Flutter,我发现的方式,使图像旋转木马,可以放大到高度时,点击。还有另一个困难,在图像缩放和后退按钮被点击后,应用程序被关闭。我如何管理应用程序-->图像缩放->返回按钮点击->再次显示原始图像旋转木马而不关闭应用程序?

import 'package:flutter/material.dart';
    import './app_bar.dart';
    import 'package:photo_view/photo_view.dart';
    import 'package:photo_view/photo_view_gallery.dart';
    void main() => runApp(MyApp());
    class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
    return MaterialApp(
        home: GalleryExample(),
    );}}
    class Galleryimage extends StatelessWidget{
      @override
       Widget build(BuildContext context) {
        return Container(
            child: PhotoViewGallery(
              pageOptions: <PhotoViewGalleryPageOptions>[
                PhotoViewGalleryPageOptions(
              imageProvider: AssetImage("images/onegap.png"),
              heroTag: "tag1",
            ),
            PhotoViewGalleryPageOptions(
                imageProvider: AssetImage("images/onehnan.png"),
                heroTag: "tag2",
                ),
            PhotoViewGalleryPageOptions(
              imageProvider: AssetImage("images/onesite.png"),
              heroTag: "tag3",
            ),
          ],
        ));}}

相关问题