0

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

GnRSlashSP
  • 545
  • 1
  • 5
  • 10
  • hello, when you scroll down to last row of table, are you calling api to get more data or you are getting all your data in one go? – BlazingRSj Nov 17 '22 at 19:36
  • I am working with small tables, so I am reading all data – GnRSlashSP Nov 17 '22 at 20:08
  • I'd recommend using the [SliverList](https://api.flutter.dev/flutter/widgets/SliverList-class.html) Widget. Here is a good set of resources on how to implement: [Using slivers to achieve fancy scrolling](https://docs.flutter.dev/development/ui/advanced/slivers) – Jared Anderton Nov 17 '22 at 23:46
  • @GnRSlashSP right now i am stumped here, whenever you find a solution or a workaround, pls post it here. – BlazingRSj Nov 21 '22 at 18:15
  • no luck here buddy.. sorry.... SingleChildScrollView or CustomScrollView with Slivers aren't working for me if I didn't specify the height before de scroll declaration.... I am stuck yet – GnRSlashSP Nov 21 '22 at 23:31
  • I'm sharing the link of this code. I really need to keep the AppBar area, the dropdown with checkboxes and buttons area, the table header and the crollable contents, but the only way to scroll without errors is to fix the size of scrollable area (but I don't want it fixed...can scroll do auto height?) https://flutlab.io/editor/0b329333-cacb-4903-89bb-053c51a18bd9 – GnRSlashSP Nov 22 '22 at 13:22

1 Answers1

0

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

GnRSlashSP
  • 545
  • 1
  • 5
  • 10