Unhandled Exception: Null check operator used on a null value
Hi, I am getting the below error while initializing the time zone in main method.
Error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
E/flutter (23742): #0 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:121:86)
E/flutter (23742): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:146:36)
E/flutter (23742): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (23742): #3 FlutterNativeTimezone.getLocalTimezone (package:flutter_native_timezone/flutter_native_timezone.dart:17:24)
E/flutter (23742): #4 configureLocalTimeZone (package:myapp/main.dart:48:60)
E/flutter (23742): #5 main (package:lotusfeet/main.dart:16:9)
E/flutter (23742): #6 _runMainZoned.
Please look into it. Regards, Shyam
Same issue, for iOS and Android, FlutterNativeTimezone.getLocalTimezone() always returns Null... (solved) I had called it too early in the app life cycle.