搜索分类、插件与代码仓

imageview360 封面
插件详情v1.3.0

imageview360

一个 Flutter 包,提供图像的 360 度视图,支持旋转和手势自定义。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
145
喜欢数
198
Pub 分数
150

安装插件

flutter pub add imageview360

插件介绍

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

imageview360 是一个 Flutter 包,可实现沉浸式的 360 度图像浏览,支持平滑旋转和自定义手势。用户可通过滑动或拖拽探索全景图像,非常适合虚拟导览、产品展示和互动媒体。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,确保广泛的兼容性。开发者可以精细调整旋转速度、灵敏度和交互行为,以匹配其应用的设计。该包注重性能与易用性,可无缝集成到 Flutter 应用中。

适合场景

  • 虚拟现实体验
  • 产品可视化
  • 交互式照片画廊
  • 教育类360内容
  • 房地产看房

主要特点

  • 顺畅的360度旋转
  • 可自定义手势控制
  • 跨平台支持
  • 高性能渲染
  • 可配置的旋转速度
  • 响应式触摸交互

适合对象

  • 需要沉浸式图像探索的应用
  • 支持3D产品视图的电商平台
  • 旅行和旅游应用
  • 带有全景内容的教育工具
  • 互动叙事应用

使用建议

  • 需要高分辨率源图像
  • 可能会影响低端设备的性能
  • 仅限静态360图像(不支持视频)
  • 初始设置可能需要图像预处理
  • 手势自定义需要熟悉 Flutter 输入处理

原始 README

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

imageview360

A Flutter package which provides 360 view of the images with rotation and gesture customisations.

Supported Dart Versions

Dart SDK version >= 2.12.0

Demo Gif

imageview360 Demo

Installation

Pub

Add the Package

dependencies:
  imageview360: ^1.2.0

How to use

Import the package in your dart file

import 'package:imageview360/imageview360.dart';

Basic usage :
ImageView360(
     key: UniqueKey(),
     imageList: imageList,
),

Note: For ImageView360 to show instant changes on hot reload, you need to provide UniqueKey() so that the widget rebuilds every time.

Customisable usage :
ImageView360(
    key: UniqueKey(),                                           
    imageList: imageList,                                       
    autoRotate: true,                                           //Optional
    rotationCount: 2,                                           //Optional
    rotationDirection: RotationDirection.anticlockwise,         //Optional
    frameChangeDuration: Duration(milliseconds: 50),            //Optional
    swipeSensitivity: 2,                                        //Optional
    allowSwipeToRotate: true,                                   //Optional
    onImageIndexChanged: (currentImageIndex) {                  //Optional
                          print("currentImageIndex: $currentImageIndex");
                        },
)

Note: For better experience always precache image before providing the images to the widget as follows.

Example for loading and precaching images from assets :
 List<ImageProvider> imageList = List<ImageProvider>();
   for (int i = 1; i <= 52; i++) {
      imageList.add(AssetImage('assets/sample/$i.png'));
// To precache images so that when required they are loaded faster.
      await precacheImage(AssetImage('assets/sample/$i.png'), context);
    }
Mandatory fields
Attribute Type Usage
imageList List The list of images to be displayed
Customisable fields
Attribute Type Default Value
autoRotate bool false
rotationCount int 1
rotationDirection RotationDirection RotationDirection.clockwise
frameChangeDuration Duration Duration(milliseconds: 80)
swipeSensitivity int 1 (Note : Range allowed is 1-5 , less than 1 would be considered 1 and more than 5 would be considered 5)
allowSwipeToRotate bool true
onImageIndexChanged Function(int) (currentImageIndex){}

Blog Post

To have a better understanding how this package works under the hood, checkout my blog post: 360 degree image showcase in Flutter

Created & Maintained By

Harpreet Singh

Damanpreet Singh

License

Copyright 2020 Harpreet Singh & Damanpreet Singh

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。