# moberancompany/flutter_mo_app_update architecture

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

- Interactive diagram: https://gitdiagram.com/moberancompany/flutter_mo_app_update
- Repository: https://github.com/moberancompany/flutter_mo_app_update

## Overview

##### Main Components Identification

a) Flutter Plugin Layer
- Core Plugin Interface
- Platform-specific Implementations
- Model Layer
- Exception Handling

b) Platform-specific Native Layers
- Android Implementation
- iOS Implementation

c) External Components
- Remote Server (hosting info.json)
- App Stores (future implementation)

**┌─────────────────────┐**
- Flutter App       │
- ┘

**┌─────────────────────────────────────────┐**
- MoAppUpdate Plugin           │
- ┬──────────────┬───────────┤
- Interface  │    Models    │ Utilities │
- ┴──────────────┴───────────┘

**┌─────────────────┐    ┌─────────────────┐**
- Android     │    │       iOS       │
- Implementation │    │  Implementation │
- ┘    └─────────────────┘

**┌─────────────────┐    ┌─────────────────┐**
- Remote JSON   │    │   App Stores    │
- Server      │    │   (Future)      │
- ┘    └─────────────────┘

##### Data Flow Indicators
- Flow of update checks
- Self-update procedure
- Store update flows (future)

##### Future expansion possibilities

Keep the abstraction level focused on the architectural components while showing the key interactions that make the update system work. This will help developers understand both the current implementation and future expansion possibilities.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FA[Flutter App]
    end

    subgraph Plugin["MoAppUpdate Plugin"]
        direction TB
        PI["Platform Interface"]:::interface
        MC["Method Channel"]:::interface
        MEP["Main Entry Point"]:::interface

        subgraph Models["Model Layer"]
            direction TB
            SUM["Self Update Info Model"]:::model
            UIM["Update Info Model"]:::model
            UMM["Update Mode Model"]:::model
            USO["Update Self Option"]:::model
        end

        subgraph Utils["Utility Layer"]
            direction TB
            AU["Android Utility"]:::util
            JU["JSON Utility"]:::util
        end

        subgraph Exceptions["Exception Layer"]
            NSP["Not Supported Platform"]:::exception
        end
    end

    subgraph Native["Platform Implementation"]
        direction TB
        AN["Android Native"]:::android
        IOS["iOS Native"]:::ios
    end

    subgraph External["External Services"]
        direction TB
        RS["Remote JSON Server"]:::external
        AS["App Stores<br/>(Future)"]:::external
    end

    %% Connections
    FA --> PI
    PI --> MC
    MC --> MEP
    MC --> Models
    MC --> Utils
    MC --> Exceptions
    MC --> AN
    MC --> IOS
    AN -.-> RS
    IOS -.-> RS
    AN -.- AS
    IOS -.- AS

    %% Click Events
    click PI "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/mo_app_update_platform_interface.dart"
    click MC "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/mo_app_update_method_channel.dart"
    click MEP "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/mo_app_update.dart"
    click NSP "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/exception/not_supported_platform_exception.dart"
    click SUM "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/model/mo_app_self_update_info_model.dart"
    click UIM "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/model/mo_app_update_info.dart"
    click UMM "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/model/mo_app_update_mode.dart"
    click USO "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/model/mo_app_update_self_option.dart"
    click AU "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/util/android_util.dart"
    click JU "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/lib/util/json_util.dart"
    click AN "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/android/src/main/kotlin/com/moberan/mo_app_update/MoAppUpdatePlugin.kt"
    click IOS "https://github.com/MoberanCompany/flutter_mo_app_update/blob/main/ios/Classes/MoAppUpdatePlugin.swift"

    %% Styles
    classDef interface fill:#2196F3,stroke:#1976D2,color:white
    classDef model fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef util fill:#FF9800,stroke:#F57C00,color:white
    classDef exception fill:#F44336,stroke:#D32F2F,color:white
    classDef android fill:#4CAF50,stroke:#388E3C,color:white
    classDef ios fill:#9E9E9E,stroke:#757575,color:white
    classDef external fill:#FF5722,stroke:#E64A19,color:white

    %% Legend
    subgraph Legend
        L1["Interface"]:::interface
        L2["Model"]:::model
        L3["Utility"]:::util
        L4["Exception"]:::exception
        L5["Android"]:::android
        L6["iOS"]:::ios
        L7["External"]:::external
    end
```
