Created
December 30, 2020 16:48
-
-
Save littleironical/5230f7120d0f91c25b3da9f939cf96cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create "ScrollController" | |
final ScrollController scrollController = ScrollController(); | |
// Add "scrollController" to "controller" property inside Scroll widget | |
controller: scrollController, | |
// Now implement scrolling function | |
void onTap(){ | |
scrollController.animateTo(0, duration: Duration(seconds: 2), curve: Curves.easeInOut); | |
// 0 is the offset | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment