Ad

Flutter Linuix: The Provided ScrollController Is Currently Attached To More Than One ScrollPosition

- 1 answer

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: TextStyle(fontSize: 215),
    ),
    Text(
      'data',
      style: TextStyle(fontSize: 215),
    ),
    Text(
      'data',
      style: TextStyle(fontSize: 215),
    ),
  ],
)

The following assertion was thrown while notifying status listeners for AnimationController: The provided ScrollController is currently attached to more than one ScrollPosition.

Ad

Answer

The solution is simple just add controllor to the listveiw like this:

ListView(
      controller: ScrollController(),
  children: [
    Text(
      'data',
      style: TextStyle(fontSize: 215),
    ),
    Text(
      'data',
      style: TextStyle(fontSize: 215),
    ),
    Text(
      'data',
      style: TextStyle(fontSize: 215),
    ),
  ],
)

source:

https://github.com/flutter/flutter/issues/85456

Ad
source: stackoverflow.com
Ad