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
如下demo,搭配 AnimatedList,EasyRefresh 在执行刷新动画时点击按钮,完成刷新后,无法上弹:
void main() { runApp(const MyHome()); } class MyHome extends StatelessWidget { const MyHome({super.key}); @override Widget build(BuildContext context) { return const MaterialApp( home: Scaffold( body: SafeArea(child: MyBody2()), ), ); } } class MyBody2 extends StatelessWidget { const MyBody2({super.key}); @override Widget build(BuildContext context) { final animatedListKey = GlobalKey<AnimatedListState>(); final data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; return EasyRefresh( child: CustomScrollView( physics: const AlwaysScrollableScrollPhysics(), slivers: [ SliverToBoxAdapter( child: SizedBox( height: 500, child: AnimatedList( key: animatedListKey, shrinkWrap: true, scrollDirection: Axis.vertical, initialItemCount: data.length, itemBuilder: (context, index, animation) { return FadeTransition( opacity: animation .drive(CurveTween(curve: Curves.easeIn)) .drive(Tween<double>(begin: 0, end: 1)), child: SizedBox( height: 100, child: Text(key: ObjectKey(index), 'data ${data[index]}'), ), ); }, ), ), ), SliverToBoxAdapter( child: Row( mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( onPressed: () { /// 点击循环列表 final index = data.length - 1; final item = data[index]; animatedListKey.currentState?.removeItem(index, (context, animation) { return const SizedBox.shrink(); }); data ..removeAt(index) ..insert(0, item); animatedListKey.currentState?.insertItem(0); }, child: const Text('loop'), ), ], ), ) ], ), onRefresh: () { }, ); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如下demo,搭配 AnimatedList,EasyRefresh 在执行刷新动画时点击按钮,完成刷新后,无法上弹:
The text was updated successfully, but these errors were encountered: