sliding_up_panel
sliding_up_panel copied to clipboard
Collapsed widget still blocks touch events for panel with AppBar
Describe the bug
If the collapsed widget for SlidingUpPanel is an AppBar with pressable buttons, the collapsed AppBar buttons still trigger instead of the raised AppBar buttons. For some reason IgnorePointer isn't working on your implementation?
To Reproduce
- Run example code.
- onPressed triggers for
IconButtonin collapsed widget, not panel widget.
Expected behavior
The buttons for the AppBar in the panel should trigger instead of the collapsed AppBar
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: An
- Flutter Version: Channel master, 2.1.0-11.0.pre.13
- sliding_up_panel: 1.0.2
Sample main.dart
import 'package:flutter/material.dart';
import 'package:sliding_up_panel/sliding_up_panel.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Test'),
),
bottomNavigationBar: SlidingUpPanel(
minHeight: 45,
maxHeight: 450,
collapsed: AppBar(
title: Text(
'Collapsed',
style: TextStyle(
color: Colors.black87,
fontWeight: FontWeight.bold,
fontSize: 16),
),
leading: IconButton(
icon: Icon(
Icons.sort,
color: Colors.black,
),
onPressed: () {},
),
actions: [
IconButton(
icon: Icon(
Icons.search_off_outlined,
color: Colors.black,
),
onPressed: () {
print('COLLAPSE');
},
)
]),
panel: Container(height: 450, child: RaisedAppBar())),
);
}
}
class RaisedAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppBar(
title: Text(
'Raised',
style: TextStyle(
color: Colors.black87, fontWeight: FontWeight.bold, fontSize: 16),
),
leading: IconButton(
icon: Icon(
Icons.sort,
color: Colors.black,
),
onPressed: () {},
),
actions: [
IconButton(
icon: Icon(
Icons.search_off_outlined,
color: Colors.black,
),
onPressed: () {
print('RAISE');
},
)
]);
}
}
IgnorePointer works when wrapped around an AppBar stacked on another AppBar (gist), so not sure what the problem is.
I'm experiencing this as well without an AppBar. No matter what, the collapsed widget, even when hidden will block touches. I can verify this with the widget inspector showing the boundaries of the collapsed widget. This makes the collapsed widget impossible to use if I have stuff sitting behind the hidden collapsed. Major problem. @akshathjain @uintdev @s0nerik