Commit 41b1aea
authored
fixes [`Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered](flutter#143881)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@OverRide
Widget build(BuildContext context) {
final ScrollController scrollController = ScrollController();
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Material(
child: ScrollConfiguration(
behavior: const NoScrollbarBehavior(),
child: ScrollbarTheme(
data: ScrollbarThemeData(
thickness: MaterialStateProperty.all(25.0),
showTrackOnHover: true,
),
child: Scrollbar(
thickness: 50.0,
thumbVisibility: true,
radius: const Radius.circular(3.0),
controller: scrollController,
child: SingleChildScrollView(
controller: scrollController,
child: const SizedBox(width: 4000.0, height: 4000.0),
),
),
),
),
),
);
}
}
class NoScrollbarBehavior extends ScrollBehavior {
const NoScrollbarBehavior();
@OverRide
Widget buildScrollbar(
BuildContext context, Widget child, ScrollableDetails details) =>
child;
}
```
</details>
### Preview
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/3537d60d-a5b2-488d-aa99-4c36c3721657" /> | <img src="https://github.com/flutter/flutter/assets/48603081/cfd02095-a327-4b16-8ece-0d1c9e6813ce" /> |
1 parent f58f108 commit 41b1aea
File tree
2 files changed
+11
-9
lines changed- packages/flutter
- lib/src/material
- test/material
2 files changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
| 330 | + | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| |||
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
397 | | - | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
404 | | - | |
| 405 | + | |
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| |||
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
413 | | - | |
| 414 | + | |
414 | 415 | | |
415 | 416 | | |
416 | 417 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
426 | | - | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
436 | | - | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
441 | | - | |
| 441 | + | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
447 | | - | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
| |||
0 commit comments