Open frantovar opened 1 year ago
Have you found a solution?
I have the same problem using ModelViewer
inside IndexedStack
.
I've tried to reproduce such problem with WebView, but it works fine:
Any ideas what it could be?
I figured out that the problem isn't with Stack but with widgets in it. There is what i mean: If there are widgets in Stack above ModelViewer then ModelViewer’s gesture detector cracks after clicking on any widget above it. Here is code to reproduce problem:
return Scaffold(
body: Stack(children: [
ModelViewer(
id: "modelViewBlock",
src: "https://modelviewer.dev/shared-assets/models/Astronaut.glb",
ar: false,
backgroundColor: Colors.green,
loading: Loading.eager,
cameraControls: true,
touchAction: TouchAction.none,
enablePan: false,
disableZoom: false,
autoRotate: true,
),
Positioned(
bottom: 20 + MediaQuery.of(context).padding.bottom,
left: 40,
width: 40,
height: 40,
child: Container(color: Colors.red),
),
]),
);
It can be fixed by covering above widgets with IgnorePointer:
return Scaffold(
body: Stack(children: [
ModelViewer(
id: "modelViewBlock",
src: "https://modelviewer.dev/shared-assets/models/Astronaut.glb",
ar: false,
backgroundColor: Colors.green,
loading: Loading.eager,
cameraControls: true,
touchAction: TouchAction.none,
enablePan: false,
disableZoom: false,
autoRotate: true,
),
Positioned(
bottom: 20 + MediaQuery.of(context).padding.bottom,
left: 40,
width: 40,
height: 40,
child: IgnorePointer(
child: Container(color: Colors.red),
),
),
]),
);
But it’s still problem to use GestureDetectors above ModelViewer. I think ModelViewer make "+1 pan" after clicking on widget. So after one click it start to zoom model when only one finger on screen. And absolutely stucks after the second tap. Here is video: https://user-images.githubusercontent.com/44160618/218119132-81b333f5-7298-4256-a566-c8df0ffbf168.mp4
07/01/2023, the error persists. I still can't click on the buttons on the scene with the model. Has anyone found a solution? And this problem is reproduced only on ios. On Android devices, all buttons work correctly
Describe the bug After showing a dialog over the modelViewer the model controls start failing and rotation don't work anymore. You can check the video here.
To reproduce Steps to reproduce the behavior:
Expected behavior After closing the dialog the model should be controller normally.
Simulator and real device
Additional context Add any other context about the problem here.