Merge pull request #33 from george-assan/master
Update to add onImageLoad event
This commit is contained in:
commit
87e43ef941
1 changed files with 5 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ class Panorama extends StatefulWidget {
|
||||||
this.onLongPressStart,
|
this.onLongPressStart,
|
||||||
this.onLongPressMoveUpdate,
|
this.onLongPressMoveUpdate,
|
||||||
this.onLongPressEnd,
|
this.onLongPressEnd,
|
||||||
|
this.onImageLoad,
|
||||||
this.child,
|
this.child,
|
||||||
this.hotspots,
|
this.hotspots,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
@ -120,6 +121,9 @@ class Panorama extends StatefulWidget {
|
||||||
|
|
||||||
/// This event will be called when the user has stopped a long presses, it contains latitude and longitude about where the user pressed.
|
/// This event will be called when the user has stopped a long presses, it contains latitude and longitude about where the user pressed.
|
||||||
final Function(double longitude, double latitude, double tilt)? onLongPressEnd;
|
final Function(double longitude, double latitude, double tilt)? onLongPressEnd;
|
||||||
|
|
||||||
|
/// This event will be called when provided image is loaded on texture.
|
||||||
|
final Function()? onImageLoad;
|
||||||
|
|
||||||
/// Specify an Image(equirectangular image) widget to the panorama.
|
/// Specify an Image(equirectangular image) widget to the panorama.
|
||||||
final Image? child;
|
final Image? child;
|
||||||
|
|
@ -299,6 +303,7 @@ class _PanoramaState extends State<Panorama> with SingleTickerProviderStateMixin
|
||||||
surface?.mesh.textureRect = Rect.fromLTWH(0, 0, imageInfo.image.width.toDouble(), imageInfo.image.height.toDouble());
|
surface?.mesh.textureRect = Rect.fromLTWH(0, 0, imageInfo.image.width.toDouble(), imageInfo.image.height.toDouble());
|
||||||
scene!.texture = imageInfo.image;
|
scene!.texture = imageInfo.image;
|
||||||
scene!.update();
|
scene!.update();
|
||||||
|
widget.onImageLoad!();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _loadTexture(ImageProvider? provider) {
|
void _loadTexture(ImageProvider? provider) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue