Repository navigation
Scrollbar margins are handled inconsistently #106918
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: qualityA truly polished experienceA truly polished experiencef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
crossAxisMargin is applied to the thumb and consumed by the track.
mainAxisMargin is applied to both the track and the thumb.
I think the mainAxisMargin should apply to the thumb and be consumed by the track like in the cross axis.
Fix incoming.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
scrollBehavior: MaterialScrollBehavior().copyWith(scrollbars: false),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: RawScrollbar(
mainAxisMargin: 5,
crossAxisMargin: 5,
trackVisibility: true,
thumbVisibility: true,
thickness: 20,
thumbColor: Colors.red,
trackColor: Colors.blue,
trackBorderColor: Colors.orange,
child: Column(
children: [
Center(
child: SizedBox(
height: 500,
child: CustomScrollView(
primary: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(c, i) => Container(height: 50, child: Center(child: Text('Item $i'))),
childCount: 50,
),
)
]
),
),
),
Container(height: 20, color: Colors.green)
],
),
),
);
}
}
The track color issue here is separate. (#106917)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work lista: qualityA truly polished experienceA truly polished experiencef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight

Activity
github-actions commentedon Aug 8, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.