CariusLars / ar_flutter_plugin

Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices
MIT License
317 stars 228 forks source link

UI buttons in ARView #199

Closed zManu4K closed 5 months ago

zManu4K commented 1 year ago

Hello, im facing this issue, i cant place buttons/ui directly on the screen of ARView. Id like to have a fullscreen of ARView and then a couple buttons for user interface, i tried many ways but with no results, its seems like the button is visible for a fraction of second then it disappear, similar to a wrong setup of the stack widget.

@override Widget build(BuildContext context) { return Scaffold( body: Stack(children: [ ARView( onARViewCreated: onARViewCreated, planeDetectionConfig: PlaneDetectionConfig.horizontalAndVertical, ), Align( child: IconButton(onPressed: doSomething, icon: Icon(Icons.abc)) ), ])); }

Am I using it not properly? Thanks a lot in advance

AlbaneseRemy commented 7 months ago

Did you try adding an alignment and a size to your Icon? I got it working with that:

@override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ ARView( onARViewCreated: onARViewCreated, planeDetectionConfig: PlaneDetectionConfig.horizontalAndVertical, ), Align(alignment: FractionalOffset.bottomCenter, child: IconButton(onPressed: doSomething, icon: const Icon(Icons.abc, size: 50))), ], ), ); }

zManu4K commented 5 months ago

Im retarded