Skip to content

Instantly share code, notes, and snippets.

@sabetAI
Created March 6, 2021 20:18
Show Gist options
  • Save sabetAI/24786735b34f4090992ccbe0d8ceb7ac to your computer and use it in GitHub Desktop.
Save sabetAI/24786735b34f4090992ccbe0d8ceb7ac to your computer and use it in GitHub Desktop.
IgnorePointer works with Stacked AppBars
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: Stack(
children: [
IgnorePointer(
child: Container(
height: 50,
child: AppBar(
actions: [
IconButton(
icon: Icon(Icons.radio_button_checked),
onPressed: () {
print('OVER');
})
],
),
),
),
Container(
height: 50,
child: AppBar(
actions: [
IconButton(
icon: Icon(Icons.radio_button_checked),
onPressed: () {
print('UNDER');
})
],
),
),
],
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment