diff --git a/lib/app_router.dart b/lib/app_router.dart index 85dbd13..18187d1 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:wealth_wave/ui/nav_path.dart'; +import 'package:wealth_wave/ui/pages/baskets_page.dart'; import 'package:wealth_wave/ui/pages/goal_page.dart'; import 'package:wealth_wave/ui/pages/investment_page.dart'; import 'package:wealth_wave/ui/pages/main_page.dart'; @@ -13,6 +14,8 @@ class AppRouter { return InvestmentPage(investmentId: int.parse(uri.pathSegments[1])); } else if (NavPath.isGoalPagePath(uri.pathSegments)) { return GoalPage(goalId: int.parse(uri.pathSegments[1])); + } else if(NavPath.isBasketsPagePath(uri.pathSegments)) { + return const BasketsPage(); } return const MainPage(path: []); } diff --git a/lib/ui/nav_path.dart b/lib/ui/nav_path.dart index d3e5f96..1092a9b 100644 --- a/lib/ui/nav_path.dart +++ b/lib/ui/nav_path.dart @@ -10,6 +10,7 @@ class NavPath { static String updateBasket({required final int id}) => '/baskets/$id/update'; static String investment({required final int id}) => '/investments/$id'; static String goal({required final int id}) => '/goals/$id'; + static const String baskets = '/baskets'; static isMainPagePath(List paths) => paths.isEmpty; @@ -27,4 +28,6 @@ class NavPath { static isGoalPagePath(List paths) => paths.length == 2 && paths[0] == 'goals'; + + static isBasketsPagePath(List paths) => paths.length == 1 && paths[0] == 'baskets'; } diff --git a/lib/ui/pages/baskets_page.dart b/lib/ui/pages/baskets_page.dart index 864ee25..570223b 100644 --- a/lib/ui/pages/baskets_page.dart +++ b/lib/ui/pages/baskets_page.dart @@ -25,6 +25,10 @@ class _BasketsPage final BuildContext context, final BasketsViewState snapshot) { List basketVOs = snapshot.baskets; return Scaffold( + appBar: AppBar( + title: const Text('Baskets'), + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + ), body: Center( child: ListView.builder( itemCount: basketVOs.length, diff --git a/lib/ui/pages/goal_page.dart b/lib/ui/pages/goal_page.dart index 9ae5789..302558d 100644 --- a/lib/ui/pages/goal_page.dart +++ b/lib/ui/pages/goal_page.dart @@ -33,7 +33,10 @@ class _GoalPage extends PageState { } return Scaffold( - appBar: AppBar(title: const Text('Goal')), + appBar: AppBar( + title: const Text('Goal'), + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + ), body: SingleChildScrollView( child: _goalWidget(context: context, goalVO: goalVO))); } diff --git a/lib/ui/pages/investment_page.dart b/lib/ui/pages/investment_page.dart index 8bd5d28..26e9ca4 100644 --- a/lib/ui/pages/investment_page.dart +++ b/lib/ui/pages/investment_page.dart @@ -29,7 +29,10 @@ class _InvestmentPage extends PageState { PopupMenuButton( onSelected: (value) { if (value == 1) { - presenter.performBackup(); + Navigator.of(context).pushNamed('/baskets'); } else if (value == 2) { + presenter.performBackup(); + } else if (value == 3) { presenter.performImportFile(); } }, itemBuilder: (context) => [ const PopupMenuItem( value: 1, - child: Text('Export'), + child: Text('Baskets'), ), const PopupMenuItem( value: 2, + child: Text('Export'), + ), + const PopupMenuItem( + value: 3, child: Text('Import'), ), ], @@ -84,11 +89,7 @@ class _MainPageState extends PageState { NavigationDestination( icon: Icon(Icons.flag), label: 'Goals', - ), - NavigationDestination( - icon: Icon(Icons.shopping_basket), - label: 'Baskets', - ), + ) ], onDestinationSelected: (index) { setState(() { @@ -105,8 +106,6 @@ class _MainPageState extends PageState { return const InvestmentsPage(); case 2: return const GoalsPage(); - case 3: - return const BasketsPage(); default: return Container(); }