GnRSlashSP
GnRSlashSP

Reputation: 574

Flutter Table with fixed Header and scrollable contents, no 3rd part lib

I don't want to use 3rd part, so I am trying to achieve something simple, just use SingleChildScroolView inside a Column, but it is not working.

The widgets that I have are these:

Scaffold
 Padding
  Column
   Obx
   Divider
   Obx
    Column
     Table  <---  This is the table header
     SizedBox
     Table   <---  I want to put SingleChildScrollView here to make this table scrollable

When I specify the height of the last table, it works, but I don't want to do it because it will be hardcoded and fixed... not good, like this:

SizebBox
 height: 300
 SingleChildScrollView
  Table

I tried this, but hangs:

Expanded
 SingleChildScroolView
  Table

How to solve this? What am I doing wrong? Can this be fixed? Thanks

Upvotes: 0

Views: 1121

Answers (1)

GnRSlashSP
GnRSlashSP

Reputation: 574

SOLVED.

Guys, I found the problem... I was trying to put SingleChildScrollView inside a Column, but this Column is inside another Column. AND THIS WAS THE PROBLEM (scrool inside a column that is inside another column)...

I change everything and now I am working with only ONE COLUMN, and SingleChildScrollView can work!

Follow the code: https://flutlab.io/editor/0b329333-cacb-4903-89bb-053c51a18bd9

Hope this can help someone else. Thank you all

Upvotes: 1

Related Questions