Created
July 26, 2023 06:47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArScreen extends StatefulWidget { | |
const ArScreen({Key? key}) : super(key: key); | |
@override | |
_ArScreenState createState() => _ArScreenState(); | |
} | |
class _ArScreenState extends State<ArScreen> { | |
ARSessionManager? arSessionManager; | |
ARObjectManager? arObjectManager; | |
ARAnchorManager? arAnchorManager; | |
List<ARNode> nodes = []; | |
List<ARAnchor> anchors = []; | |
@override | |
void dispose() { | |
super.dispose(); | |
arSessionManager!.dispose(); } | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Anchors & Objects on Planes'), | |
), | |
body: Stack(children: [ | |
ARView( | |
onARViewCreated: onARViewCreated, | |
planeDetectionConfig: PlaneDetectionConfig.horizontalAndVertical, | |
), | |
Align( | |
alignment: FractionalOffset.bottomCenter, | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: [ | |
ElevatedButton( | |
onPressed: onRemoveEverything, | |
child: const Text("Remove Everything")), | |
]), | |
) | |
])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment