# omar-e-khalifa/currency_calculator architecture

> Architecture diagram of the GitHub repository omar-e-khalifa/currency_calculator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omar-e-khalifa/currency_calculator
- Repository: https://github.com/omar-e-khalifa/currency_calculator

## Overview

LancerCalc is a Flutter currency calculator for freelancers. The principal workflow combines calculator input with live exchange-rate conversion; users can also swap currencies and retain currency preferences locally. The README documents calculator, settings, API, and storage capabilities, but the Dart sources were not excerpted, so internal call ownership is not verifiable. Edges therefore cite documented behavior or are marked unverified. Tax calculation and full currency management are planned, not implemented.

Main entry points: [`lib/views/currency_calculator_view.dart`](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/currency_calculator_view.dart) (Calculator screen), [`lib/views/settings_view.dart`](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/settings_view.dart) (Settings screen), [`lib/cubits/currency_list_cubit/currency_list_cubit.dart`](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/currency_list_cubit/currency_list_cubit.dart) (Currency list state), [`lib/cubits/exchange_rate_cubit/exchange_rate_cubit.dart`](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/exchange_rate_cubit/exchange_rate_cubit.dart) (Exchange rate state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_calculator["Calculator screen"]
  node_settings["Settings screen<br/>[settings_view.dart]"]
  node_uiwidgets["Reusable widgets"]
  node_buttondata["Calculator layout<br/>[buttons_list.dart]"]
end

subgraph group_state["State and domain"]
  node_display["Display state"]
  node_currencies["Currency list state"]
  node_rates["Exchange rate state"]
  node_models["Domain models"]
end

subgraph group_integrations["Services and integrations"]
  node_rate_service["Rate API service"]
  node_supported_service["Supported codes service"]
  node_preferences[("Preference storage")]
end

subgraph group_planned["Planned capabilities"]
  node_tax["Tax screen"]
  node_currency_management["Currency management"]
end

node_user(("Freelancer"))
node_exchange_api{{"ExchangeRate-API"}}
node_local_storage[("Local preferences")]

node_user -->|"enters amounts"| node_calculator
node_calculator -.->|"converts currencies"| node_rates
node_calculator -.->|"calculator input"| node_display
node_calculator -.->|"uses layout"| node_buttondata
node_calculator -.->|"shows controls"| node_uiwidgets
node_user -->|"selects currencies"| node_settings
node_settings -.->|"selects currencies"| node_currencies
node_settings -.->|"saves preferences"| node_preferences
node_preferences -->|"persists locally"| node_local_storage
node_rates -.->|"requests rates"| node_rate_service
node_rate_service -->|"fetches rates"| node_exchange_api
node_currencies -.->|"loads supported codes"| node_supported_service
node_calculator -.->|"planned feature"| node_tax
node_settings -.->|"planned feature"| node_currency_management
node_entry -.->|"launches screen"| node_calculator

click node_entry "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/main.dart"
click node_calculator "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/currency_calculator_view.dart"
click node_settings "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/settings_view.dart"
click node_uiwidgets "https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/widgets"
click node_buttondata "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/data/buttons_list.dart"
click node_display "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/display_area_cubit/display_area_cubit.dart"
click node_currencies "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/currency_list_cubit/currency_list_cubit.dart"
click node_rates "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/exchange_rate_cubit/exchange_rate_cubit.dart"
click node_models "https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/models"
click node_rate_service "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/exchange_rate_service.dart"
click node_supported_service "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/supported_code_service.dart"
click node_preferences "https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/shared_preferences_service.dart"
click node_tax "https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/views"
click node_currency_management "https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/views"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_calculator,node_settings,node_uiwidgets,node_buttondata toneBlue
class node_display,node_currencies,node_rates,node_models,node_local_storage toneAmber
class node_rate_service,node_supported_service,node_preferences,node_exchange_api toneMint
class node_tax,node_currency_management toneRose
class node_user toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/main.dart): `lib/main.dart`
- [Calculator screen](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/currency_calculator_view.dart): `lib/views/currency_calculator_view.dart`
- [Settings screen](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/views/settings_view.dart): `lib/views/settings_view.dart`
- [Reusable widgets](https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/widgets): `lib/widgets`
- [Calculator layout](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/data/buttons_list.dart): `lib/data/buttons_list.dart`

### State and domain

- [Display state](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/display_area_cubit/display_area_cubit.dart): `lib/cubits/display_area_cubit/display_area_cubit.dart`
- [Currency list state](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/currency_list_cubit/currency_list_cubit.dart): `lib/cubits/currency_list_cubit/currency_list_cubit.dart`
- [Exchange rate state](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/cubits/exchange_rate_cubit/exchange_rate_cubit.dart): `lib/cubits/exchange_rate_cubit/exchange_rate_cubit.dart`
- [Domain models](https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/models): `lib/models`

### Services and integrations

- [Rate API service](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/exchange_rate_service.dart): `lib/services/exchange_rate_service.dart`
- [Supported codes service](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/supported_code_service.dart): `lib/services/supported_code_service.dart`
- [Preference storage](https://github.com/omar-e-khalifa/currency_calculator/blob/main/lib/services/shared_preferences_service.dart): `lib/services/shared_preferences_service.dart`

### Planned capabilities

- [Tax screen](https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/views): `lib/views`
- [Currency management](https://github.com/omar-e-khalifa/currency_calculator/tree/main/lib/views): `lib/views`

### Other components

- **Freelancer**
- **ExchangeRate-API**
- **Local preferences**

## Connections

- Freelancer → Calculator screen: enters amounts (evidence: `README.md`)
- Calculator screen → Exchange rate state: converts currencies
- Calculator screen → Display state: calculator input
- Calculator screen → Calculator layout: uses layout
- Calculator screen → Reusable widgets: shows controls
- Freelancer → Settings screen: selects currencies (evidence: `README.md`)
- Settings screen → Currency list state: selects currencies
- Settings screen → Preference storage: saves preferences
- Preference storage → Local preferences: persists locally (evidence: `README.md`)
- Exchange rate state → Rate API service: requests rates
- Rate API service → ExchangeRate-API: fetches rates (evidence: `README.md`)
- Currency list state → Supported codes service: loads supported codes
- Calculator screen → Tax screen: planned feature (evidence: `README.md`)
- Settings screen → Currency management: planned feature (evidence: `README.md`)
- App entry → Calculator screen: launches screen
