Я попытался использовать SingleChildScrollView с установкой дочернего столбца с помощью MainAxisSize.min, но не смог найти РАБОЧИЙ ответ. Вот как выглядит мое дерево виджетов:
Scaffold
Stack
Column
Row
SizedBox
FutureBuilder
SizedBox
SingleChildScrollView
ListView.separated (physics: NeverScrollableScrollPhysics())
Container
Вот ресурсы, которые я просмотрел:
- https://www.reddit.com/r/Flutter/comments/e93ujx/how_to_make_whole_screen_scrollable_with/
- Flutter ListView Builder прокручивает весь экран
- https://medium.com/@rubensdemelo/flutter-forms-improving-ui-ux-with-singlechildscrollview-7b91aa981475
Полный код
Scaffold(
backgroundColor: Color(0xFF1C1C1C),
body: Stack(
children: [
Column(
children: [
getHeading(),
SizedBox( height: MediaQuery.of(context).size.height * (10/730) ),
FutureBuilder(
future: getContent(),
builder: (context, snapshot) {
if(snapshot.hasData) {
List feedList = snapshot.data;
return SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).size.height * 0.925,
child: SingleChildScrollView(
child: ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
// code for builder
},
separatorBuilder: (context, index) {
return SizedBox( height: MediaQuery.of(context).size.height * (32/730) );
},
itemCount: feedList.length
),
),
);
}
else {
return ErrorScreens().pageNotFound(context, 100, 1, 24);
}
}
)
],
),
Center(
child: Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.8),
child: BottomNav().primaryBottomNav(MediaQuery.of(context).size.width * 0.92, 90, context),
),
)
],
),
)
РЕДАКТИРОВАТЬ: Я думаю, что некоторые из вас не поняли, что я пытаюсь сделать. Итак, у меня есть два значка в верхней части экрана, которые действуют как заголовок, а под ним находится ListView, поэтому, когда пользователь прокручивает этот ListView, я хочу, чтобы весь экран прокручивался, пока это происходит.