Skip to content

Commit 6dafaab

Browse files
committed
refactor(app_shell): remove unused _goBranch method
- Replaced direct method call with lambda. - Improved code readability and maintainability.
1 parent 44e68f8 commit 6dafaab

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/app/view/app_shell.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ class AppShell extends StatelessWidget {
2222
/// navigators in a stateful way.
2323
final StatefulNavigationShell navigationShell;
2424

25-
void _goBranch(int index) {
26-
navigationShell.goBranch(
27-
index,
28-
initialLocation: index == navigationShell.currentIndex,
29-
);
30-
}
31-
3225
@override
3326
Widget build(BuildContext context) {
3427
final l10n = context.l10n;
@@ -70,7 +63,12 @@ class AppShell extends StatelessWidget {
7063
),
7164
body: AdaptiveScaffold(
7265
selectedIndex: navigationShell.currentIndex,
73-
onSelectedIndexChange: _goBranch,
66+
onSelectedIndexChange: (index) {
67+
navigationShell.goBranch(
68+
index,
69+
initialLocation: index == navigationShell.currentIndex,
70+
);
71+
},
7472
destinations: [
7573
NavigationDestination(
7674
icon: const Icon(Icons.dashboard_outlined),

0 commit comments

Comments
 (0)