Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I resolve 'Id does not exist' error?

Tags:

flutter

dart

So I am building a calculator with flutter and after changing some of my code, I have been getting this error whenever I hot restart, I get this error:

======== Exception caught by Flutter framework =====================================================
The following assertion was thrown during a service extension callback for "ext.flutter.inspector.setSelectionById":
Id does not exist.

When the exception was thrown, this was the stack: 
#0      WidgetInspectorService.toObject (package:flutter/src/widgets/widget_inspector.dart:1283:7)
#1      WidgetInspectorService.setSelectionById (package:flutter/src/widgets/widget_inspector.dart:1345:25)
#2      WidgetInspectorService._registerServiceExtensionWithArg.<anonymous closure> (package:flutter/src/widgets/widget_inspector.dart:864:35)
#3      WidgetInspectorService._registerServiceExtensionWithArg.<anonymous closure> (package:flutter/src/widgets/widget_inspector.dart:861:17)
#4      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:597:32)
...

====================================================================================================

I have no clue what the error means and I cant find and answer to it anywhere. The only thing I can infer is that it is possibly something with the inspector due to "ext.flutter.inspector.setSelectionById" but I honestly have no idea. I also believe it might not be to do with my code since it doesn't reference anything in there. I would extremely appreciate if anyone could at least help me understand the error. If you need more details, just ask me.

like image 659
LWB Avatar asked Apr 03 '21 15:04

LWB


2 Answers

The error was probably due to Flutter Dev Tools being open.

like image 170
user14624595 Avatar answered Oct 16 '22 15:10

user14624595


I got this error when I tried to show a CupertinoTimerPicker inside a SimpleDialog. I solved it by wrapping the CupertinoTimerPicker in a sized box with a defined height and width:

Center(
              child: SizedBox(
                height: 200,
                width: 200,
                child: CupertinoTimerPicker(
                  initialTimerDuration: tempDuration,
                  onTimerDurationChanged: (value) {
                    print(value.toString());
                    tempDuration = value;
                  },
                ),
              ),
            ),
like image 31
Joe Muller Avatar answered Oct 16 '22 13:10

Joe Muller