Skip to content

Pausing at breakpoint shows variables that have not yet been instantiated (patterns) #2060

@elliette

Description

@elliette

I have a Flutter app with the following code:

final myRecord =
    ('John', language: 'English', 3, age: 20, pets: {'dog': 'Prismo'});
final mySet = {1, 2, 3, 4};
final myList = [1, 2, 3];
final [a, b, c] = myList;
final myMap = {'first': 1, 'second': 2};
final {'first': first, 'second': second} = myMap;
const third = 3;
print(first + second + third + a + b + c);

From Flutter DevTools, I set a breakpoint on the line final myMap = {'first': 1, 'second': 2};.

Screenshot 2023-03-30 at 10 39 51 AM

When running the app as a chrome app, I see the following:

Screenshot 2023-03-30 at 10 40 02 AM

Notice that myMap, first, and second are all null. Arguably myMap being null makes sense, but I wouldn't expect to see first and second.

When running the app as a macos app, I see the following:

Screenshot 2023-03-30 at 10 42 17 AM

In this case, there is no myMap, first, nor second. This is what I would expect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions