我在列表视图下面有一个网格视图,但是当我滚动网格视图时,我希望它占据整个页面。我在网格视图的顶部有一个listView,所以当我滚动时,列表视图并没有被隐藏,我只能滚动网格视图。我试图在堆栈中调用它们,但它覆盖了我的整个屏幕,一切都一片空白。
希望能达到类似的目的。
https://i.stack.imgur.com/JDQLS.jpg
class _GameScreenState extends State<GameScreen> {
CategoryType categoryType = CategoryType.ui;
Animation<double> topBarAnimation;
@override
Widget build(BuildContext context) {
return Material(
child: Container(
color: DesignCourseAppTheme.nearlyWhite,
child: PageView(
physics: const BouncingScrollPhysics(),
scrollDirection: Axis.vertical,
children: [
Scaffold(
bottomNavigationBar: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
const Color(0xFFFEFEFE),
const Color(0xFFFEFEFE)
],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
// stops: [0.0, 0.1],
),
),
child: BottomBar()),
backgroundColor: DesignCourseAppTheme.nearlyWhite,
body: Container(
child: Column(
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).padding.top,
),
getAppBarUI(),
Expanded(
child: Stack(
children: [
Container(
height: MediaQuery.of(context).size.height,
child: Column(
children: <Widget>[
getCategoryUI(),//**THIS CALLS MY LISTVIEW**
Flexible(
child: getPopularCourseUI(),//***THIS CALLS MY GRIDVIEW***
),
],
),
),
],
),
),
],
),
),
),
],
),
),
);
}