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

lightbox 封面
插件详情v0.1.0

lightbox

用于创建类似网页应用的灯箱的 Flutter 插件。可用于以幻灯片叠加层的形式展示多种类型的图像(URL、资源文件、文件、字节)并提供控制功能。

AndroidiOSmacOSWindowsLinux
近 30 天下载
39
喜欢数
33
Pub 分数
150

安装插件

flutter pub add lightbox

插件介绍

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

lightbox 包是一个 Flutter 插件,可让开发者创建类似网页的轻量级图层叠加效果,以幻灯片格式显示图像。它支持多种图像源,包括 URL、资源文件、本地文件和字节数据,适用于各种使用场景。通过可自定义的控件,该插件在全屏查看图像时提升了用户体验。该插件兼容多个平台,包括 Android、iOS、macOS、Windows 和 Linux,确保广泛的覆盖范围。非常适合用于画廊、产品展示或任何需要沉浸式图像浏览的应用。

适合场景

  • 图像画廊
  • 产品图片查看器
  • 全屏照片幻灯片
  • 社交媒体图片分享
  • 文档图像预览

主要特点

  • 支持 URL、资产、文件和字节图像源
  • 可自定义的导航控件
  • 跨平台兼容性
  • 平滑过渡动画
  • 可配置的叠加样式

适合对象

  • 带有图像内容的移动和桌面应用程序
  • 电子商务应用
  • 照片分享平台
  • 内容丰富的教育类应用程序
  • 交互式文档

使用建议

  • 需要正确的图像加载处理
  • 可能会影响大型图像集的性能
  • 需要仔细配置以确保可访问性
  • 仅限图像显示
  • 依赖外部依赖项以实现高级功能

原始 README

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

lightbox

A simple package to recreate web lightbox in Flutter. Ligthbox enables you to show images in an overlay widget with controls to slide between images.

The source code is 100% Dart, and everything resides in the /lib folder.

Show some :heart: and star the repo to support the projectd

Open Source Love License

Installation

Add lightbox as a dependency in your pubspec.yaml file.

dependencies:
  lightbox: 0.1.0

image

Then import lightbox:

import 'package:lightbox/lightbox.dart';

Example usage

import 'package:lightbox/lightbox.dart';
          // images variable is an array of paths or url of images to load in the lightbox.
                   ListView.separated(
                                       separatorBuilder: (context, index) => SizedBox(width: 10.0),
                                       scrollDirection: Axis.horizontal,
                                       itemCount: imagesAsset.length,
                                       itemBuilder: (context, position) {
                                         return GestureDetector(
                                           child: Container(
                                               height: 200,
                                               width: 200,
                                               child: Image.asset(
                                                 imagesAsset[position],
                                                 fit: BoxFit.cover,
                                               )),
                                           onTap: () {
                                             Navigator.push(
                                                 context,
                                                 LightBoxRoute(
                                                     builder: (BuildContext context) {
                                                       return LightBox(
                                                       images:imagesAsset,
                                                         initialIndex: position,
                                                         imageType: ImageType.ASSET,
                                                       );
                                                     },
                                                     dismissible: false));
                                           },
                                         );
                                       }),

You can find a more detailed example here

📃 License

Copyright (c) 2020 Lemovou Ivan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。