fluttercommunity / fluttercommunity/flutter-draggable-scrollbar
Scrollbar not draggable for web.
- Dominant language
- Dart
- Stars
- 442
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
For flutter web, should it be possible to drag the scrollbar? When I mouse-down on it, the labelText is shown, but the tab cannot be dragged.
The code works as expected in the Android emulator (can drag the scrollbar).
```
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final scrollController = ScrollController();
Widget child = ListView.builder(
physics: ScrollPhysics(),
controller: scrollController,
itemCount: 500,
itemBuilder: rowContent,
);
if (true) {
// Add scrollbar
child = DraggableScrollbar.arrows(
controller: scrollController,
alwaysVisibleScrollThumb: true, //alwaysVisibleScrollThumb,
labelTextBuilder: (double offset) => Text("${offset ~/ 100}"),
child: child,
);
}
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'MyApp',
home: Container(
color: Colors.blue,
child: child));
}
}
final textStyle = TextStyle(
color: Colors.black,
decoration: TextDecoration.none,
fontSize: 12,
fontStyle: FontStyle.normal);
Widget rowContent(BuildContext context, int i, [int j = 0]) {
return Text(
"$i: $j: abcdef abcdef abcdef abcdef abcdef abcdef abcdef abcdef abcdef abcdef abcdef abcdef",
style: textStyle);
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.