Skip to content

Improve docs for debugDoingThisLayoutWithCallback #128913

Description

@Piinks

Came up in #128910

This part of the API was added in #74402 and could use more context as to what it means. The PR that added it stated the EditableTextState will access RenderBox.size during rebuilding but it is not clear whether it strictly means rebuild is happening.

From @matthew-carroll #128910 (comment)

invokeLayoutCallback is quite a bit more diverse than just the concept of "rebuild", I believe.

invokeLayoutCallback may run by a RenderObject any number of times within that RenderObject's layout() behavior. Inside of that callback, you're permitted to mutate the element and render tree during layout, which is otherwise prohibited.

The double and triple negatives are throwing me, so I still can't tell the intention. It looks like if we're in a layout callback, we don't bother checking any conditions? We let the size access go through no matter what? This is the kind of stuff I was trying to improve. The intention of these conditions is really hard to figure out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions