Skip to main content

Stack overview


The app uses a StatefulShellRoute.indexedStack for the 5 bottom-nav tabs. Each branch has its own GlobalKey<NavigatorState> — tab state is preserved when switching between tabs. Overlay routes use parentNavigatorKey: _rootNavigatorKey to render on top of the shell (above the bottom nav bar). The AI chat, add/edit screens, and settings are all overlays.

Floating pill navigation

The bottom navigation is a custom floating glass pill — not Flutter’s BottomNavigationBar. It uses BackdropFilter blur, a small mint dot for the active indicator, and HapticFeedback.selectionClick() on each tap.

Riverpod provider graph

Providers are structured in layers. Lower layers feed upper layers — no circular dependencies.

Provider patterns

FutureProvider — used for all async data fetches:
FutureProvider.family — for parameterised fetches:
StateNotifier — for mutable UI state:
AsyncValue — all screens use when() to handle loading/error/data states — no raw null checks or loading booleans in UI code:

Theme system

All colors, typography, and spacing are defined in lib/core/theme/:

Colors — vantage_colors.dart

Typography — vantage_typography.dart

Two font families, never mixed up:

Cards vs glass overlays

Standard cards (VantageCard): 12px radius, darkSurface background, subtle shadow. No blur. Glass overlays (GlassOverlay): BackdropFilter with ImageFilter.blur(sigmaX: 20, sigmaY: 20), semi-transparent background. Used only for the AI chat overlay and modal sheets. Blur is never applied to content cards — it’s reserved for overlays to maintain visual hierarchy.

Spacing — vantage_spacing.dart

4px base unit:

App lifecycle

VantageApp is a ConsumerStatefulWidget that implements WidgetsBindingObserver:

Agent widget renderer

The AI chat renders native Flutter widgets from JSON responses. widget_renderer.dart maps the type field to a widget:
Chart types map to Syncfusion or fl_chart widgets:
  • barSfCartesianChart with bar series
  • lineSfCartesianChart with line series
  • pieSfCircularChart
  • sparklineSparklineChart (custom widget)