Created
March 6, 2021 20:18
-
-
Save sabetAI/24786735b34f4090992ccbe0d8ceb7ac to your computer and use it in GitHub Desktop.
IgnorePointer works with Stacked AppBars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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