We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我的場境: 假設現在是在第二分頁,下拉加載上一頁(第一頁),上拉加載下一頁(第三頁), 我找到教學是使用CustomScrollView -> center key 來做類似的效果
CustomScrollView -> center key
flutter/flutter#21541
根據上面的教學我嘗試使用flutter_easyrefresh 實現, 在example (https://github.com/xuelongqy/flutter_easyrefresh/blob/v2/example/lib/page/sample/swiper.dart), 在CustomScrollView 和 SliverList 加入 center key 會無法觸發onRefresh和無法顯示header
flutter_easyrefresh
https://github.com/xuelongqy/flutter_easyrefresh/blob/v2/example/lib/page/sample/swiper.dart
CustomScrollView
SliverList
class SwiperPageState extends State<SwiperPage> { // 条目总数 int _count = 20; @override Widget build(BuildContext context) { const Key centerKey = ValueKey('second-sliver-list'); // <----- return Scaffold( body: EasyRefresh.builder( builder: (context, physics, header, footer) { return CustomScrollView( center: centerKey, // <----- physics: physics, slivers: <Widget>[ SliverAppBar( expandedHeight: 100.0, pinned: true, backgroundColor: Colors.white, flexibleSpace: FlexibleSpaceBar( centerTitle: false, title: Text('Swiper'), ), ), header, SliverList( key: centerKey, // <----- delegate: SliverChildListDelegate([ Container( height: 210.0, ...
求指教!
The text was updated successfully, but these errors were encountered:
v3已发布,也许问题得到解决。如果问题依然存在,请重新打开
Sorry, something went wrong.
No branches or pull requests
我的場境:
假設現在是在第二分頁,下拉加載上一頁(第一頁),上拉加載下一頁(第三頁),
我找到教學是使用
CustomScrollView -> center key
來做類似的效果根據上面的教學我嘗試使用
flutter_easyrefresh
實現,在example (
https://github.com/xuelongqy/flutter_easyrefresh/blob/v2/example/lib/page/sample/swiper.dart
), 在CustomScrollView
和SliverList
加入 center key 會無法觸發onRefresh和無法顯示header正常情況
Screenrecorder-2021-04-20-23-07-35-203.mp4
加入centerKey 後
Screenrecorder-2021-04-20-23-08-06-917.mp4
求指教!
The text was updated successfully, but these errors were encountered: