# jonbhanson/flutter_native_splash architecture

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

- Interactive diagram: https://gitdiagram.com/jonbhanson/flutter_native_splash
- Repository: https://github.com/jonbhanson/flutter_native_splash

## Overview

##### Project type and purpose
- This is an open-source Flutter plugin and CLI tool named flutter_native_splash.
- Purpose: read a YAML configuration, then generate and inject native splash-screen code and assets for Android, iOS, and Web in a host Flutter project.

##### File structure
- Top-level directories:
– bin/ (entry-point Dart scripts: create.dart, remove.dart)
– lib/ (core logic, config parsing, template definitions, platform modules)
– android/, ios/, web/ (native plugin code and podspec/package files for distribution)
– example/ (sample Flutter app demonstrating usage)
– test/ (unit tests for core logic)
– configuration and CI: .github/workflows, .travis.yml, analysis_options.yaml

- Patterns and roles:
– CLI layer (bin/) invokes core functions in lib/
– Core library splits into Config Parser, Template Engine, File Writer, Platform Modules
– Platform modules for Android, iOS, Web each modify or generate native files (XML, storyboard, CSS, index.html, asset drawables)
– Templates (lib/templates.dart) define file content and naming conventions
– Tests validate helper utils and core workflow

##### README for additional insights
- Describes features: dark mode support, Android 12 specifics, flavor support, preserve/remove methods
- Outlines which native files get modified on each platform

##### Elements
– CLI layer (e.g., yellow)
– Core engine (e.g., blue)
– Platform modules (e.g., green)
– External/CI (e.g., grey)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CLI Layer
    subgraph "CLI Layer"
        direction TB
        CreateCmd["Create Command"]:::cli
        RemoveCmd["Remove Command"]:::cli
    end

    %% Core Engine
    subgraph "Core Engine"
        direction TB
        CLICommands["Core Orchestrator / CLI Commands"]:::core
        ConfigLoader["Config Loader & Validator"]:::core
        TemplateEngine["Template Engine"]:::core
        HelperUtilsGroup["Helper Utilities"]:::core
        FlavorHelper["Flavor Helper"]:::core
        Constants["Constants"]:::core
        Enums["Enums"]:::core
    end

    %% Platform Modules
    subgraph "Platform Modules"
        direction TB
        AndroidGen["Android Generator"]:::platform
        AndroidNative["Android Plugin Native Code"]:::platform
        iOSGen["iOS Generator"]:::platform
        iOSNative["iOS Plugin Native Code"]:::platform
        WebGen["Web Generator"]:::platform
    end

    %% Host Project
    subgraph "Host Flutter Project File System"
        direction TB
        HostAndroid["Host Android Folder"]:::external
        HostiOS["Host iOS Folder"]:::external
        HostWeb["Host Web Folder"]:::external
    end

    %% External
    subgraph "External"
        direction TB
        ExampleApp["Example App"]:::external
        UnitTests["Unit Tests"]:::external
        CI["CI / Distribution"]:::external
    end

    %% Connections
    Developer["Developer"]:::external
    Developer -->|"runs cli"| CreateCmd
    Developer --> CreateCmd
    Developer --> RemoveCmd

    CreateCmd -->|"invokes"| CLICommands
    RemoveCmd --> CLICommands
    CLICommands -->|"loads config"| ConfigLoader
    ConfigLoader -->|"validates"| CLICommands
    CLICommands -->|"uses templates"| TemplateEngine
    CLICommands -->|"uses helpers"| HelperUtilsGroup
    HelperUtilsGroup --> FlavorHelper
    HelperUtilsGroup --> Constants
    HelperUtilsGroup --> Enums

    CLICommands -->|"calls"| AndroidGen
    CLICommands -->|"calls"| iOSGen
    CLICommands -->|"calls"| WebGen

    AndroidGen --> AndroidNative
    AndroidGen --> HostAndroid
    iOSGen --> iOSNative
    iOSGen --> HostiOS
    WebGen --> HostWeb

    UnitTests -->|"tests core"| ConfigLoader
    UnitTests --> HelperUtilsGroup
    ExampleApp --> HostAndroid
    ExampleApp --> HostiOS
    ExampleApp --> HostWeb
    CI --> Developer
    CI --> UnitTests

    %% Click Events
    click CreateCmd "https://github.com/jonbhanson/flutter_native_splash/blob/master/bin/create.dart"
    click RemoveCmd "https://github.com/jonbhanson/flutter_native_splash/blob/master/bin/remove.dart"
    click ConfigLoader "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/flutter_native_splash.dart"
    click CLICommands "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/cli_commands.dart"
    click TemplateEngine "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/templates.dart"
    click HelperUtilsGroup "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/helper_utils.dart"
    click FlavorHelper "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/flavor_helper.dart"
    click Constants "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/constants.dart"
    click Enums "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/enums.dart"
    click AndroidGen "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/android.dart"
    click AndroidNative "https://github.com/jonbhanson/flutter_native_splash/blob/master/android/src/main/java/net/jonhanson/flutter_native_splash/FlutterNativeSplashPlugin.java"
    click AndroidNative "https://github.com/jonbhanson/flutter_native_splash/blob/master/android/build.gradle"
    click iOSGen "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/ios.dart"
    click iOSNative "https://github.com/jonbhanson/flutter_native_splash/blob/master/ios/flutter_native_splash.podspec"
    click iOSNative "https://github.com/jonbhanson/flutter_native_splash/blob/master/ios/flutter_native_splash/Sources/flutter_native_splash/FlutterNativeSplashPlugin.m"
    click iOSNative "https://github.com/jonbhanson/flutter_native_splash/blob/master/ios/flutter_native_splash/Sources/flutter_native_splash/include/flutter_native_splash/FlutterNativeSplashPlugin.h"
    click WebGen "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/web.dart"
    click WebGen "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/flutter_native_splash_web.dart"
    click WebGen "https://github.com/jonbhanson/flutter_native_splash/blob/master/lib/remove_splash_from_web.dart"
    click ExampleApp "https://github.com/jonbhanson/flutter_native_splash/blob/master/example/lib/main.dart"
    click ExampleApp "https://github.com/jonbhanson/flutter_native_splash/tree/master/example/android/app/src/main/"
    click ExampleApp "https://github.com/jonbhanson/flutter_native_splash/blob/master/example/ios/Runner/Base.lproj/LaunchScreen.storyboard"
    click ExampleApp "https://github.com/jonbhanson/flutter_native_splash/blob/master/example/web/index.html"
    click UnitTests "https://github.com/jonbhanson/flutter_native_splash/blob/master/test/flutter_native_splash_test.dart"
    click UnitTests "https://github.com/jonbhanson/flutter_native_splash/blob/master/test/helper_utils_test.dart"

    %% Styles
    classDef cli fill:#f9f,stroke:#333,stroke-width:1px
    classDef core fill:#ccf,stroke:#333,stroke-width:1px
    classDef platform fill:#cfc,stroke:#333,stroke-width:1px
    classDef external fill:#eee,stroke:#333,stroke-width:1px
```
