Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

two listtView are overlapping on same screen

I have two listView and they are overlapping on same screen.I have tried with singleChildScrollView also.
How to solve this issue and thanks in advance.
The code

    Widget build(BuildContext context) {
        return Scaffold(
          body: Stack(
            children: [
              if(submittedComment.isNotEmpty)...[
                ListView.builder(itemCount: submittedComment.length,shrinkWrap: true, scrollDirection: Axis.vertical, itemBuilder: (context,index){
               return Container(
                    width: MediaQuery.of(context).size.width-150,
                    child: Card(
                      child: Row(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children:[]
                          )
                        )
                      )
                   });
              ],
ListView.builder(
            itemCount: widget.snapshot.comments.length,
            scrollDirection: Axis.vertical,
            padding: EdgeInsets.only(bottom: 20),
            itemBuilder: (context, j) {
              return Container(
                width: MediaQuery.of(context).size.width-150,
              
                child: Card(
                  child: Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: []
                   )
                 )
                 );
              })

)
)
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Change Stack to Column. And put in to ListViews physics: NeverScrollableScrollPhysics(). Then Wrap Column with SingleChildScrollView().

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading