Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't refresh TradingView when switching from wallet to trading tab #2538

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 47 additions & 44 deletions mobile/lib/common/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,55 +174,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 [],
),
])
],
),
]),
Expand Down
Loading