Skip to content

Incorrect use of ParentDataWidget. #59530

Closed
@devisdee

Description

@devisdee

The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.

The ParentDataWidget Positioned(left: 8.0, top: 9.0) wants to apply ParentData of type StackParentData to a RenderObject, which has been set up to accept ParentData of incompatible type BoxParentData.

Usually, this means that the Positioned widget has the wrong ancestor RenderObjectWidget. Typically, Positioned widgets are placed directly inside Stack widgets.
The offending Positioned is currently placed inside a Padding widget.

The ownership chain for the RenderObject that received the incompatible parent data was:
ConstrainedBox ← Container ← AnimatedContainer ← CircleAvatar ← Positioned ← Padding ← Stack ← Row ← ConstrainedBox ← Container ← ⋯
When the exception was thrown, this was the stack:
#0 RenderObjectElement._updateParentData. (package:flutter/src/widgets/framework.dart:5645:11)
#1 RenderObjectElement._updateParentData (package:flutter/src/widgets/framework.dart:5661:6)
#2 RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:5682:7)
#3 RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5376:5)
#4 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5829:11)
...
Untitled-2.txt

Activity

TahaTesser

TahaTesser commented on Jun 16, 2020

@TahaTesser
Member

Hi @devisdee
Looks like an issue with your code
This platform is not meant for assistance on personal code.
Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

github-actions

github-actions commented on Aug 20, 2021

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked as resolved and limited conversation to collaborators on Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @devisdee@TahaTesser

        Issue actions

          Incorrect use of ParentDataWidget. · Issue #59530 · flutter/flutter