DraggableScrollableSheet does not prevent pointer hover events from passing through.
Steps to Reproduce
main.dart
A UI that stacks a DraggableScrollableSheet on top of the page content.
also includes an example of a workaround
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(title: 'Flutter dss-hover-pass-through bug', home: MyHomePage());
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Scaffold(
appBar: AppBar(
title: Text('DraggableScrollableSheet hover-pass-through bug'),
actions: <Widget>[
IconButton(
icon: Icon(Icons.info), tooltip: "Action tooltip", onPressed: () {}),
],
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'The button below and the appbar action above should not receive hover events when covered by the DraggableScrollableSheet.'
' To demonstrate, drag the red sheet over the buttons and mouse over them. The tooltips will display when they should not.'
' The blue sheet implements a workaround by wrapping its content with a MouseRegion widget.',
),
),
Tooltip(
message: 'Button tooltip',
child: RaisedButton(child: Text('Button'), onPressed: () {}),
),
],
),
),
),
// A sheet through which the hover events will pass-through.
DraggableScrollableSheet(
initialChildSize: .2,
maxChildSize: 1,
minChildSize: .2,
builder: (BuildContext _, ScrollController sc) {
return Card(
color: Colors.red[100],
child: SingleChildScrollView(
controller: sc,
child: Center(child: Text("DraggableScrollableSheet")),
),
);
},
),
// A sheet with a workaround for the bug.
DraggableScrollableSheet(
initialChildSize: .1,
maxChildSize: 1,
minChildSize: .1,
builder: (BuildContext _, ScrollController sc) {
return MouseRegion(
child: Card(
color: Colors.lightBlue[100],
child: SingleChildScrollView(
controller: sc,
child: Center(child: Text("DraggableScrollableSheet with workaround")),
),
),
);
},
),
],
);
}
}
Expected results:
The content hidden by the DraggableScrollableSheet to not react to mouse hover events.
Actual results:
Tooltips triggered by mouse hover events are shown for content hidden by the DraggableScrollableSheet.
DraggableScrollableSheet does not prevent pointer hover events from passing through.
Steps to Reproduce
main.dart
A UI that stacks a DraggableScrollableSheet on top of the page content.
also includes an example of a workaround
Expected results:
The content hidden by the DraggableScrollableSheet to not react to mouse hover events.
Actual results:
Tooltips triggered by mouse hover events are shown for content hidden by the DraggableScrollableSheet.