Closed
Description
Code
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
scrollBehavior: MyScrollBehavior(),
home: Scaffold(
body: Center(
child: SizedBox(
width: 200,
height: 200,
child: Scrollbar(
// interactive: false,
thumbVisibility: true,
trackVisibility: true,
child: SingleChildScrollView(
child: GestureDetector(
onTap: () => print('onTap'),
child: const FlutterLogo(
size: 300,
),
),
),
),
),
),
),
);
}
}
class MyScrollBehavior extends ScrollBehavior {
@override
Widget buildScrollbar(BuildContext context, Widget child, ScrollableDetails details) {
return child;
}
}
Expect
Do not output onTap
log if tap the track rectangle area.
Actual
Output onTap
log if tap on the scrollbar track area.