0

Expected result

I used SingleChildScrollView to make it scrollable but if the device size is big, there are empty spaces on the side. SingleChildScrollView How can I remove this that the content will stretch inside?

If I remove the SingleChildScrollView it will stretch and fit well, but if the screen is small it will not be scrollable and it overflows the table. Without scrollview

I even tried using the fitted box, it stretches but it will be too big if the content of the table is just a few. FittedBox 1 FittedBox 2

SingleChildScrollView(
                    scrollDirection: Axis.vertical,
                    child: SingleChildScrollView(
                      scrollDirection: Axis.horizontal,
                      child: DataTable(),
                    ),
                  ),
A_Bee
  • 101
  • 2
  • 9

1 Answers1

-1

Open DataTable (data_table.dart) class and search for _horizontalMargin, Make it 0.0. _horizontalMargin=0.0

  • this did not work. it removed the margin on the left but the big space on the right is still there because of the singlescrollview shrinkwrap, how can I expand it out? – A_Bee May 18 '21 at 08:23