update example & version info

This commit is contained in:
Mark Hu 2020-12-10 12:20:55 +08:00
parent 7fa3fa56d6
commit 90dab5cd65
4 changed files with 30 additions and 11 deletions

View file

@ -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.

View file

@ -10,7 +10,7 @@ Add panorama as a dependency in your pubspec.yaml file.
```yaml ```yaml
dependencies: dependencies:
panorama: ^0.0.2 panorama: ^0.1.0
``` ```
Import and add the Panorama widget to your project. Import and add the Panorama widget to your project.

View file

@ -27,6 +27,9 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
File _imageFile; File _imageFile;
double _lon = 0;
double _lat = 0;
double _tilt = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,12 +37,23 @@ class _MyHomePageState extends State<MyHomePage> {
appBar: AppBar( appBar: AppBar(
title: Text(widget.title), title: Text(widget.title),
), ),
body: Panorama( body: Stack(
animSpeed: 0, children: [
interactive: false, Panorama(
animSpeed: 1.0,
sensorControl: SensorControl.Orientation, 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'), child: _imageFile != null ? Image.file(_imageFile) : Image.asset('assets/panorama.jpg'),
), ),
Text('${_lon.toStringAsFixed(3)}, ${_lat.toStringAsFixed(3)}, ${_tilt.toStringAsFixed(3)}'),
],
),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
mini: true, mini: true,
onPressed: () async { onPressed: () async {

View file

@ -1,6 +1,6 @@
name: panorama name: panorama
description: Panorama -- A 360-degree panorama viewer. description: Panorama -- A 360-degree panorama viewer.
version: 0.0.2 version: 0.1.0
homepage: https://github.com/zesage/panorama homepage: https://github.com/zesage/panorama
environment: environment:
@ -9,8 +9,8 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_cube: ^0.0.3 flutter_cube: ^0.0.6
motion_sensors: ^0.0.1 motion_sensors: ^0.0.4
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: