diff --git a/CHANGELOG.md b/CHANGELOG.md index ac07159..ddcd584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ -## [0.0.1] - TODO: Add release date. +## [0.1.0] - 02/22/2020 -* TODO: Describe initial release. +* Add sensor control. +* Add onViewChanged event. + +## [0.0.2] - 02/22/2020 + +* Initial release. diff --git a/README.md b/README.md index 9b88372..ad92bbc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Add panorama as a dependency in your pubspec.yaml file. ```yaml dependencies: - panorama: ^0.0.2 + panorama: ^0.1.0 ``` Import and add the Panorama widget to your project. diff --git a/example/lib/main.dart b/example/lib/main.dart index bf555a7..fab13fe 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -27,6 +27,9 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { File _imageFile; + double _lon = 0; + double _lat = 0; + double _tilt = 0; @override Widget build(BuildContext context) { @@ -34,11 +37,22 @@ class _MyHomePageState extends State { appBar: AppBar( title: Text(widget.title), ), - body: Panorama( - animSpeed: 0, - interactive: false, - sensorControl: SensorControl.Orientation, - child: _imageFile != null ? Image.file(_imageFile) : Image.asset('assets/panorama.jpg'), + body: Stack( + children: [ + Panorama( + animSpeed: 1.0, + sensorControl: SensorControl.Orientation, + onViewChanged: (longitude, latitude, tilt) { + setState(() { + _lon = longitude; + _lat = latitude; + _tilt = tilt; + }); + }, + child: _imageFile != null ? Image.file(_imageFile) : Image.asset('assets/panorama.jpg'), + ), + Text('${_lon.toStringAsFixed(3)}, ${_lat.toStringAsFixed(3)}, ${_tilt.toStringAsFixed(3)}'), + ], ), floatingActionButton: FloatingActionButton( mini: true, diff --git a/pubspec.yaml b/pubspec.yaml index 572b6a5..d5d5de8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: panorama description: Panorama -- A 360-degree panorama viewer. -version: 0.0.2 +version: 0.1.0 homepage: https://github.com/zesage/panorama environment: @@ -9,8 +9,8 @@ environment: dependencies: flutter: sdk: flutter - flutter_cube: ^0.0.3 - motion_sensors: ^0.0.1 + flutter_cube: ^0.0.6 + motion_sensors: ^0.0.4 dev_dependencies: flutter_test: