UI Component Inventory (mobile)

Annotated map of the Flutter mobile app: components, design system, services, providers, and i18n locales.

Overview

Reference map of every Dart file under mobile/genie_ai_mobile/lib/. Counts are pulled from a snapshot of the source tree and are correct as of the audit date — when adding or removing files, regenerate the snapshot rather than editing the numbers by hand.

For architectural concerns (how the layers compose, what each service is responsible for at the wire level), see Mobile Architecture. For end-user-facing flows, see User Authentication and Chat Pipeline.

Snapshot

BucketCountWhere
Dart files (whole lib/)80mobile/genie_ai_mobile/lib/**/*.dart
UI components (lib/components/)16chat=6, sidebar=3, auth=1, user=1, settings=2, shared=3
Design system primitives (lib/design_system/components/)6ds_button, ds_card, ds_input, ds_modal, ds_spinner, ds_state_display
Design tokens (lib/design_system/tokens/)4app_tokens, color_utils, spacing, radii
Services (lib/services/)18auth/ = 10, keycloak/ = 1, top-level = 7
Configuration (lib/config/)6root = 4, flavors/ = 2
Riverpod providers (lib/providers/)1api_providers.dart
Utilities (lib/utils/)4theme_manager, chart_theme_utils, dialog_theme_utils, config_resolver
i18n locales (lib/i18n/locales/)14see Locales below

“Services = 18” is the count of *.dart files in lib/services/. The auth subdirectory contains 10 files (app_auth, auth_interceptor, auth_logger, auth_notifier, auth_state, auth_providers, token_storage, connectivity_checker, network_error_classifier, insecure_http_client). The keycloak subdirectory contains 1 (keycloak_service). The 7 top-level services are connectivity_service, fallback_localizations, genie_ai_config, i18n_service, notification_service, sse_parser, user_service.

Design system

Primitives (lib/design_system/components/)

ComponentDescription
ds_button.dartButton with variants: primary, secondary, ghost, danger
ds_card.dartContainer with elevation and border radius
ds_input.dartText field with label, validation states, error message slot
ds_modal.dartModal dialog overlay with content slot
ds_spinner.dartCircular progress indicator
ds_state_display.dartEmpty / error / loading state presenter

Tokens (lib/design_system/tokens/)

TokenDescription
app_tokens.dartGlobal typography + color tokens
color_utils.dartLighten / darken / opacity / theme mapping
spacing.dartSpacing scale constants (xs, sm, md, lg, xl)
radii.dartBorder radius tokens (sm, md, lg, xl, full)

Theme (lib/design_system/theme/)

FileDescription
app_theme.dartMaterial theme configuration (light + dark color schemes)

Chat components (lib/components/chat/)

FileDescription
chatbot_component.dartMain chat interface — message list, input, feedback, SSE stream handler, Quick Help overlay, PDF export. The single largest widget in the app (~67 KB).
right_sidebar_component.dartRelated Documents sidebar — MIME-iconed cards, external launch
chat_response_feedback_dialog.dartPer-message feedback dialog (thumbs → star rating → free text → skin-tone selector)
right_sidebar_stub.dartConditional compilation stub for platforms where the right sidebar is not rendered
web_file_utils.dartBrowser-side file save helpers (used by PDF export on web)
stub_file_utils.dartNative fallback stub (no-ops on non-web platforms)
FileDescription
sidebar_component.dartLeft sidebar with conversation history and services tabs
chat_folders_panel.dartConversation folders — All / Starred / Archived tabs, CRUD operations
service_tree_panel.dartHierarchical service-category tree with multi-select

Auth components (lib/components/auth/)

FileDescription
oidc_login_screen.dartOIDC login screen with branding, error display, retry mechanism

User components (lib/components/user/)

FileDescription
user_profile_component.dartUser profile form (personal info, preferences, country, ID docs)

Settings components (lib/components/settings/)

FileDescription
settings_component.dartTheme, language, notifications, account management (~26 KB)
about_screen.dartApp version, build info, OSS licenses

Shared components (lib/components/shared/)

FileDescription
nav_bar_component.dartBottom navigation bar
confirm_dialog.dartGeneric confirm / cancel dialog
language_selector.dartLanguage picker (writes locale to i18n_service)

App structure (lib/src/)

FileDescription
app.dartRoot widget with router and global providers
localization/Localization delegates (flutter_localizations glue)
sample_feature/Flutter template leftover; unused at runtime — safe to delete
settings/Legacy settings controller; unused at runtime — safe to delete

