Home > Blockchain >  How to reposition a fixed widget in flutter
How to reposition a fixed widget in flutter

Time:08-05

I'm building an AR app with Flutter and using the The fixed positioned AR-widget

The dummy container which works as intended in the background

I want to put the camera in the background and put other widgets (such as photo-taking-button) on top of it.

How do I reposition it into a container? At least under the App Bar?

CodePudding user response:

Logically this should have worked, what i would suggest you try would be to first have a SafeArea widget.

SafeArea(
child: build(buildContext),
),

I had a similar issue in the past and using this solved it.

Also, there seems to be an open issue which seems related to this with the following possible solution :

With Flutter 2.10.5. it works without problems. This seems to be a Flutter 3 problem.
The way platforms views are rendered was changed in the 3.0 release.

probably same issue:
flutter/flutter#106246
explained here:
flutter/flutter#103630

I hope this will be fixed in new Flutter 3 releases soon.

And also this

I try the master channel Flutter v3.1.0-0.0.pre.1372 and the issue is fixed there.

Fixed will come to a stable channel soon with Flutter v3.1.0.

Also, I am not sure why are you using SizedBox as your parent widget.

Why not try a basic Container instead?

Good luck, Let me know if I can help with anything else

  • Related