# maojiu-bb/biometric_authorization architecture

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

- Interactive diagram: https://gitdiagram.com/maojiu-bb/biometric_authorization
- Repository: https://github.com/maojiu-bb/biometric_authorization

## Overview

Biometric Authorization is a Flutter plugin for checking biometric capability and enrollment, listing available biometric types, and authenticating or stopping authentication on Android, iOS, and macOS. The documented user workflow is an app invoking the Dart API and receiving a result from platform-specific biometric support; authentication can use system UI or custom UI, with Android also offering a dialog option. Native entry points and Android manager/UI relationships are shown in the supplied excerpts or index. Dart internals and iOS wiring were not sampled, so those connections are omitted or marked unverified.

Main entry points: [`lib/biometric_authorization_method_channel.dart`](https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization_method_channel.dart) (Method channel), [`android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt`](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt) (Authorization manager), [`ios/Classes/BiometricAuthorization.swift`](https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthorization.swift) (iOS authorization), [`macos/Classes/BiometricAuthorization.swift`](https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthorization.swift) (macOS authorization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flutter["Flutter API"]
  node_dart_api["Biometric API"]
  node_dart_interface["Platform interface"]
  node_dart_channel["Method channel"]
  node_biometric_types["Biometric types"]
end

subgraph group_android["Android"]
  node_android_plugin["Android plugin"]
  node_android_manager["Authorization manager"]
  node_android_sheet["Custom bottom sheet"]
  node_android_dialog["Fingerprint dialog"]
  node_android_dialog_ui["Dialog UI"]
end

subgraph group_ios["iOS"]
  node_ios_plugin["iOS plugin"]
  node_ios_auth["iOS authorization"]
  node_ios_view["Custom iOS UI"]
end

subgraph group_macos["macOS"]
  node_mac_plugin["macOS plugin"]
  node_mac_auth["macOS authorization"]
  node_mac_view["Custom macOS UI"]
end

node_app(("Flutter app"))
node_biometric_system{{"Device biometrics"}}

node_app -->|"calls"| node_dart_api
node_dart_api -.->|"delegates to"| node_dart_interface
node_dart_interface -.->|"dispatches via"| node_dart_channel
node_dart_channel -.->|"platform call"| node_android_plugin
node_dart_channel -.->|"platform call"| node_ios_plugin
node_dart_channel -.->|"platform call"| node_mac_plugin
node_android_plugin -->|"routes to"| node_android_manager
node_android_manager -->|"uses"| node_android_sheet
node_android_manager -->|"uses"| node_android_dialog
node_android_dialog -->|"hosts"| node_android_dialog_ui
node_android_manager -->|"authenticates with"| node_biometric_system
node_ios_plugin -.->|"routes to"| node_ios_auth
node_ios_auth -->|"presents custom UI"| node_ios_view
node_ios_auth -->|"checks and authenticates"| node_biometric_system
node_mac_plugin -->|"routes to"| node_mac_auth
node_mac_auth -->|"presents custom UI"| node_mac_view
node_mac_auth -->|"checks and authenticates"| node_biometric_system

click node_dart_api "https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization.dart"
click node_dart_interface "https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization_platform_interface.dart"
click node_dart_channel "https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization_method_channel.dart"
click node_biometric_types "https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_type.dart"
click node_android_plugin "https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationPlugin.kt"
click node_android_manager "https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt"
click node_android_sheet "https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthBottomSheet.kt"
click node_android_dialog "https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintDialogFragment.kt"
click node_android_dialog_ui "https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintAuthDialog.kt"
click node_ios_plugin "https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthorizationPlugin.swift"
click node_ios_auth "https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthorization.swift"
click node_ios_view "https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthView.swift"
click node_mac_plugin "https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthorizationPlugin.swift"
click node_mac_auth "https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthorization.swift"
click node_mac_view "https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthView.swift"

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_dart_api,node_dart_interface,node_dart_channel,node_biometric_types toneBlue
class node_android_plugin,node_android_manager,node_android_sheet,node_android_dialog,node_android_dialog_ui toneAmber
class node_ios_plugin,node_ios_auth,node_ios_view toneMint
class node_mac_plugin,node_mac_auth,node_mac_view toneRose
class node_app,node_biometric_system toneIndigo
```

## Components

### Flutter API

- [Biometric API](https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization.dart): `lib/biometric_authorization.dart`
- [Platform interface](https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization_platform_interface.dart): `lib/biometric_authorization_platform_interface.dart`
- [Method channel](https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_authorization_method_channel.dart): `lib/biometric_authorization_method_channel.dart`
- [Biometric types](https://github.com/maojiu-bb/biometric_authorization/blob/main/lib/biometric_type.dart): `lib/biometric_type.dart`

### Android

- [Android plugin](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationPlugin.kt): `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationPlugin.kt`
- [Authorization manager](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt): `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt`
- [Custom bottom sheet](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthBottomSheet.kt): `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthBottomSheet.kt`
- [Fingerprint dialog](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintDialogFragment.kt): `android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintDialogFragment.kt`
- [Dialog UI](https://github.com/maojiu-bb/biometric_authorization/blob/main/android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintAuthDialog.kt): `android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintAuthDialog.kt`

### iOS

- [iOS plugin](https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthorizationPlugin.swift): `ios/Classes/BiometricAuthorizationPlugin.swift`
- [iOS authorization](https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthorization.swift): `ios/Classes/BiometricAuthorization.swift`
- [Custom iOS UI](https://github.com/maojiu-bb/biometric_authorization/blob/main/ios/Classes/BiometricAuthView.swift): `ios/Classes/BiometricAuthView.swift`

### macOS

- [macOS plugin](https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthorizationPlugin.swift): `macos/Classes/BiometricAuthorizationPlugin.swift`
- [macOS authorization](https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthorization.swift): `macos/Classes/BiometricAuthorization.swift`
- [Custom macOS UI](https://github.com/maojiu-bb/biometric_authorization/blob/main/macos/Classes/BiometricAuthView.swift): `macos/Classes/BiometricAuthView.swift`

### Other components

- **Flutter app**
- **Device biometrics**

## Connections

- Flutter app → Biometric API: calls (evidence: `README.md`)
- Biometric API → Platform interface: delegates to
- Platform interface → Method channel: dispatches via
- Method channel → Android plugin: platform call
- Method channel → iOS plugin: platform call
- Method channel → macOS plugin: platform call
- Android plugin → Authorization manager: routes to (evidence: `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationPlugin.kt`)
- Authorization manager → Custom bottom sheet: uses (evidence: `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt`)
- Authorization manager → Fingerprint dialog: uses (evidence: `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt`)
- Fingerprint dialog → Dialog UI: hosts (evidence: `android/src/main/kotlin/com/maojiu/biometric_authorization/FingerprintDialogFragment.kt`)
- Authorization manager → Device biometrics: authenticates with (evidence: `android/src/main/kotlin/com/maojiu/biometric_authorization/BiometricAuthorizationManager.kt`)
- iOS plugin → iOS authorization: routes to
- iOS authorization → Custom iOS UI: presents custom UI (evidence: `ios/Classes/BiometricAuthorization.swift`)
- iOS authorization → Device biometrics: checks and authenticates (evidence: `ios/Classes/BiometricAuthorization.swift`)
- macOS plugin → macOS authorization: routes to (evidence: `macos/Classes/BiometricAuthorizationPlugin.swift`)
- macOS authorization → Custom macOS UI: presents custom UI (evidence: `macos/Classes/BiometricAuthorization.swift`)
- macOS authorization → Device biometrics: checks and authenticates (evidence: `macos/Classes/BiometricAuthorization.swift`)
