[英]Flutter ListView with nested TabBarView
我正在嘗試布局我的顫振應用程序,使其看起來像:
-ListView
-WidgetA
-DefaultTabBarController
-Column
-TabBar
-Expanded
-TabBarView
-WidgetB
-WidgetC
這樣整個屏幕都是可以分解的,並且小部件A,B和C的內容可以改變,屏幕的高度也不固定。
我能夠讓這個工作的唯一方法是做一些事情:
-ListView
-WidgetA
-Container (with fixed height)
-Column
-Expanded
-DefaultTabBarController
-Column
-TabBar
-Expanded
-TabBarView
-WidgetB
-WidgetC
但我不想擁有硬編碼的高度。 有誰知道我怎么能做到這一點?
我遇到了同樣的問題,我認為我使用Flexible類而不是Column處於正確的軌道上。 https://docs.flutter.io/flutter/widgets/Flexible-class.html我也使用Slivers https://docs.flutter.io/flutter/widgets/SliverList-class.html和CustomScrollView而不是ListView https ://docs.flutter.io/flutter/widgets/CustomScrollView-class.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.