Skip to content

Commit

Permalink
Merge pull request #2538 from get10101/tradingview-dont-refresh
Browse files Browse the repository at this point in the history
fix: Don't refresh TradingView when switching from wallet to trading tab
  • Loading branch information
Restioson authored Jun 5, 2024
2 parents 97b6fd1 + 3ff89f8 commit dffd492
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions mobile/lib/common/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,55 +177,58 @@ GoRouter createRoutes() {
},
)
]),
ShellRoute(
navigatorKey: shellNavigatorKey,
StatefulShellRoute.indexedStack(
builder: (BuildContext context, GoRouterState state, Widget child) {
return ScaffoldWithNavBar(
child: child,
);
},
routes: <RouteBase>[
GoRoute(
path: WalletScreen.route,
builder: (BuildContext context, GoRouterState state) {
return const WalletScreen();
},
routes: <RouteBase>[
GoRoute(
path: SendOnChainScreen.subRouteName,
// Use root navigator so the screen overlays the application shell
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return SendOnChainScreen(destination: state.extra as OnChainAddress);
},
),
GoRoute(
path: ReceiveScreen.subRouteName,
// Use root navigator so the screen overlays the application shell
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
if (state.extra != null) {
return ReceiveScreen(walletType: state.extra as WalletType);
}
return const ReceiveScreen();
},
),
GoRoute(
path: ScannerScreen.subRouteName,
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return const ScannerScreen();
},
),
],
),
GoRoute(
path: TradeScreen.route,
builder: (BuildContext context, GoRouterState state) {
return const TradeScreen();
},
routes: const [],
),
branches: <StatefulShellBranch>[
StatefulShellBranch(routes: [
GoRoute(
path: WalletScreen.route,
builder: (BuildContext context, GoRouterState state) {
return const WalletScreen();
},
routes: <RouteBase>[
GoRoute(
path: SendOnChainScreen.subRouteName,
// Use root navigator so the screen overlays the application shell
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return SendOnChainScreen(destination: state.extra as OnChainAddress);
},
),
GoRoute(
path: ReceiveScreen.subRouteName,
// Use root navigator so the screen overlays the application shell
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
if (state.extra != null) {
return ReceiveScreen(walletType: state.extra as WalletType);
}
return const ReceiveScreen();
},
),
GoRoute(
path: ScannerScreen.subRouteName,
parentNavigatorKey: rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return const ScannerScreen();
},
),
],
),
]),
StatefulShellBranch(routes: [
GoRoute(
path: TradeScreen.route,
builder: (BuildContext context, GoRouterState state) {
return const TradeScreen();
},
routes: const [],
),
])
],
),
GoRoute(
Expand Down

0 comments on commit dffd492

Please sign in to comment.