Initial changes to routing system

This commit is contained in:
Shawn 2023-12-08 10:03:26 -07:00
parent 91c8cb9760
commit 74b536b366
3 changed files with 11 additions and 3 deletions

View File

@ -77,7 +77,7 @@ class AppLogic {
// Load initial view (replace empty initial view which is covered by a native splash screen) // Load initial view (replace empty initial view which is covered by a native splash screen)
bool showIntro = settingsLogic.hasCompletedOnboarding.value == false; bool showIntro = settingsLogic.hasCompletedOnboarding.value == false;
if (showIntro) { if (showIntro || true) {
appRouter.go(ScreenPaths.intro); appRouter.go(ScreenPaths.intro);
} else { } else {
appRouter.go(ScreenPaths.home); appRouter.go(ScreenPaths.home);

View File

@ -38,7 +38,15 @@ final appRouter = GoRouter(
}, },
routes: [ routes: [
AppRoute(ScreenPaths.splash, (_) => Container(color: $styles.colors.greyStrong)), // This will be hidden AppRoute(ScreenPaths.splash, (_) => Container(color: $styles.colors.greyStrong)), // This will be hidden
AppRoute(ScreenPaths.home, (_) => HomeScreen()), AppRoute(ScreenPaths.home, (_) => HomeScreen(), routes: [
AppRoute('wonder/:type', (s) {
int tab = int.tryParse(s.queryParams['t'] ?? '') ?? 0;
return WonderDetailsScreen(
type: _parseWonderType(s.params['type']),
initialTabIndex: tab,
);
}, useFade: true),
]),
AppRoute(ScreenPaths.intro, (_) => IntroScreen()), AppRoute(ScreenPaths.intro, (_) => IntroScreen()),
AppRoute('/wonder/:type', (s) { AppRoute('/wonder/:type', (s) {
int tab = int.tryParse(s.queryParams['t'] ?? '') ?? 0; int tab = int.tryParse(s.queryParams['t'] ?? '') ?? 0;

View File

@ -104,7 +104,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
void _showDetailsPage() async { void _showDetailsPage() async {
_swipeOverride = _swipeController.swipeAmt.value; _swipeOverride = _swipeController.swipeAmt.value;
context.push(ScreenPaths.wonderDetails(currentWonder.type)); context.go('${ScreenPaths.home}${ScreenPaths.wonderDetails(currentWonder.type)}');
await Future.delayed(100.ms); await Future.delayed(100.ms);
_swipeOverride = null; _swipeOverride = null;
_fadeInOnNextBuild = true; _fadeInOnNextBuild = true;