Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 26, 2023 06:47
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