callback for "ext.flutter.inspector.getRootWidgetSummaryTree"

Viewed 3140

Today when I start the flutter 2.0.x app, shows error:

======== Exception caught by Flutter framework =====================================================
The following _CastError was thrown during a service extension callback for "ext.flutter.inspector.getRootWidgetSummaryTree":
Null check operator used on a null value

When the exception was thrown, this was the stack: 
#0      WidgetInspectorService._registerObjectGroupServiceExtension.<anonymous closure> (package:flutter/src/widgets/widget_inspector.dart:793:84)
#1      WidgetInspectorService._registerObjectGroupServiceExtension.<anonymous closure> (package:flutter/src/widgets/widget_inspector.dart:792:17)
#2      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:597:32)
<asynchronous suspension>
====================================================================================================

seems flutter framework error. why did this happen? any clue about this? is it possible to fix it or avoid this eror?

2 Answers

I faced the same problem (flutter 2.2.0). Looks like framework issue. Then I downgraded to Flutter 2.0.3 . Now it is working fine.

if you did upgrade from non null safety with the dart tool migration tool. This left behind a lot of null check operators and we must to clean the code carefully to prevent those errors. I suggest that you take the time and look for that null operators and make your code much efficients making null validations for yourself.

Related