# vustron/qr_code_scanner architecture

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

- Interactive diagram: https://gitdiagram.com/vustron/qr_code_scanner
- Repository: https://github.com/vustron/qr_code_scanner

## Overview

QR Code Scanner is an offline Flutter app for scanning QR codes and managing scan history. The principal workflow is: a user scans a code, then may save it locally or act on it by sharing or copying its content; saved entries can later be edited or deleted. The tree shows separate view, controller, service, provider, and model layers, but their calls are not excerpted. Accordingly, documented feature links use README evidence; layer-to-layer connections are omitted rather than inferred. Platform runner and generated plugin files are excluded as hosting infrastructure.

Main entry points: [`lib/main.dart`](https://github.com/vustron/qr_code_scanner/blob/main/lib/main.dart) (Flutter entry), [`lib/src/views/home/widgets/qr_scanner.dart`](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_scanner.dart) (QR scanner), [`lib/src/views/home/widgets/qr_list.dart`](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_list.dart) (Saved codes), [`lib/src/views/home/widgets/result.dart`](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/result.dart) (Scan result)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["Flutter entry<br/>[main.dart]"]
  node_home["Home screen<br/>[view.dart]"]
  node_history["Saved codes<br/>[qr_list.dart]"]
  node_details["Code details"]
  node_edit["Edit code"]
end

subgraph group_qr["QR workflow"]
  node_scanner["QR scanner<br/>[qr_scanner.dart]"]
  node_result["Scan result<br/>[result.dart]"]
  node_qr_controller["QR controller"]
  node_qr_service["QR service<br/>[qr_code.dart]"]
  node_qr_provider["QR provider<br/>[qr_code.dart]"]
  node_qr_model["QR record<br/>[qrcode.dart]"]
end

subgraph group_platform["App services"]
  node_db_controller["Database controller<br/>[db_controller.dart]"]
  node_db_service[("SQLite service<br/>[db.dart]")]
  node_db_provider["Database provider<br/>[db_provider.dart]"]
  node_sharing["Share action<br/>[action_btn.dart]"]
  node_audio["Audio feedback<br/>[audio_player.dart]"]
  node_audio_controller["Audio controller"]
  node_audio_provider["Audio provider"]
end

subgraph group_support["Cross-cutting"]
  node_error["Error handling"]
  node_error_view["Error screen<br/>[view.dart]"]
  node_router["Navigation<br/>[router.dart]"]
  node_root["Root view<br/>[view.dart]"]
end

node_user(("User"))

node_user -.->|"launches"| node_app
node_app -.->|"opens"| node_home
node_user -->|"scans code"| node_scanner
node_scanner -.->|"shows content"| node_result
node_user -->|"views history"| node_history
node_user -->|"shares content"| node_sharing
node_user -->|"edits saved code"| node_edit
node_user -->|"deletes saved code"| node_history
node_user -->|"copies content"| node_result

click node_app "https://github.com/vustron/qr_code_scanner/blob/main/lib/main.dart"
click node_home "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/view.dart"
click node_scanner "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_scanner.dart"
click node_result "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/result.dart"
click node_qr_controller "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/qr_code_controller.dart"
click node_qr_service "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/qr_code.dart"
click node_qr_provider "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/qr_code.dart"
click node_qr_model "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/models/qrcode.dart"
click node_history "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_list.dart"
click node_details "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_details_bottom_sheet.dart"
click node_edit "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/update_qr_bottom_sheet.dart"
click node_db_controller "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/db_controller.dart"
click node_db_service "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/db.dart"
click node_db_provider "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/db_provider.dart"
click node_sharing "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/action_btn.dart"
click node_audio "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/audio_player.dart"
click node_audio_controller "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/audio_player_controller.dart"
click node_audio_provider "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/audio_player_provider.dart"
click node_error "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/error_controller.dart"
click node_error_view "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/error/view.dart"
click node_router "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/router.dart"
click node_root "https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/root/view.dart"

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_app,node_home,node_history,node_details,node_edit,node_user toneBlue
class node_scanner,node_result,node_qr_controller,node_qr_service,node_qr_provider,node_qr_model toneAmber
class node_db_controller,node_db_service,node_db_provider,node_sharing,node_audio,node_audio_controller,node_audio_provider toneMint
class node_error,node_error_view,node_router,node_root toneRose
```

## Components

### App experience

- [Flutter entry](https://github.com/vustron/qr_code_scanner/blob/main/lib/main.dart): `lib/main.dart`
- [Home screen](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/view.dart): `lib/src/views/home/view.dart`
- [Saved codes](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_list.dart): `lib/src/views/home/widgets/qr_list.dart`
- [Code details](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_details_bottom_sheet.dart): `lib/src/views/home/widgets/qr_details_bottom_sheet.dart`
- [Edit code](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/update_qr_bottom_sheet.dart): `lib/src/views/home/widgets/update_qr_bottom_sheet.dart`

### QR workflow

- [QR scanner](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/qr_scanner.dart): `lib/src/views/home/widgets/qr_scanner.dart`
- [Scan result](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/result.dart): `lib/src/views/home/widgets/result.dart`
- [QR controller](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/qr_code_controller.dart): `lib/src/controllers/qr_code_controller.dart`
- [QR service](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/qr_code.dart): `lib/src/services/qr_code.dart`
- [QR provider](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/qr_code.dart): `lib/src/providers/qr_code.dart`
- [QR record](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/models/qrcode.dart): `lib/src/models/qrcode.dart`

### App services

- [Database controller](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/db_controller.dart): `lib/src/controllers/db_controller.dart`
- [SQLite service](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/db.dart): `lib/src/services/db.dart`
- [Database provider](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/db_provider.dart): `lib/src/providers/db_provider.dart`
- [Share action](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/home/widgets/action_btn.dart): `lib/src/views/home/widgets/action_btn.dart`
- [Audio feedback](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/audio_player.dart): `lib/src/services/audio_player.dart`
- [Audio controller](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/audio_player_controller.dart): `lib/src/controllers/audio_player_controller.dart`
- [Audio provider](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/providers/audio_player_provider.dart): `lib/src/providers/audio_player_provider.dart`

### Cross-cutting

- [Error handling](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/controllers/error_controller.dart): `lib/src/controllers/error_controller.dart`
- [Error screen](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/error/view.dart): `lib/src/views/error/view.dart`
- [Navigation](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/services/router.dart): `lib/src/services/router.dart`
- [Root view](https://github.com/vustron/qr_code_scanner/blob/main/lib/src/views/root/view.dart): `lib/src/views/root/view.dart`

### Other components

- **User**

## Connections

- User → Flutter entry: launches (evidence: `README.md`)
- Flutter entry → Home screen: opens
- User → QR scanner: scans code (evidence: `README.md`)
- QR scanner → Scan result: shows content
- User → Saved codes: views history (evidence: `README.md`)
- User → Share action: shares content (evidence: `README.md`)
- User → Edit code: edits saved code (evidence: `README.md`)
- User → Saved codes: deletes saved code (evidence: `README.md`)
- User → Scan result: copies content (evidence: `README.md`)
