isAlwaysShown property

bool isAlwaysShown

Indicates whether the Scrollbar should always be visible.

When false, the scrollbar will be shown during scrolling and will fade out otherwise.

When true, the scrollbar will always be visible and never fade out.

The controller property must be set in this case. It should be passed the relevant Scrollable's ScrollController.

Defaults to false.


final ScrollController _controllerOne = ScrollController();
final ScrollController _controllerTwo = ScrollController();

build(BuildContext context) { return Column( children: <Widget> Container( height: 200, child: Scrollbar( isAlwaysShown: true, controller: _controllerOne, child: ListView.builder( controller: _controllerOne, itemCount: 120, itemBuilder: (BuildContext context, int index) =&gt; Text(&#39;item $index&#39;), ), ), ), Container( height: 200, child: CupertinoScrollbar( isAlwaysShown: true, controller: _controllerTwo, child: SingleChildScrollView( controller: _controllerTwo, child: SizedBox(height: 2000, width: 500,), ), ), ), , ); }



final bool isAlwaysShown