Questions tagged [scrollcontroller]

55 questions
5
votes
1 answer

Safe usage for useScrollController? (Flutter Hooks)

Would the following code be considered safe? class SomeWidget extends HookWidget { @override Widget build(BuildContext context) { final controller = useScrollController(); controller.addListener(_someCallback); return ...; …
Ferdz
  • 59
  • 1
  • 5
4
votes
0 answers

How possible to keep scroll position in CustomScrollView

I have a StatelessWidget class MessagePage extends StatelessWidget { MessageProvider provider; ScrollController _scrollController = ScrollController(); MessagePage() { _scrollController.addListener(() { if…
Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149
3
votes
0 answers

How to set an initialOffset to linked ScrollControllers (aka LinkedScrollControllerGroup)

I'm using this great package https://pub.dev/packages/linked_scroll_controller , and following this amazing tutorial on how to set up bidirectional scrolling table :…
Jerbs
  • 131
  • 1
  • 8
3
votes
2 answers

How to Automatically Scroll down when expanding ExpansionTile

I am making my first Flutter App; enjoying it thus far. One annoying thing that I can not quite put my finger on, is that I have some ExpandedTiles, like so: However, when the tile is expanded, the screen stays in the same position; like so: What…
John
  • 107
  • 1
  • 10
2
votes
2 answers

SingleChildScrollView + Controller - Page resets to top when resizing window

I am creating a flutter Web application, but have issues when resizing the window with a SingleChildScrollView + ScrollController. When I resize the browser window, the page "snaps" back up to the very top. Being a web app, most of the page…
FoxDonut
  • 252
  • 2
  • 14
2
votes
2 answers

How best to make my scroll controllers available throughout the app?

Context: I'll be having a couple of scrollable lists in my app and I always want to scroll them to the latest item whenever an item is added. Problem: My ListView.builders and the places where items are added are going to be quite far apart in my…
Joe
  • 311
  • 3
  • 17
2
votes
1 answer

How to push content up when focus is on TextField and keyboard opens in Flutter?

I need to push my content up when the focus is on 'Description' TextField and the keyboard opens Without keyboard: Actual result Expected result ListView( children: [ Column( mainAxisAlignment:…
2
votes
0 answers

How can I give smooth transition to previous and next screen while scrolling in a PageView builder in flutter using viewport and scrollcontroller?

I am using PageView.builder and gradually increasing the viewportFraction after detecting scroll from _scrollController. video demonstrating the same I want the left and right screen elements to fade away in a smoother manner, as we scroll downwards…
2
votes
2 answers

Flutter Linuix & Mac OS & Web: The provided ScrollController is currently attached to more than one ScrollPosition

I used Flutter Linuix: I had a few basic children that need to scroll a little bit so I needed a listview to enable scrolling and got this exception a smple code like this: ListView( children: [ Text( 'data', style:…
Abdelrahman Tareq
  • 1,874
  • 3
  • 17
  • 32
2
votes
1 answer

Flutter Detect if user is scrolling

I am using ClickableListWheelView and I would like to add a notification to it, so I can check when the user starts/stops scrolling. For that I tried this inside _ClickableListWheelScrollViewState's init : Got it from:…
Chris
  • 1,828
  • 6
  • 40
  • 108
2
votes
1 answer

Nested ListView with ScrollController Not Scrolling

I am building a widget with a custom navigation bar which includes a Stack with the main body and the navigation bar. @override Widget build(BuildContext context) { return Stack( children: [ _buildBody(), …
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
1
vote
2 answers

ScrollController attached to multiple scroll views on flutter

Im using the Class PageController to navigate between pages in the app, it was working when i set it up for the first time, so then it stoped to work This is the base screen, were the pagecontroller is called: import…
1
vote
0 answers

"scrollViewWillEndDragging" equivalent in Flutter

In Swift/UIKit, we have the scrollViewWillEndDragging(_:withVelocity:targetContentOffset:) API. This API gets called when the user finish their drag, as the title suggests, and allows us to set the target offset. It is useful to disallow scrolling…
Daisy the cat
  • 372
  • 3
  • 11
1
vote
2 answers

How to scroll GridView with page

I have a gridview builder like this and in this gridview builder im scrolling posts with page; GridView.builder( physics: ScrollPhysics(), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, ), itemCount:…
Rkdio
  • 153
  • 2
  • 13
1
vote
0 answers

Can ensureVisible be triggered with an offset in flutter?

I have a GlobalKey set on an item in my listview, which I automatically scroll to using ensurevisible await _scrollController!.position.ensureVisible( _scrollToThisKey.currentContext!.findRenderObject()!, alignment: 0.0, duration: const…
Mark
  • 3,653
  • 10
  • 30
  • 62
1
2 3 4