On the second page of our application, we have an infinite ListView.builder widget. In our case, the NestedScrollView is used to collapse the SliverAppBar which sits at the top of our application's viewport. This widget allows us to safely embed a scrolling widget into another scrolling widget and have the two widgets interact with one another. The ScrollController used in this application was mainly used to control the NestedScrollView Widget. Scrolling and Scrolling and Scrolling with Nested Scroll Views For the scrollController we have the option of setting up the initialScrollOffset which defines where controller will start at. For the TabController, we need to setup the vsync and the length. We use this function to instantiate the two controllers. In this image, you can see the initState for our main state object in this application. The controllers that we focus on in this tutorial are the TabController and the ScrollController. Controllers are objects that allow the developer to programmatically interact with the actions of widgets. Outline for this Tutorial Controlling Movement and Animations with ControllersĬontrollers are a central concept in the Flutter Framework and they are used in many design patterns in programming in general. We also look at the jumpTo and animateTo methods on the controllers and how they can automate the movement between tabs and the scrolling of views. We look at the SliverAppBar widget once again but this time we create our own scaffold with it. We also take a look at the NestedScrollView widget which allows us to safely embed multiple scrolling widgets into one another. In this Flutter Video Tutorial, we take a look at some of the more advanced concepts of the Scroll and Tab controller objects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |