A 360-degree panorama viewer - Flutter Widget

Related tags

Widgets panorama
Overview

Panorama

pub package

A 360-degree panorama viewer.

Getting Started

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

dependencies:
  panorama: ^0.4.1

Import and add the Panorama widget to your project.

import 'package:panorama/panorama.dart';
... ...
  
@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Panorama(
          child: Image.asset('assets/panorama.jpg'),
        ),
      ),
    );
  }

Screenshot

screenshot

Usage Tutorials

Comments
  • error on this plugin

    error on this plugin

    hi just download the project from github and when i try to run it just give me this error: didn't change enything on the code:

    The following assertion was thrown during paint(): 'package:flutter/src/rendering/layer.dart': Failed assertion: line 1586 pos 12: 'value!.storage.every((double component) => component.isFinite)': is not true.

    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub: https://github.com/flutter/flutter/issues/new?template=BUG.md

    The relevant error-causing widget was: Panorama file:///home/ruben/Transfer%C3%AAncias/panorama-master/example/lib/main.dart:66:11 When the exception was thrown, this was the stack: #2 TransformLayer.transform= (package:flutter/src/rendering/layer.dart:1586:12) #3 PaintingContext.pushTransform (package:flutter/src/rendering/object.dart:576:13) #4 RenderTransform.paint (package:flutter/src/rendering/proxy_box.dart:2298:25) #5 RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2311:7) #6 PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13) ... The following RenderObject was being processed when the exception was fired: RenderTransform#65483 ... needs compositing ... parentData: top=NaN; left=NaN; width=90.0; height=75.0; offset=Offset(NaN, NaN) (can use size) ... constraints: BoxConstraints(w=90.0, h=75.0) ... layer: TransformLayer#f9c72 DETACHED ... engine layer: TransformEngineLayer#fa266 ... offset: Offset(0.0, 0.0) ... transform: [0] 0.5,0.0,0.9,532.2 [1] 0.2,1.0,-0.1,-206.9 [2] -0.9,0.3,0.5,686.0 [3] 0.0,0.0,0.0,1.0 ... size: Size(90.0, 75.0) ... transform matrix: [0] NaN,NaN,NaN,NaN [1] NaN,NaN,NaN,NaN [2] NaN,NaN,NaN,NaN [3] NaN,NaN,NaN,NaN ... origin: Offset(45.0, 37.5) ... alignment: null ... textDirection: ltr ... transformHitTests: true RenderObject: RenderTransform#65483 needs compositing parentData: top=NaN; left=NaN; width=90.0; height=75.0; offset=Offset(NaN, NaN) (can use size) constraints: BoxConstraints(w=90.0, h=75.0) layer: TransformLayer#f9c72 DETACHED engine layer: TransformEngineLayer#fa266 offset: Offset(0.0, 0.0) transform: [0] 0.5,0.0,0.9,532.2 [1] 0.2,1.0,-0.1,-206.9 [2] -0.9,0.3,0.5,686.0 [3] 0.0,0.0,0.0,1.0 size: Size(90.0, 75.0) transform matrix: [0] NaN,NaN,NaN,NaN [1] NaN,NaN,NaN,NaN [2] NaN,NaN,NaN,NaN [3] NaN,NaN,NaN,NaN origin: Offset(45.0, 37.5) alignment: null textDirection: ltr transformHitTests: true ... child: RenderOffstage#3bdd5 ... needs compositing ... parentData: (can use size) ... constraints: BoxConstraints(w=90.0, h=75.0) ... size: Size(90.0, 75.0) ... offstage: false ... child: RenderFlex#7cbde ... needs compositing ... parentData: (can use size) ... constraints: BoxConstraints(w=90.0, h=75.0) ... size: Size(90.0, 75.0) ... direction: vertical ... mainAxisAlignment: center ... mainAxisSize: max ... crossAxisAlignment: center ... verticalDirection: down ... child 1: RenderSemanticsAnnotations#ac26a relayoutBoundary=up1 ... needs compositing ... parentData: offset=Offset(1.0, 1.5); flex=null; fit=null (can use size) ... constraints: BoxConstraints(0.0<=w<=90.0, 0.0<=h<=Infinity) ... semantic boundary ... size: Size(88.0, 48.0) ... child: _RenderInputPadding#af226 relayoutBoundary=up2 ... needs compositing ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=90.0, 0.0<=h<=Infinity) ... size: Size(88.0, 48.0) ... child 2: RenderDecoratedBox#8e262 relayoutBoundary=up1 ... parentData: offset=Offset(0.0, 49.5); flex=null; fit=null (can use size) ... constraints: BoxConstraints(0.0<=w<=90.0, 0.0<=h<=Infinity) ... size: Size(90.0, 24.0) ... decoration: BoxDecoration ... color: Color(0x61000000) ... borderRadius: BorderRadius.circular(4.0) ... configuration: ImageConfiguration(bundle: PlatformAssetBundle#9bf52(), devicePixelRatio: 2.8, locale: en_US, textDirection: TextDirection.ltr, platform: android) ... child: RenderPadding#0a2d0 relayoutBoundary=up2 ... parentData: (can use size) ... constraints: BoxConstraints(0.0<=w<=90.0, 0.0<=h<=Infinity) ... size: Size(90.0, 24.0) ... padding: EdgeInsets.all(4.0) ... textDirection: ltr

    opened by maxTeste 8
  • New Feature: Add widget(s) on a given position

    New Feature: Add widget(s) on a given position

    Hi, first of all, I really love your plugin men, awesome job 😎🤘

    I like to suggest a new feature, I think it could be very useful. Feature: Add widget(s) on a given position.

    The idea could be add to the current panorama class a list of objets(a widget with the position in the scene):

    Panorama(
      child: Image.asset('assets/panorama.jpg'),
      widgets: <PositionedWidget>[]
    ),
    

    And the PositionedWidget Class something like:

    PositionedWidget {
      Vector3 position,
      Widget widget
    }
    

    This could be used to add (for example):

    • A button in a position of the image an enable new interactions
    • A text/hint when the user click a widget.
    • Etc.
    opened by rlazom 5
  • Feature request: cropped area parameters

    Feature request: cropped area parameters

    This package is great, but panorama images that do not cover the full 360/180 are stretched.

    This happens when the panorama is cropped, for example with the CroppedAreaLeftPixels and CroppedAreaTopPixels from the Google panorama spec: https://developers.google.com/streetview/spherical-metadata

    It would be nice if the Panorama constructor provided parameters to specify the cropped area.

    When the image does not cover the full 360/180, some apps just render a black background, some apps do something fancier (for example Google Photos interpolates the pixels from the edge of the image to fill the background). Personally I would be happy with a plain black background, but it can be something fun to explore.

    opened by deckerst 2
  • Support for device rotations

    Support for device rotations

    Hi thanks for the plugin.Are you planning to add support for device rotations anytime soon ? If not, how would you go about implementing it? I will try to implement it and make pr request if successful.

    opened by thangmam 2
  • Update to add onImageLoad event

    Update to add onImageLoad event

    Noticed blank grey background before 360 images loaded. 'onImageLoad' event makes it possible to add loading widgets behavior before the 360 images come to view

    Panorama without onImageLoad event implementation to show and close loader when image has loaded

    panorama-with-no-loader

    Panorama with onImageLoad event implementation to show and close loader when image has loaded

    panorama-with-loader

    opened by george-assan 1
  • How to show a spinner during network image loading ?

    How to show a spinner during network image loading ?

    I'm using flutter cached_network_image component for panoramas. Some panorama have quite big size (8-12Mb). Any idea how to show a spinner to show the downloading phase ?

    opened by dariocavada 1
  • Add a Callback on the Widget

    Add a Callback on the Widget

    Should be some way to pass a Callback function to the widget. Then, this Callback would be called when longitude and latitude values changed, passing these values back. This would really help me.

    opened by MateusRosario 1
  • Fix to prevent the AnimationController from stopping if a sensorControl is active

    Fix to prevent the AnimationController from stopping if a sensorControl is active

    I found that if I was setting sensorControl on the Panorama class, to the following... sensorControl: SensorControl.AbsoluteOrientation, AND animSpeed to 0, the tracking wasn't working.

    I discovered that the AnimationController was being stopped prematurely in my case, so I added a check to make sure widget.sensorControl == SensorControl.None before the AnimationController is stopped.

    opened by cellininicholas 0
  • Update hotspot stream controller when view is updated

    Update hotspot stream controller when view is updated

    The hotspots in my Panorama widget are not showing when first starting the app, but only after doing a hot reload. I found out this is because on line 361 of panorama.dart there is a check for scene != null, and so at the start of the app the scene was not yet created for me and therefore no hotspots are created (when I do a hot reload the scene already exists so the hotspots are created).

    Another problem I found is that the hotspots do not update their position when the camera view changes (when the user moves the camera around). This line of code solves both problems for me (i.e. hotspot is not showing at beginning, and hotspots do not update position).

    opened by martintan 0
  • Adding Callback to send back values longitude and latitude when changed.

    Adding Callback to send back values longitude and latitude when changed.

    I've created this #5 issue about this, so I decided to add the modifications I've suggested. This modification would really help me. I want to have a way to know the view position from a parent widget.

    opened by MateusRosario 0
  • i have issue with set lat log on image when i set response data. how can i set ?

    i have issue with set lat log on image when i set response data. how can i set ?

    point not set proper on image when i set latitude longitude on image

    problem is when i set my latitude and longitude then it create issue if i pass same as package example it work but when i try to set my latitude longitude then it not set on proper location on image how can i set my latitude and longitude on image ?

    my response latitude longitude

            Hotspot(
                          latitude: -0.28432929839672116,
                          longitude: 1.616277412081424,
                          width: 32.0,
                          height: 32.0,
                          widget: hotspotButton(text: "Next scene", icon: Icons.double_arrow, onPressed: () => setState(() => _panoId++)),
                        ),
                        Hotspot(
                          latitude: -0.09803491532566011,
                          longitude: 3.5010972079769416,
                          width: 32.0,
                          height: 32.0,
                          widget: hotspotButton(text: "Next scene", icon: Icons.double_arrow, onPressed: () => setState(() => _panoId++)),
                        ),
                        Hotspot(
                          latitude: -0.2971211211941356,
                          longitude: 4.726412439317375,
                          width: 32.0,
                          height: 32.0,
                          widget: hotspotButton(text: "Next scene", icon: Icons.double_arrow, onPressed: () => setState(() => _panoId++)),
                        ),
    
    opened by HencyPithadiya 0
  • Image quality is bad and pixeled when I use network image

    Image quality is bad and pixeled when I use network image

    When I use network image as Image provider, I get the image quality so bad.

          appBar: AppBar(
            backgroundColor: Theme.of(context).primaryColor,
            elevation: 0,
          ),
          body: SizedBox(
            height: size.height,
            width: size.width,
           child: Panorama(
              //animSpeed: 1.0,
              //sensorControl: SensorControl.Orientation,
              child: Image.network(imageURL),
           ),
          ),
        );```
    
    How can I solve this issue?
    opened by moatazfouad 0
  • "Flutter run" on the example project fails with the following error

    FAILURE: Build failed with an exception.

    • What went wrong: Could not determine the dependencies of task ':app:processDebugResources'.

    Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. Could not resolve androidx.window:window:[1.0.0-beta04]. Required by: project :app > project :flutter_plugin_android_lifecycle > io.flutter:flutter_embedding_debug:1.0.0-e85ea0e79c6d894c120cda4ee8ee10fe6745e187 > androidx.window:window-java:1.0.0-beta04 > Failed to list versions for androidx.window:window. > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml. > Could not get resource 'https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml'. > Could not GET 'https://google.bintray.com/exoplayer/androidx/window/window/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    Any idea how to fix this ?

    This is my first time using flutter. Any help is greatly appreciated.

    opened by deltamish 0
  • Changes regarding loading and error handling

    Changes regarding loading and error handling

    Added fields to receive loading progress through a builder, error messages through an error builder and option to pass an image to be rendered in the panoramic view if original image encounters an error while loading.

    opened by powell-cord 0
Owner
Zebiao Hu
Just a coder! Languages: Flutter, Dart, Go, Delphi.
Zebiao Hu
A flutter carousel widget, support infinite scroll, and custom child widget.

carousel_slider A carousel slider widget. Features Infinite scroll Custom child widgets Auto play Supported platforms Flutter Android Flutter iOS Flut

Bart T 1 Nov 25, 2021
A Flutter Widget to make interactive timeline widget.

Bubble Timeline Package A Flutter Widget to make interactive timeline widget. This widget can be used to make Event Timelines, or Timelines for certai

Vansh Goel 12 Sep 22, 2022
📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget.

?? Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.

Blue Fire 1.7k Jan 7, 2023
A widget lib that the widget in this lib can react to flutter ScrollController's offset

Language: English | 中文简体 linked_scroll_widgets A lib full of widgets that can react to the scrollController's offset change,to custom your UI effect.

WenJingRui 8 Oct 16, 2022
Full customable rolling switch widget for flutter apps based on Pedro Massango's 'crazy-switch' widget

lite_rolling_switch Full customable rolling switch widget for flutter apps based on Pedro Massango's 'crazy-switch' widget https://github.com/pedromas

Eduardo Muñoz 48 Dec 1, 2022
Progress Dialog widget for flutter projects with ability to customize loading widget, background color and background blur.

DISCONTINUED Checkout ArsDialog ars_progress_dialog Customizable progress dialog for Flutter applications with smooth animation for background dim col

Arsam 8 Apr 15, 2022
A Flutter widget that will give a Glitch Animation Effect to it's child widget.

GlitchEffect A Flutter widget that will give a Glitch Animation Effect to it's child widget. Installation Add the latest version of package to your pu

Sameer Singh 6 Nov 25, 2022
Widget, that can make any static located widget hidable

Installing See the official installing guidline from hidable/install Usage & Overview To start using Hidable widget, we have to create a ScrollControl

Anon 18 Dec 16, 2022
A widget that allow user resize the widget with drag

Flutter-Resizable-Widget A widget that allow user resize the widget with drag Note: this widget uses Getx Example bandicam.2021-11-11.12-34-41-056.mp4

MohammadAminZamani.afshar 22 Dec 13, 2022
Flutter Carousel Pro - A Flutter Carousel widget

Carousel Extended A Flutter Carousel widget. Usage As simple as using any flutter Widget. Based on Carousel Pro but extended to be able to navigate be

omid habibi 3 Dec 7, 2020
🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

?? A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

Andrei Lesnitsky 32 Oct 8, 2022
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

English | Português Flutter Hooks A Flutter implementation of React hooks: https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 Ho

Remi Rousselet 2.6k Dec 29, 2022
A credit card widget for Flutter application.

A credit card widget for Flutter application.

Simform Solutions 281 Dec 27, 2022
A simple Flutter widget library that helps us to select days in a week.

A simple Flutter widget library that helps us to select days in a week.

Shan Shaji 4 Oct 9, 2022
Flutter debug helper widget with common and custom actions

Flutter debug helper widget with common and custom actions

Stanislav Ilin 43 Dec 7, 2022
A flutter plugin which provides Crop Widget for cropping images.

A flutter plugin which provides Crop Widget for cropping images.

Chooyan 97 Jan 5, 2023
The Chicago widget set for Flutter

Chicago widget library The Chicago widget set is a retro 32-bit desktop design language for Flutter. It was discussed in the Building a desktop design

Todd Volkert 404 Dec 26, 2022
A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

Draggable Home A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier! Based on the Scaffold and Sliver. Us

Devs On Flutter 106 Dec 12, 2022
Flutter widget for fetching, caching and refetching asynchronous data.

Flutter library for fetching, caching and invalidating asynchronous data Quick Features Fetch asynchronous data Data invalidation Optimistic response

null 32 Dec 24, 2022