开发者

Flutter PageView inside NestedScrollview requires fixed height

开发者 https://www.devze.com 2022-12-07 19:30 出处:网络
I use PageView inside NestedScrollView. On page in PageView I fetch data from server. But content inside pageview don\'t scrolling because I should wrap pageview with SizedBox with fixed height. How c

I use PageView inside NestedScrollView. On page in PageView I fetch data from server. But content inside pageview don't scrolling because I should wrap pageview with SizedBox with fixed height. How can I expand page for content?

on page #1:

NestedScrollView(
      key: _homeNestedKey,
      headerSliverBuilder: (context, innerBoxIsScrolled) {
        return <Widget>[
          SliverAppBar(
            ...
            bottom: CustomTabBar(
              items: tabItems,
              onChangedIndex: _onTabChan开发者_JS百科ged,
              chosenIndex: _chosenTabIndex,
            ),
          ),
        ];
      },
      body: SmartRefresher(
        ...
        onRefresh: _onRefresh,
        onLoading: _onLoading,
        child: PageView(
          onPageChanged: _onPageChanged,
          controller: _pageController,
          children: const [
            FeedContent(),
            PromotionsContent(),
            ShopContent(),
          ],
        ),
      ),
    ),

inside FeedContent:

ListView(
  shrinkWrap: true,
  physics: const NeverScrollableScrollPhysics(),
  children: [
    ...feed.map((f) => FeedItemCard(feedItem: f)),
    const SizedBox(height: 36),
    if (isLoading) const CustomLoader(),
    const SizedBox(height: 100),
  ],
);

Flutter PageView inside NestedScrollview requires fixed height

0

精彩评论

暂无评论...
验证码 换一张
取 消