Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

scroll to top flutter

final _scrollController = ScrollController();

scrollToTop() {
    Timer(
      Duration(seconds: 0), () => _scrollController.animateTo(0.0, curve: Curves.easeOut, duration: const Duration(milliseconds: 300)),
    );
  }
  
SingleChildScrollView(
  controller: _scrollController,
  child: addWidget(),
))
 
PREVIOUS NEXT
Tagged: #scroll #top #flutter
ADD COMMENT
Topic
Name
7+1 =