Skip to content
51 changes: 27 additions & 24 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class _MyHomePageState extends State<MyHomePage> {
});
}

Widget hotspotButton({String? text, IconData? icon, VoidCallback? onPressed}) {
Widget hotspotButton(
{String? text, IconData? icon, VoidCallback? onPressed}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand All @@ -61,7 +62,9 @@ class _MyHomePageState extends State<MyHomePage> {
text != null
? Container(
padding: EdgeInsets.all(4.0),
decoration: BoxDecoration(color: Colors.black38, borderRadius: BorderRadius.all(Radius.circular(4))),
decoration: BoxDecoration(
color: Colors.black38,
borderRadius: BorderRadius.all(Radius.circular(4))),
child: Center(child: Text(text)),
)
: Container(),
Expand All @@ -78,32 +81,25 @@ class _MyHomePageState extends State<MyHomePage> {
animSpeed: 1.0,
sensorControl: SensorControl.Orientation,
onViewChanged: onViewChanged,
onTap: (longitude, latitude, tilt) => print('onTap: $longitude, $latitude, $tilt'),
onLongPressStart: (longitude, latitude, tilt) => print('onLongPressStart: $longitude, $latitude, $tilt'),
onLongPressMoveUpdate: (longitude, latitude, tilt) => print('onLongPressMoveUpdate: $longitude, $latitude, $tilt'),
onLongPressEnd: (longitude, latitude, tilt) => print('onLongPressEnd: $longitude, $latitude, $tilt'),
onTap: (longitude, latitude, tilt) =>
print('onTap: $longitude, $latitude, $tilt'),
onLongPressStart: (longitude, latitude, tilt) =>
print('onLongPressStart: $longitude, $latitude, $tilt'),
onLongPressMoveUpdate: (longitude, latitude, tilt) =>
print('onLongPressMoveUpdate: $longitude, $latitude, $tilt'),
onLongPressEnd: (longitude, latitude, tilt) =>
print('onLongPressEnd: $longitude, $latitude, $tilt'),
child: Image.asset('assets/panorama.jpg'),
hotspots: [
Hotspot(
latitude: -15.0,
longitude: -129.0,
width: 90,
height: 75,
widget: hotspotButton(text: "Next scene", icon: Icons.open_in_browser, onPressed: () => setState(() => _panoId++)),
),
Hotspot(
latitude: -42.0,
longitude: -46.0,
width: 60.0,
height: 60.0,
widget: hotspotButton(icon: Icons.search, onPressed: () => setState(() => _panoId = 2)),
),
Hotspot(
latitude: -33.0,
longitude: 123.0,
width: 60.0,
height: 60.0,
widget: hotspotButton(icon: Icons.arrow_upward, onPressed: () {}),
child: hotspotButton(
text: "Next scene",
icon: Icons.open_in_browser,
onPressed: () => setState(() => _panoId++)),
),
],
);
Expand All @@ -123,7 +119,10 @@ class _MyHomePageState extends State<MyHomePage> {
longitude: -46.0,
width: 90.0,
height: 75.0,
widget: hotspotButton(text: "Next scene", icon: Icons.double_arrow, onPressed: () => setState(() => _panoId++)),
child: hotspotButton(
text: "Next scene",
icon: Icons.double_arrow,
onPressed: () => setState(() => _panoId++)),
),
],
);
Expand All @@ -140,7 +139,10 @@ class _MyHomePageState extends State<MyHomePage> {
longitude: 160.0,
width: 90.0,
height: 75.0,
widget: hotspotButton(text: "Next scene", icon: Icons.double_arrow, onPressed: () => setState(() => _panoId++)),
child: hotspotButton(
text: "Next scene",
icon: Icons.double_arrow,
onPressed: () => setState(() => _panoId++)),
),
],
);
Expand All @@ -152,7 +154,8 @@ class _MyHomePageState extends State<MyHomePage> {
body: Stack(
children: [
panorama,
Text('${_lon.toStringAsFixed(3)}, ${_lat.toStringAsFixed(3)}, ${_tilt.toStringAsFixed(3)}'),
Text(
'${_lon.toStringAsFixed(3)}, ${_lat.toStringAsFixed(3)}, ${_tilt.toStringAsFixed(3)}'),
],
),
floatingActionButton: FloatingActionButton(
Expand Down
133 changes: 88 additions & 45 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,58 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.3.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
sha256: "8e36feea6de5ea69f2199f29cf42a450a855738c498b57c0b980e2d3cca9c362"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.18.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -59,14 +66,16 @@ packages:
dependency: transitive
description:
name: flutter_cube
url: "https://pub.dartlang.org"
sha256: "71cf679a251166eb97f86751c56582b09abdbf859485fbf60524948813914c3b"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
sha256: "0ba8a1854c2098ddbd043e47eb28451a13f4cab7db9b2696f13a39fd8853421d"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
flutter_test:
Expand All @@ -78,49 +87,64 @@ packages:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
sha256: "0a48a4e44ec1b6a52eb93b12d129f5b74ee6dbb27703439c965f1bd86f7be59f"
url: "https://pub.dev"
source: hosted
version: "0.13.0"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185
url: "https://pub.dev"
source: hosted
version: "4.0.0"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
sha256: "8f496a46a16125ad07eb1964021b02cbe9e0071d657cfc5b4e0e2ce0ea2e8607"
url: "https://pub.dev"
source: hosted
version: "0.7.2+1"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
sha256: f2005505f6df84c9eb580026cd3f56761187994c8a2cf65c1582cf8788873ac1
url: "https://pub.dev"
source: hosted
version: "2.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.10"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.10.0"
motion_sensors:
dependency: transitive
description:
name: motion_sensors
url: "https://pub.dartlang.org"
sha256: "4e2734a76cd6da633013bcdc68a9efe9fbbcff906e6d6c45040932edda3fa5d6"
url: "https://pub.dev"
source: hosted
version: "0.1.0"
panorama:
Expand All @@ -129,26 +153,29 @@ packages:
path: ".."
relative: true
source: path
version: "0.4.0"
version: "0.4.1"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.8.3"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
sha256: "8f6460c77a98ad2807cd3b98c67096db4286f56166852d0ce5951bb600a63594"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
sha256: c2c49e16d42fd6983eb55e44b7f197fdf16b4da7aab7f8e1d21da307cad3fb02
url: "https://pub.dev"
source: hosted
version: "2.0.0"
sky_engine:
Expand All @@ -160,58 +187,74 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.2.19"
version: "0.6.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "0.3.0"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=1.20.0"
Loading