-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When dragging the scroll bar thumb on Flutter Web while the cursor is already moving, the scrollbar thumb offset won't match the expected offset.
Example code:
import 'package:flexible_scrollbar/flexible_scrollbar.dart';
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomeScreen(),
);
}
}
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
final _scrollController = ScrollController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: FlexibleScrollbar(
controller: _scrollController,
alwaysVisible: true,
scrollThumbBuilder: (ScrollbarInfo info) {
return Container(
width: 50,
height: info.thumbMainAxisSize,
decoration: BoxDecoration(color: Colors.black),
);
},
child: ListView(
controller: _scrollController,
children: List.generate(
30,
(index) {
return ListTile(title: Text(index.toStringAsFixed(0)));
},
),
),
),
);
}
}Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.19045.4412], locale en-US)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
[✓] Android Studio (version 2020.3)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
flexible_scrollbar 0.1.3
2024-05-22.19-07-49.mp4
Metadata
Metadata
Assignees
Labels
No labels