-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
包裹在折叠控件中,刷新后会自动折叠 #133
Comments
代码详细点,smartrefresher还有child,还有nested里的_scrollController做了什么操作 |
NestedScrollView 放了 headerSliverBuilder SafeArea( ///smartrefresher 中放了ListView.builder , ///_scrollController 什么也没做。 因为,也就是说nested上有个head可以被折叠,滑动到顶部后显示, 使用smart之后没有滑动到顶部,直接折叠了head |
|
加了 scrollController 就会有问题 |
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: yello,
body: SafeArea(
child: NestedScrollView( //scrollview
controller: _scrollController,
headerSliverBuilder: (context, bool) { //头部折叠
return [
SliverAppBar(
expandedHeight: ScreenUtil.getInstance().setHeight(100),
pinned: false,
elevation: 0,
primary: false,
brightness: Brightness.light,
flexibleSpace: mySearch(),
// bottom: myTabBar(),
),
SliverPersistentHeader(
delegate: SliverTabBarDelegate(myTabBar(), color: Colors.white),
pinned: true,
floating: false,
),
];
},
刷新后,自动滑到顶部,折叠SliverAppBar
The text was updated successfully, but these errors were encountered: