Prevent navigation change event to same page

This commit is contained in:
Anton Stubenbord
2022-12-13 01:29:55 +01:00
parent 64c431286e
commit 3dc590baa2

View File

@@ -49,8 +49,11 @@ class _HomePageState extends State<HomePage> {
key: rootScaffoldKey, key: rootScaffoldKey,
bottomNavigationBar: BottomNavBar( bottomNavigationBar: BottomNavBar(
selectedIndex: _currentIndex, selectedIndex: _currentIndex,
onNavigationChanged: (index) => onNavigationChanged: (index) {
setState(() => _currentIndex = index), if (_currentIndex != index) {
setState(() => _currentIndex = index);
}
},
), ),
drawer: const InfoDrawer(), drawer: const InfoDrawer(),
body: [ body: [