I recently migrated my app to Flutter 2.0 which contains Null safety. After successful migration, when I run the app, I get the following error
The following _CastError was thrown building ContactListWidget(dirty, dependencies: [MediaQuery, _InheritedProviderScope], state: _ContactListWidgetState#9ca7f)
The error mentions no line number where the error is getting thrown, the code is approximately 500 lines :/
How do I fix this issue? Is it related to Firebase queries/data?
EDIT
I was able to locate the erroneous line, and it seems like a problem with the usage of ?
and !
. Can anyone direct to a resource where it is easy to understand null safety? Thanks