# naoki0719/flutter_screen_lock architecture

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

- Interactive diagram: https://gitdiagram.com/naoki0719/flutter_screen_lock
- Repository: https://github.com/naoki0719/flutter_screen_lock

## Overview

Flutter Screen Lock is a UI library for collecting and confirming passcodes, unlocking a screen, and optionally invoking biometric authentication. The documented flow starts when an app calls a lock API; the user enters a passcode, and the app receives an unlock or confirmation callback. Passcode creation, retry/cancellation behavior, keyboard input, and UI customization are additional capabilities. No source excerpts were supplied, so relationships below rely only on README examples and descriptions; internal call paths are not asserted.

Main entry points: [`lib/src/functions.dart`](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/functions.dart) (Lock APIs), [`lib/src/screen_lock.dart`](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/screen_lock.dart) (Lock screen), [`lib/src/input_controller.dart`](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/input_controller.dart) (Input controller), [`lib/src/configurations/key_pad_config.dart`](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/key_pad_config.dart) (Keypad config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lock_flow["Passcode Flow"]
  node_lock_api["Lock APIs<br/>[functions.dart]"]
  node_lock_screen["Lock screen<br/>[screen_lock.dart]"]
  node_input_controller["Input controller"]
end

subgraph group_input_ui["Input and Display"]
  node_keypad["Keypad<br/>[key_pad.dart]"]
  node_keypad_button["Keypad buttons"]
  node_secrets["Passcode display<br/>[secrets.dart]"]
end

subgraph group_configuration["Customization"]
  node_keypad_config["Keypad config"]
  node_button_config["Button config"]
  node_screen_config["Screen config"]
  node_secret_config["Secret config"]
  node_secret_style["Secret styling<br/>[secret_config.dart]"]
end

subgraph group_integrations["Authentication"]
  node_local_auth["Local biometrics"]
end

node_app(("Host app"))

node_app -->|"opens lock"| node_lock_api
node_lock_api -->|"shows screen"| node_lock_screen
node_app -->|"controls confirmation"| node_input_controller
node_app -.->|"invokes optionally"| node_local_auth
node_app -->|"customizes input"| node_keypad_config
node_app -->|"customizes screen"| node_screen_config
node_app -->|"customizes secrets"| node_secret_config
node_app -->|"styles buttons"| node_button_config

click node_lock_api "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/functions.dart"
click node_lock_screen "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/screen_lock.dart"
click node_input_controller "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/input_controller.dart"
click node_keypad "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/key_pad.dart"
click node_keypad_button "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/key_pad_button.dart"
click node_secrets "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/secrets.dart"
click node_keypad_config "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/key_pad_config.dart"
click node_button_config "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/key_pad_button_config.dart"
click node_screen_config "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/screen_lock_config.dart"
click node_secret_config "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/secrets_config.dart"
click node_secret_style "https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/secret_config.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_lock_api,node_lock_screen,node_input_controller toneBlue
class node_keypad,node_keypad_button,node_secrets toneAmber
class node_keypad_config,node_button_config,node_screen_config,node_secret_config,node_secret_style toneMint
class node_local_auth toneRose
class node_app toneIndigo
```

## Components

### Passcode Flow

- [Lock APIs](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/functions.dart): `lib/src/functions.dart`
- [Lock screen](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/screen_lock.dart): `lib/src/screen_lock.dart`
- [Input controller](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/input_controller.dart): `lib/src/input_controller.dart`

### Input and Display

- [Keypad](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/key_pad.dart): `lib/src/layout/key_pad.dart`
- [Keypad buttons](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/key_pad_button.dart): `lib/src/layout/key_pad_button.dart`
- [Passcode display](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/layout/secrets.dart): `lib/src/layout/secrets.dart`

### Customization

- [Keypad config](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/key_pad_config.dart): `lib/src/configurations/key_pad_config.dart`
- [Button config](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/key_pad_button_config.dart): `lib/src/configurations/key_pad_button_config.dart`
- [Screen config](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/screen_lock_config.dart): `lib/src/configurations/screen_lock_config.dart`
- [Secret config](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/secrets_config.dart): `lib/src/configurations/secrets_config.dart`
- [Secret styling](https://github.com/naoki0719/flutter_screen_lock/blob/main/lib/src/configurations/secret_config.dart): `lib/src/configurations/secret_config.dart`

### Authentication

- **Local biometrics**

### Other components

- **Host app**

## Connections

- Host app → Lock APIs: opens lock (evidence: `README.md`)
- Lock APIs → Lock screen: shows screen (evidence: `README.md`)
- Host app → Input controller: controls confirmation (evidence: `README.md`)
- Host app → Local biometrics: invokes optionally (evidence: `README.md`)
- Host app → Keypad config: customizes input (evidence: `README.md`)
- Host app → Screen config: customizes screen (evidence: `README.md`)
- Host app → Secret config: customizes secrets (evidence: `README.md`)
- Host app → Button config: styles buttons (evidence: `README.md`)
