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 Answer
Reset to default 2Try 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 = [
"
PageView
code then, how did you use itsPageController
? – pskink Commented Mar 11 at 10:03