Tariq Jamal A
Tariq Jamal A

Reputation: 87

throw FlutterError.fromParts(<DiagnosticsNode>

NetworkHandler networkHandler = NetworkHandler();
  ProfileModel profileModel = ProfileModel();
  TextEditingController _nameController = TextEditingController();

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    fetchData();
  }

  fetchData() async {
    var response = await networkHandler.get("/auth/profile/");
    print(response);
  }

Can anyone help to solve this problem

The following assertion was thrown while applying parent data.: Incorrect use of ParentDataWidget. The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData. Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets. The offending Expanded is currently placed inside a _SingleChildViewport widget. The ownership chain for the RenderObject that received the incompatible parent data was: Column ← Expanded ← _SingleChildViewport ← IgnorePointer-[GlobalKey#9f26d] ← Semantics ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey#ef0fb] ← Listener ← _ScrollableScope ← ⋯ When the exception was thrown, this was the stack:

Upvotes: 0

Views: 405

Answers (1)

Frankdroid7
Frankdroid7

Reputation: 243

You most probably have Expanded as a child of a widget which is neither a Row, Column or Flex. Place your Expanded widget only as a direct child of a Row, Column or Flex. That should solve your issue.

Upvotes: 0

Related Questions