Roaa94/flutter_3d_calculator

How does a transformed key still receive click events?

rivella50 opened this issue · 1 comments

Hi Roaa,

thanks for this great project.
In the code i see that you use Transformand rotateZ to switch between the 3d and 2d view.
What i don't get: Why do the keys still receive click events after switching to the 3d view? From what i've read the clickable area is not transformed when using Transform but stays at the old position.
I currently do some investigations for a puzzle game in 3d where i try in my first test to get clickable a button after transforming it (which doesn't work so far):

Stack(
  children: [
    Transform(
      transform: math64.Matrix4.identity()
        ..rotateY(pi/2)
        ..translate(math64.Vector3(0,0,-80)),
      alignment: Alignment.topLeft,
      child: TextButton(
        onPressed: () => print('clicked'),
        child: Text('Click', style: TextStyle(color: Colors.white),),
      ),
    )
  ],
)
Screen.Recording.2023-07-01.at.15.44.14.mov

Do you see what i'm possibly missing here? It would be great if you could give me a hint how to get this thing working.

Thanks so much & have a great first weekend in Berlin.
Valentin

Got it working.