Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect use of ParentDataWidget. #59530

Closed
devisdee opened this issue Jun 16, 2020 · 2 comments
Closed

Incorrect use of ParentDataWidget. #59530

devisdee opened this issue Jun 16, 2020 · 2 comments

Comments

@devisdee
Copy link

devisdee commented Jun 16, 2020

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

@TahaTesser
Copy link
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
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants