8

I'm trying to layout my flutter application so that it looks like:

-ListView
  -WidgetA
  -DefaultTabBarController
    -Column
      -TabBar
      -Expanded
        -TabBarView
          -WidgetB
          -WidgetC

So that the whole screen is scollable and that the contents of Widgets A, B, and C can change and the height of the screen is not fixed.

The only way I have been able to get this to work is by doing something like:

-ListView
  -WidgetA
  -Container (with fixed height)
    -Column
      -Expanded
        -DefaultTabBarController
          -Column
            -TabBar
            -Expanded
              -TabBarView
                -WidgetB
                -WidgetC

But I don't want to have a hardcoded height. Does anyone know how I can achieve this?

1 Answer 1

1

I've run into the same problem, I think I'm on the right track using Flexible class instead of Column. https://docs.flutter.io/flutter/widgets/Flexible-class.html I'm also using Slivers https://docs.flutter.io/flutter/widgets/SliverList-class.html with CustomScrollView instead of ListView https://docs.flutter.io/flutter/widgets/CustomScrollView-class.html

Sign up to request clarification or add additional context in comments.

2 Comments

so? Any solution?
@JoelHernandez unfortunately not, I abandoned this layout and opted to just take my users to a new view so I didn't have to worry about setting container heights.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.