搜索插件、代码仓与 APP 分类

full_screen_image_null_safe 封面
插件详情v2.0.0

full_screen_image_null_safe

全屏照片查看器。垂直滚动时会关闭。可以与 Hero 小部件一起使用。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
842
喜欢数
43
Pub 分数
130

安装插件

flutter pub add full_screen_image_null_safe

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个适用于 Flutter 的全屏图片查看器包,当用户垂直滚动时会自动关闭。它支持与 Hero 小部件无缝集成,实现图片之间的平滑过渡。设计为完全空安全,并可在 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台上兼容。非常适合需要沉浸式照片浏览体验和直观手势导航的应用程序。

适合场景

  • 全屏查看高分辨率图像
  • 创建带有平滑过渡效果的图像画廊
  • 与 Hero 动画集成以实现图像共享
  • 增强移动和网页端的照片浏览体验
  • 实现滑动关闭行为
  • 在全屏模态中显示图像

主要特点

  • 垂直滚动时自动消失
  • 空安全的 Dart 实现
  • Hero widget 兼容性
  • 跨平台支持(Android、iOS、Web、macOS、Windows、Linux)
  • 手势驱动的导航
  • 轻量且易于集成

适合对象

  • 移动和网页照片画廊应用
  • 图像密集型应用
  • 使用英雄过渡的App
  • 寻求简单全屏图像查看器的开发者
  • 需要跨平台图像显示的项目
  • 想要直观图像导航的用户

使用建议

  • 可能不支持水平滚动关闭
  • 手势的自定义选项有限
  • 依赖父滚动上下文进行关闭
  • 最适合单张图像视图,而不是复杂布局
  • 在嵌套的滚动视图中需要谨慎处理
  • 不适用于视频或动画内容

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Full Screen image

Full screen photo viewer. It shuts off when scrolling vertically. Can work with Hero widget

Installation

To use this plugin, add full_screen_image_null_safe as a dependency in your pubspec.yaml file.

full_screen_image_null_safe: any

Getting Started

Check out the example app using full_screen_image.

Flutter

Full screen image:
  FullScreenWidget(
        child: ClipRRect(
          borderRadius: BorderRadius.circular(16),
          child: Image.asset(
            "assets/image1.jpg",
            fit: BoxFit.cover,
          ),
        ),
      )

Full screen with hero:
FullScreenWidget(
        child: Hero(
          tag: "customTag",
          child: ClipRRect(
            borderRadius: BorderRadius.circular(16),
            child: Image.asset(
              "assets/image2.jpg",
              fit: BoxFit.cover,
            ),
          ),
        ),
      );

Small image:

if you don't want widget full screen then use center widget

 FullScreenWidget(
        child: Center(
          child: Hero(
            tag: "smallImage",
            child: ClipRRect(
              borderRadius: BorderRadius.circular(16),
              child: Image.asset(
                "assets/image3.jpg",
                fit: BoxFit.cover,
              ),
            ),
          ),
        ),
      );
Custom background color:
FullScreenWidget(
        backgroundColor: Colors.purple,
        child: Center(
          child: Hero(
            tag: "customBackground",
            child: ClipRRect(
              borderRadius: BorderRadius.circular(16),
              child: Image.asset(
                "assets/image3.jpg",
                fit: BoxFit.cover,
              ),
            ),
          ),
        ),
      );

Non transparent widget:
FullScreenWidget(
        backgroundColor: Colors.purple,
        backgroundIsTransparent: false,
        child: Center(
          child: Hero(
            tag: "nonTransparent",
            child: ClipRRect(
              borderRadius: BorderRadius.circular(16),
              child: Image.asset(
                "assets/image3.jpg",
                fit: BoxFit.cover,
              ),
            ),
          ),
        ),
      );

Custom widget:
  FullScreenWidget(
        child: SafeArea(
          child: Card(
            elevation: 4,
            child: Container(
              height: 350,
              padding: const EdgeInsets.all(8.0),
              child: Column(
                children: <Widget>[
                  Hero(
                    tag: "customWidget",
                    child: ClipRRect(
                      borderRadius: BorderRadius.circular(16),
                      child: Image.asset(
                        "assets/image3.jpg",
                        fit: BoxFit.cover,
                      ),
                    ),
                  ),
                  SizedBox(
                    height: 16,
                  ),
                  Text('Lorem text',style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold),),
                  SizedBox(
                    height: 16,
                  ),
                  Expanded(
                    child: Text(
                      lorem,
                    ),
                  ),

                ],
              ),
            ),
          ),
        ),
      );

License

Apache

所属分类

源码仓库

使用此插件的项目

暂无相关数据。