mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 17:06:50 +08:00 
			
		
		
		
	Verifying if GestureBinding is ready and if not, throwing a meaningful error
This commit is contained in:
		| @ -56,6 +56,10 @@ class Util { | ||||
|   /// | ||||
|   /// Use this in order to get it to work in case your app also contains other widgets. | ||||
|   void addGestureRecognizer(GestureRecognizer recognizer) { | ||||
|     if (GestureBinding.instance == null) { | ||||
|       throw new Exception("GestureBinding is not initialized yet, this probably happened because addGestureRecognizer was called before the runApp method"); | ||||
|     } | ||||
|  | ||||
|     GestureBinding.instance.pointerRouter.addGlobalRoute((PointerEvent e) { | ||||
|       if (e is PointerDownEvent) { | ||||
|         recognizer.addPointer(e); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Erick Zanardo
					Erick Zanardo