Skip to content

Flutter 处理PageView嵌套滚动工具 ( Flutter handles pageview nested scrolling tools )

Notifications You must be signed in to change notification settings

ailiwean/nested-scroll-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter嵌套PageView处理工具

google账号出问题暂时没法传到pub

效果

https://sm.ms/image/ALkGopHNK2M9Ttg

使用

外层PageView使用NestPageHelperParent 包裹并传入pageController, 内层ScrollView使用NestPageHelperChild包裹, 理论上可以多层包裹嵌套。

    return NestPageHelperParent(
        child: PageView.builder(
            itemCount: 5,
            controller: pageController,
            itemBuilder: (context, index) {
              //嵌套PageView
              if (index == 3)
                return NestPageHelperChild(
                    child: PageView.builder(
                        itemCount: 5,
                        itemBuilder: (_, index) {
                          return Center(
                            child: Text("内部" + index.toString()),
                          );
                        }));
              return Center(
                child: Text(index.toString()),
              );
            }),
        pageController: pageController);

About

Flutter 处理PageView嵌套滚动工具 ( Flutter handles pageview nested scrolling tools )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published