From 3dc590baa2f98f27e5c23817a9f09e273289e983 Mon Sep 17 00:00:00 2001 From: Anton Stubenbord Date: Tue, 13 Dec 2022 01:29:55 +0100 Subject: [PATCH] Prevent navigation change event to same page --- lib/features/home/view/home_page.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/features/home/view/home_page.dart b/lib/features/home/view/home_page.dart index e8092c3..219d5d6 100644 --- a/lib/features/home/view/home_page.dart +++ b/lib/features/home/view/home_page.dart @@ -49,8 +49,11 @@ class _HomePageState extends State { key: rootScaffoldKey, bottomNavigationBar: BottomNavBar( selectedIndex: _currentIndex, - onNavigationChanged: (index) => - setState(() => _currentIndex = index), + onNavigationChanged: (index) { + if (_currentIndex != index) { + setState(() => _currentIndex = index); + } + }, ), drawer: const InfoDrawer(), body: [