sample_feature/ and settings/ under lib/src/ are Flutter project-template artefacts. They are not referenced from main.dart or any provider. They inflate the file count but contribute no production behaviour.

Services

Authentication (lib/services/auth/)

FilePurpose
app_auth.dartThin flutter_appauth wrapper
auth_interceptor.dartBaseClient that injects Bearer tokens and handles 401 → refresh → retry
auth_logger.dartStructured event logger (talker-backed)
auth_notifier.dartAuth state machine — init, authorize, refreshTokens, validateTokens, logout
auth_state.dartSealed AuthState (Authenticated / Unauthenticated / Error)
auth_providers.dartRiverpod provider wiring for the above
token_storage.dartflutter_secure_storage-backed token persistence
connectivity_checker.dartNetwork state read used by NetworkErrorClassifier
network_error_classifier.dartClassifies HTTP errors into retryable vs terminal
insecure_http_client.dartDev-only HTTP client that bypasses TLS validation

Keycloak (lib/services/keycloak/)

FilePurpose
keycloak_service.dartOIDC discovery + authorize / token / end_session endpoints

Top-level (lib/services/)

FilePurpose
connectivity_service.dartReactive online/offline state driving the offline banner. Differs from connectivity_checker.dart (which is the per-request classifier hook used by NetworkErrorClassifier).
user_service.dartUser profile operations against /api/me
i18n_service.dartLocale selection + translation lookups
notification_service.dartIn-app toast / event bus (success/error/info/warning broadcast over StreamController). No push notification integration is currently wired.
genie_ai_config.dartReads assets/config/genie-ai-config.json at startup
fallback_localizations.dartEnglish fallback for missing translation keys
sse_parser.dartSSE stream → typed SseEvent objects (chunk / metadata / translation / done / error)

Configuration (lib/config/)

FilePurpose
keycloak_config.dartKeycloakConfig schema + getConfig() flavor switch + allSupportedLocaleCodes
dev_config.dartDevelopment flavor
staging_config.dartStaging flavor
e2e_config.dartE2E test flavor
flavors/itu.dartITU production flavor
flavors/template.dartTemplate to copy for new institutional flavors

Providers (lib/providers/)

FilePurpose
api_providers.dartRiverpod providers for backend API clients (one per OpenAPI domain)

Utilities (lib/utils/)

FilePurpose
theme_manager.dartTheme switching + persistence
chart_theme_utils.dartChart theme helpers for the analytics view
dialog_theme_utils.dartDialog theme helpers
config_resolver.dartResolves flavor-specific runtime overrides

Locales

lib/i18n/locales/ ships 14 locale files, matched by allSupportedLocaleCodes in lib/config/keycloak_config.dart:

LocaleLanguageFile
enEnglishen.dart
arArabicar.dart
bnBengalibn.dart
deGermande.dart
esSpanishes.dart
frFrenchfr.dart
idIndonesianid.dart
manMandarin (Pinyin)man.dart
ptPortuguesept.dart
ruRussianru.dart
stSesothost.dart
swSwahilisw.dart
thThaith.dart
zhChinese (Simplified)zh.dart

Deployment-level locale whitelist is config-driven. All 14 files stay in the source; a flavor restricts the active set via KeycloakConfig.supportedLocaleCodes (see Mobile Deployment Guide §4).

Tree

mobile/genie_ai_mobile/lib/
├── main.dart                         # App entry point (MyApp root)
├── src/                              # App composition root
│   ├── app.dart                      # Router + theme + locale wiring
│   ├── localization/                 # Flutter localization delegates
│   ├── sample_feature/               # Flutter template (unused at runtime)
│   └── settings/                     # Legacy settings controller (unused)
├── components/                       # UI components (16)
│   ├── auth/                         # Authentication (1)
│   ├── chat/                         # Chat interface (6)
│   ├── sidebar/                      # Sidebar (3)
│   ├── user/                         # User profile (1)
│   ├── settings/                     # Settings (2)
│   └── shared/                       # Shared UI (3)
├── design_system/                    # Design system (11)
│   ├── components/                   # DS primitives (6)
│   ├── tokens/                       # Design tokens (4)
│   └── theme/                        # App theme (1)
├── services/                         # Business logic (18)
│   ├── auth/                         # Auth services (10)
│   ├── keycloak/                     # Keycloak wrapper (1)
│   └── [top-level services]           # (7)
├── config/                           # Configuration (6)
│   └── flavors/                      # Flavor configs (2)
├── providers/                        # Riverpod providers (1)
├── utils/                            # Utilities (4)
└── i18n/                             # Internationalization
    └── locales/                      # Translation files (14)