# google/flutter.widgets architecture

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

- Interactive diagram: https://gitdiagram.com/google/flutter.widgets
- Repository: https://github.com/google/flutter.widgets

## Overview

##### Project type and purpose
- This is a monorepo containing multiple standalone Flutter widget packages developed by Google.
- Each package provides a reusable UI component (e.g., tree view, linked scroll controller, scrollable list, self-storing inputs, visibility detector).
- The repo also contains CI/CD workflows, contribution guidelines, and helper scripts under the tool/ directory.

##### File structure
- Top‐level directories and files:
- `.github/workflows/build.yaml` – GitHub Actions build & test pipeline
- `packages/` – each subfolder is a Flutter package with its own `lib/`, `example/`, `test/`, `pubspec.yaml`
- `tool/` – scripts for generating documentation and validating CI actions
- Root‐level CI, license, contribution docs, and analysis options for linting
- Each package follows the same pattern:
- `lib/src/` – core implementation
- `lib/*.dart` – public API
- `example/` – sample Flutter app demonstrating usage
- `test/` – unit and widget tests
- Key external dependency: Flutter SDK and pub.dev package manager.

##### README for additional insights
- The README lists all packages, their descriptions, and links to pub.dev.

##### Detail
- Five packages individually, showing their internal structure (lib, example, test).
- How `.github/workflows/build.yaml` references each package’s test suite.
- `tool/` scripts as part of the build/test cycle.
- External dependencies and where they integrate (e.g., Flutter SDK in build step, pub.dev in publish step).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Root
    Developer((Developer)):::external
    MonorepoRoot["Monorepo Root"]:::root
    Developer -->|"clone & commit"| MonorepoRoot

    %% CI/CD Pipeline
    CICDPipeline(["CI/CD Pipeline"]):::ci
    MonorepoRoot --> CICDPipeline

    %% Tooling Scripts
    subgraph "Tooling Scripts"
        DocGen["Generate README"]:::tool
        CIValidate["Validate Actions"]:::tool
    end
    MonorepoRoot --> DocGen
    MonorepoRoot --> CIValidate
    CICDPipeline --> DocGen
    CICDPipeline --> CIValidate

    %% Packages Group
    subgraph "Packages"
        direction TB

        subgraph "flutter_simple_treeview" 
            direction TB
            FST_API["Public API"]:::package
            FST_Core["Core Implementation"]:::package
            FST_Example["Example App"]:::package
            FST_Tests["Tests"]:::package
            FST_API --> FST_Example
            FST_API --> FST_Tests
        end

        subgraph "linked_scroll_controller"
            direction TB
            LSC_API["Public API"]:::package
            LSC_Tests["Tests"]:::package
            LSC_API --> LSC_Tests
        end

        subgraph "scrollable_positioned_list"
            direction TB
            SPL_API["Public API"]:::package
            SPL_Core["Core Implementation"]:::package
            SPL_Example["Example App"]:::package
            SPL_Tests["Tests"]:::package
            SPL_API --> SPL_Example
            SPL_API --> SPL_Tests
        end

        subgraph "self_storing_input"
            direction TB
            SSI_API["Public API"]:::package
            SSI_Core["Core Implementation"]:::package
            SSI_Example["Example App"]:::package
            SSI_Tests["Tests"]:::package
            SSI_API --> SSI_Example
            SSI_API --> SSI_Tests
        end

        subgraph "visibility_detector"
            direction TB
            VD_API["Public API"]:::package
            VD_Core["Core Implementation"]:::package
            VD_Example["Example App"]:::package
            VD_Tests["Tests"]:::package
            VD_API --> VD_Example
            VD_API --> VD_Tests
        end
    end
    MonorepoRoot --> Packages

    %% CI interactions with packages
    CICDPipeline -->|analyze & test| FST_Tests
    CICDPipeline -->|analyze & test| LSC_Tests
    CICDPipeline -->|analyze & test| SPL_Tests
    CICDPipeline -->|analyze & test| SSI_Tests
    CICDPipeline -->|analyze & test| VD_Tests

    %% External Dependencies
    FlutterSDK(["Flutter SDK"]):::external
    PubDev(("pub.dev")):::external
    CICDPipeline -->|"build & runtime"| FlutterSDK
    FST_Example -->|"runs on"| FlutterSDK
    SPL_Example -->|"runs on"| FlutterSDK
    SSI_Example -->|"runs on"| FlutterSDK
    VD_Example -->|"runs on"| FlutterSDK
    CICDPipeline -->|publish| PubDev

    %% Click Events
    click MonorepoRoot "https://github.com/google/flutter.widgets/tree/master/./"
    click CICDPipeline "https://github.com/google/flutter.widgets/blob/master/.github/workflows/build.yaml"
    click DocGen "https://github.com/google/flutter.widgets/blob/master/tool/generate_readme.dart"
    click CIValidate "https://github.com/google/flutter.widgets/blob/master/tool/validate_actions.dart"
    click FST_API "https://github.com/google/flutter.widgets/blob/master/packages/flutter_simple_treeview/lib/flutter_simple_treeview.dart"
    click FST_Core "https://github.com/google/flutter.widgets/tree/master/packages/flutter_simple_treeview/lib/src/"
    click FST_Example "https://github.com/google/flutter.widgets/tree/master/packages/flutter_simple_treeview/example/"
    click FST_Tests "https://github.com/google/flutter.widgets/tree/master/packages/flutter_simple_treeview/test/"
    click LSC_API "https://github.com/google/flutter.widgets/blob/master/packages/linked_scroll_controller/lib/linked_scroll_controller.dart"
    click LSC_Tests "https://github.com/google/flutter.widgets/tree/master/packages/linked_scroll_controller/test/"
    click SPL_API "https://github.com/google/flutter.widgets/blob/master/packages/scrollable_positioned_list/lib/scrollable_positioned_list.dart"
    click SPL_Core "https://github.com/google/flutter.widgets/tree/master/packages/scrollable_positioned_list/lib/src/"
    click SPL_Example "https://github.com/google/flutter.widgets/tree/master/packages/scrollable_positioned_list/example/"
    click SPL_Tests "https://github.com/google/flutter.widgets/tree/master/packages/scrollable_positioned_list/test/"
    click SSI_API "https://github.com/google/flutter.widgets/blob/master/packages/self_storing_input/lib/self_storing_input.dart"
    click SSI_Core "https://github.com/google/flutter.widgets/tree/master/packages/self_storing_input/lib/src/"
    click SSI_Example "https://github.com/google/flutter.widgets/tree/master/packages/self_storing_input/example/"
    click SSI_Tests "https://github.com/google/flutter.widgets/tree/master/packages/self_storing_input/test/"
    click VD_API "https://github.com/google/flutter.widgets/blob/master/packages/visibility_detector/lib/visibility_detector.dart"
    click VD_Core "https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector/lib/src/"
    click VD_Example "https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector/example/"
    click VD_Tests "https://github.com/google/flutter.widgets/tree/master/packages/visibility_detector/test/"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef root fill:#bbf,stroke:#333,stroke-width:1px
    classDef ci fill:#bfb,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef tool fill:#ffb,stroke:#333,stroke-width:1px
    classDef package fill:#fbf,stroke:#333,stroke-width:1px
```
