1
dashboardScreen() {
    return Scaffold(
        backgroundColor: Colors.white,
        body: Positioned(child:
        SingleChildScrollView(
          child: Positioned(child: Column(
              //margin: const EdgeInsets.fromLTRB(0, 40, 0, 30),
                children: persons.map((p) {
                  return personDetailCard(p);
                }).toList()
              ),
            ),
          ),
        ),
        );
  }

I'm getting this error how can i solve it?

The following assertion was thrown building AnimatedBuilder(animation: AnimationController#e4385(⏭ 1.000; paused), state: _AnimatedState#3a637): 'package:flutter/src/widgets/framework.dart': Failed assertion: line 4957 pos 16: 'child is! ParentDataElement': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was: Scaffold file:///C:/Users/Saffar%20Khan/Documents/GitHub/flutter_app_afs/afs_mobile_flutter/lib/dashboard_Receiver.dart:190:12 When the exception was thrown, this was the stack: #2 ParentDataElement._applyParentData.applyParentDataToChild (package:flutter/src/widgets/framework.dart:4957:16) #3 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4628:14) #4 ParentDataElement._applyParentData.applyParentDataToChild (package:flutter/src/widgets/framework.dart:4958:15) #5 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:4628:14) #6 ParentDataElement._applyParentData.applyParentDataToChild (package:flutter/src/widgets/framework.dart:4958:15)

1 Answer 1

2

As you're not using Stack, you must remove Positioned widget.

Try this tree:

Scaffold(
  backgroundColor: Colors.white,
  body: SingleChildScrollView(
    child: Column(
      //margin: const EdgeInsets.fromLTRB(0, 40, 0, 30),
      children: persons.map((p) {
        return personDetailCard(p);
      }).toList(),
    ),
  ),
)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.