listview bottom element flutter code example

Example 1: how to scroll to a position in flutter listview

ItemScrollController _scrollController = ItemScrollController();

ScrollablePositionedList.builder(
  itemScrollController: _scrollController,
  itemCount: _myList.length,
  itemBuilder: (context, index) {
    return _myList[index];
  },
)

_scrollController.scrollTo(index: 150, duration: Duration(seconds: 1));

Example 2: how to give bottom padding in Listview in flutter

// Add a bottom padding to Listview in Flutter
padding: const EdgeInsets.only(bottom: kFloatingActionButtonMargin + 48)

Tags:

Dart Example