I can see the scrollbar in the ListView, and I can scroll the ListView. But the problem is that I can not use/drag the scrollbar to scroll the ListView. It just appears as an indicator and doesn't respond touches/gestures.
Is this the expected behavior of the ScrollBar or am I doing something wrong? If so, how can I achieve that natively (without using a package, or do I have to)?
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final ScrollController _scrollController = ScrollController();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Scrollbar(
isAlwaysShown: true,
controller: _scrollController,
child: ListView.builder(
controller: _scrollController,
itemCount: 100,
itemBuilder: (context, index) {
return Card(
child: ListTile(
title: Text("Item: ${index + 1}"),
));
}),
),
),
),
);
}
}
GestureDetector
) if you want to simulate an interactive scroll bar. – Reposeful