最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

dart - Achive infinite animation in flutter for prompts - Stack Overflow

programmeradmin3浏览0评论

I am building a three-row prompt slider in Flutter that needs to scroll both automatically and manually. I'm having trouble implementing the infinite scrolling behavior.

I tried using PageView with a custom controller, but I couldn't get the infinite loop effect. I also tried using AnimationController, but the animation wasn't smooth

I am building a three-row prompt slider in Flutter that needs to scroll both automatically and manually. I'm having trouble implementing the infinite scrolling behavior.

I tried using PageView with a custom controller, but I couldn't get the infinite loop effect. I also tried using AnimationController, but the animation wasn't smooth

Share Improve this question asked Mar 11 at 9:38 Hardik MehtaHardik Mehta 2,4531 gold badge13 silver badges22 bronze badges 3
  • 1 post your PageView code then, how did you use its PageController? – pskink Commented Mar 11 at 10:03
  • Tried and removed, but its not looking this way. Can you please help me with any other solution – Hardik Mehta Commented Mar 11 at 10:09
  • Try to use pub.dev/packages/marquee package. – DroidFlutter Commented Mar 11 at 10:19
Add a comment  | 

1 Answer 1

Reset to default 2

Try this code I tried to implement it with ListView this is the code:

class SmoothInfiniteSlider extends StatefulWidget {
  const SmoothInfiniteSlider({super.key});

  @override
  State<SmoothInfiniteSlider> createState() => _SmoothInfiniteSliderState();
}

class _SmoothInfiniteSliderState extends State<SmoothInfiniteSlider> {
  final ScrollController _scrollController = ScrollController();
  Timer? _autoScrollTimer;
  bool _isUserInteracting = false;

  List<String> items = [
    "
发布评论

评论列表(0)

  1. 暂无评论