diff --git a/lib/pages/category_page/category_page.dart b/lib/pages/category_page/category_page.dart index b9fde96..f2bbf91 100644 --- a/lib/pages/category_page/category_page.dart +++ b/lib/pages/category_page/category_page.dart @@ -106,11 +106,12 @@ class _CategoryPageState extends State { } _leftAnimateToIndex(int index) { - setState(() { - _selectedCategory = _categorys[index]; - }); - _scrollController.animateTo(index * 60.0, - duration: Duration(milliseconds: 200), curve: Curves.ease); + if (_selectedCategory['index'] != index) { + setState(() { + _selectedCategory = _categorys[index]; + }); + _scrollController.position.moveTo(index * 60.0); + } } _rightAnimateToIndex(f) {