Add account filtering and net worth card to dashboard (#818)

* feat(mobile): optimize asset/liability display with filters

- Add NetWorthCard widget with placeholder for future net worth API
- Add side-by-side Assets/Liabilities display with tap-to-filter
- Implement CurrencyFilter widget for multi-select currency filtering
- Replace old _SummaryCard with new unified design
- Remove _CollapsibleSectionHeader in favor of filter-based navigation

The net worth section shows a placeholder as the API endpoint is not yet available.
Users can now filter accounts by type (assets/liabilities) and by currency.

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* fix(mobile): remove unused variables and add const

- Remove unused _totalAssets, _totalLiabilities, _getPrimaryCurrency
- Add const to Text('All') widget

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* feat(mobile): enhance dashboard with icons, long-press breakdown, and grouped view

- NetWorthCard: replace text labels with trending icons, add colored
  bottom borders for asset (green) and liability (red) sections
- Add long-press gesture on asset/liability areas to show full currency
  breakdown in a bottom sheet popup
- Add collapsible account type grouping (Crypto, Bank, Investment, etc.)
  with type-specific icons and expand/collapse headers
- Add PreferencesService for persisting display settings
- Add "Group by Account Type" toggle in Settings screen
- Wire settings change to dashboard via GlobalKey for live updates

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* refactor(mobile): remove welcome header from dashboard

Strip the Welcome greeting and subtitle to let the financial
overview take immediate focus.

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* feat(mobile): compact filter buttons with scroll-wheel currency switcher

- Remove trending icons from asset/liability filter buttons
- Increase amount font size to titleMedium bold
- Reduce Net Worth section and filter button padding
- Show single currency at a time with ListWheelScrollView for
  scrolling between currencies (wheel-picker style)
- Absorb scroll events via NotificationListener to prevent
  triggering pull-to-refresh
- Keep icons in the long-press currency breakdown popup

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* fix(mobile): prevent bottom sheet overflow with ConstrainedBox

Use ConstrainedBox + ListView.separated with shrinkWrap for the
currency breakdown popup. Few currencies: sheet sizes to content.
Many currencies: caps at 50% screen height and scrolls.

Also add isScrollControlled and useSafeArea to showModalBottomSheet.

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* fix(mobile): reload dashboard preferences on any tab switch to Home

Previously only reloaded when navigating directly from Settings to
Home. Now reloads whenever the Home tab is selected, covering paths
like Settings -> More -> Home.

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

* chore(mobile): simplify net worth placeholder to single line

Replace the two-line Net Worth / -- placeholder with a compact
"Net Worth — coming soon" label while the API endpoint is pending.

https://claude.ai/code/session_01W8cQSCzmgTmTqwRJ8Ycpx3

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Lazy Bone
2026-02-02 16:47:01 +08:00
committed by GitHub
parent 408bdd6788
commit 2ac3f3dff0
2 changed files with 7 additions and 21 deletions

View File

@@ -13,7 +13,6 @@ class MainNavigationScreen extends StatefulWidget {
class _MainNavigationScreenState extends State<MainNavigationScreen> {
int _currentIndex = 0;
int _previousIndex = 0;
final _dashboardKey = GlobalKey<DashboardScreenState>();
late final List<Widget> _screens;
@@ -39,12 +38,11 @@ class _MainNavigationScreenState extends State<MainNavigationScreen> {
bottomNavigationBar: NavigationBar(
selectedIndex: _currentIndex,
onDestinationSelected: (index) {
_previousIndex = _currentIndex;
setState(() {
_currentIndex = index;
});
// Reload preferences when switching back to dashboard from settings
if (index == 0 && _previousIndex == 3) {
// Reload preferences whenever switching back to dashboard
if (index == 0) {
_dashboardKey.currentState?.reloadPreferences();
}
},

View File

@@ -36,23 +36,11 @@ class NetWorthCard extends StatelessWidget {
// Net Worth Section (Placeholder)
Padding(
padding: const EdgeInsets.fromLTRB(16, 14, 16, 12),
child: Column(
children: [
Text(
'Net Worth',
style: Theme.of(context).textTheme.labelMedium?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
const SizedBox(height: 2),
Text(
'--',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
),
],
child: Text(
'Net Worth — coming soon',
style: Theme.of(context).textTheme.labelMedium?.copyWith(
color: colorScheme.onSurfaceVariant,
),
),
),