fixed load again

This commit is contained in:
amirrezaghabeli
2025-08-22 14:48:58 +03:30
parent 47edc00b97
commit 2373ce3c26
4 changed files with 20 additions and 6 deletions
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:tm_app/core/routes/app_shell/desktop_shell_page.dart';
import 'package:tm_app/core/routes/app_shell/mobile_shell_page.dart';
import 'package:tm_app/core/routes/app_shell/tablet_shell_page.dart';
import 'package:tm_app/view_models/home_view_model.dart';
import 'package:tm_app/views/shared/responsive_builder.dart';
class AppShellScreen extends StatelessWidget {
@@ -10,11 +12,12 @@ class AppShellScreen extends StatelessWidget {
final StatefulNavigationShell navigationShell;
void _gotoBranch(int index) {
void _gotoBranch(int index, BuildContext context) {
navigationShell.goBranch(
index,
initialLocation: index == navigationShell.currentIndex,
);
context.read<HomeViewModel>().init();
}
@override
@@ -22,15 +25,15 @@ class AppShellScreen extends StatelessWidget {
return ResponsiveBuilder(
mobile: MobileShellPage(
navigationShell: navigationShell,
onTap: _gotoBranch,
onTap: (value) => _gotoBranch(value, context),
),
tablet: TabletShellPage(
navigationShell: navigationShell,
onTap: _gotoBranch,
onTap: (value) => _gotoBranch(value, context),
),
desktop: DesktopShellPage(
navigationShell: navigationShell,
onTap: _gotoBranch,
onTap: (value) => _gotoBranch(value, context),
),
);
}