Adding Callback to send back values longitude and latitude when changed.
This commit is contained in:
parent
9da4d8f268
commit
6a07780d9d
1 changed files with 6 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ class Panorama extends StatefulWidget {
|
||||||
this.lonSegments = 64,
|
this.lonSegments = 64,
|
||||||
this.interactive = true,
|
this.interactive = true,
|
||||||
this.sensorControl = SensorControl.None,
|
this.sensorControl = SensorControl.None,
|
||||||
|
this.onChangedCallback,
|
||||||
this.child,
|
this.child,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
|
|
@ -82,6 +83,9 @@ class Panorama extends StatefulWidget {
|
||||||
/// Control the panorama with motion sensors.
|
/// Control the panorama with motion sensors.
|
||||||
final SensorControl sensorControl;
|
final SensorControl sensorControl;
|
||||||
|
|
||||||
|
/// It is called when the view direction has changed, sending the new longitude and latitude values back.
|
||||||
|
final Function(double, double) onChangedCallback;
|
||||||
|
|
||||||
/// Specify an Image(equirectangular image) widget to the panorama.
|
/// Specify an Image(equirectangular image) widget to the panorama.
|
||||||
final Image child;
|
final Image child;
|
||||||
|
|
||||||
|
|
@ -124,6 +128,8 @@ class _PanoramaState extends State<Panorama> with SingleTickerProviderStateMixin
|
||||||
} else
|
} else
|
||||||
_controller.forward();
|
_controller.forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
widget.onChangedCallback(longitude, latitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSceneCreated(Scene scene) {
|
void _onSceneCreated(Scene scene) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue