You may see this error
======== Exception caught by gesture ===============================================================
The following _CastError was thrown while handling a gesture:
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 ExtensionDialog.dialog (package:get/get_navigation/src/extension_navigation.dart:81:54)
#1 _MapScreenState.build.<anonymous closure>.<anonymous closure> (package:g_map/map_screen.dart:48:36)
#2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
#3 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:608:11)
#4 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296:5)
#5 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:230:7)
#6 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:563:9)
#7 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:94:12)
#8 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:139:9)
#9 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:539:8)
#10 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:137:18)
#11 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:123:7)
#12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:439:19)
#13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:419:22)
#14 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:322:11)
#15 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
#16 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
#17 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
#18 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
#22 _invoke1 (dart:ui/hooks.dart:170:10)
#23 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
#24 _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
(elided 3 frames from dart:async)
Handler: "onTap"
Recognizer: TapGestureRecognizer#788e4
debugOwner: GestureDetector
state: possible
won arena
finalPosition: Offset(115.0, 319.0)
finalLocalPosition: Offset(105.0, 16.0)
button: 1
sent tap down
The above error happens when you try to use Get.dialogue() from Getx package. Specially when you try. to use onTap() and Get.dialogue() together.
Reason
You did not wrap your app using GetMaterialApp. See the code below
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
Get.put(LocationController());
return const GetMaterialApp(
debugShowCheckedModeBanner: false,
home: MapScreen()
);
}
}