# simformsolutionspvtltd/flutter_showcaseview architecture

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

- Interactive diagram: https://gitdiagram.com/simformsolutionspvtltd/flutter_showcaseview
- Repository: https://github.com/simformsolutionspvtltd/flutter_showcaseview

## Overview

##### Project type and purpose
- This is an open-source Flutter package (“showcaseview”) designed to let app developers highlight UI widgets step by step in their Flutter apps. It provides a public API (in lib/showcaseview.dart), a set of internal modules under lib/src, and a full Flutter example in the “example” directory.

##### File structure
- Top-level package files: pubspec.yaml, README.md, CHANGELOG, LICENSE, CI workflows (.github/workflows).
- Library source:
- lib/showcaseview.dart – public API surface, re-exports and entry point.
- lib/src/constants, enum, models, core modules (showcase_controller, overlay_builder, measure_size, get_position).
- lib/src/showcase and lib/src/tooltip subdirectories – implementation of the two kinds of showcases and tooltips.
- lib/src/widget – helper widgets (action buttons, progress indicators, transitions).
- Example app: full multi-platform Flutter project under “example/” demonstrating usage on Android, iOS, macOS, Windows, Linux, web.
- CI/CD: GitHub Actions workflows for Flutter test and publish.
- Meta/configuration: analysis_options.yaml, CODE_OF_CONDUCT, CONTRIBUTING, ISSUE and PR templates.

##### README for additional insights
- Describes public API usage: ShowCaseWidget, Showcase, Showcase.withWidget, GlobalKey management, lifecycle methods (startShowCase, next, previous, dismiss), configuration options for tooltips and actions.
- Highlights features: auto-play, auto-scroll, custom tooltips, action buttons, animations, barrier interactions.

a. Main components
- Client App (any Flutter app that consumes this package).
- Public API layer (showcaseview.dart): entry point for ShowCaseWidget & Showcase widgets.
- Controller & Core Logic (showcase_controller.dart): sequencing logic, state management.
- Utility modules:
– get_position.dart & measure_size.dart (locating target widgets).
– overlay_builder.dart & shape_clipper.dart (building and clipping the overlay).
- Presentation modules:
– Tooltip widget tree (animated_tooltip_layout.dart, arrow_painter.dart, tooltip_widget.dart).
– Showcase widget tree (target_widget.dart, default tooltip text widget).
– Action widgets (tooltip_action_button_widget.dart, floating_action_widget, progress indicator).
- Configuration & Models: various model classes (TooltipActionConfig, TooltipActionButton, etc.)
- External systems: Flutter framework, Dart runtime, CI/CD pipelines (GitHub Actions).

b. Relationships and interactions
- The Client App instantiates ShowCaseWidget (root) and one or more Showcase widgets (children) with GlobalKeys.
- When startShowCase is called, ShowCaseWidget delegates to ShowcaseController.
- ShowcaseController for each key calls getPosition/measureSize → overlayBuilder builds an OverlayEntry with clipped barrier and tooltip widget.
- Presentation modules render animations; user interactions (tap, next, skip) call back to ShowcaseController to advance or dismiss.
- Config models flow top-down from public API through controller into presentation layer.

c. Architectural patterns and design principles
- Layered architecture: Public API → Controller/Use-case → Utility modules → Presentation widgets
- Observer/Publisher: ShowCaseWidget.of(context) exposes controller methods to the widget tree.
- Dependency injection via widget tree (passing configurations down to tooltips and actions).
- Separation of concerns: Measuring & positioning, building overlays, rendering tooltips, and handling user interactions are in distinct modules.

d. Key technologies, frameworks, libraries
- Dart & Flutter framework (widgets, rendering, overlays, animations).
- GitHub Actions for CI (flutter.yaml, publish.yaml)
- pub.dev package infrastructure (pubspec.yaml, CHANGELOG.md, semantic versioning).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client App
    ClientApp["Client App (Flutter App)"]:::ext

    %% Public API Layer
    subgraph "Public API Layer"
        PublicAPI["showcaseview.dart\n(Public API)"]:::publicAPI
    end

    %% Controller & Core Logic
    subgraph "Controller & Core Logic"
        Controller["ShowcaseController"]:::core
    end

    %% Utility Modules
    subgraph "Utility Modules"
        GetPos["get_position.dart"]:::util
        Measure["measure_size.dart"]:::util
        OverlayBuilder["overlay_builder.dart"]:::util
        ShapeClipper["shape_clipper.dart"]:::util
    end

    %% Configuration & Models
    subgraph "Configuration & Models"
        Model1["tooltip_action_config.dart"]:::model
        Model2["tooltip_action_button.dart"]:::model
        Model3["action_button_icon.dart"]:::model
        Model4["linked_showcase_data.dart"]:::model
    end

    %% Presentation: Tooltip Widget Tree
    subgraph "Presentation: Tooltip"
        ATL["animated_tooltip_layout.dart"]:::pres
        AP["arrow_painter.dart"]:::pres
        TLW["tooltip_layout_widget.dart"]:::pres
        TW["tooltip_widget.dart"]:::pres
        TT["tooltip.dart"]:::pres
        RAD["render_animation_delegate.dart"]:::pres
        ROM["render_object_manager.dart"]:::pres
        RPD["render_position_delegate.dart"]:::pres
    end

    %% Presentation: Showcase Widget Tree
    subgraph "Presentation: Showcase"
        Target["target_widget.dart"]:::pres
    end

    %% Presentation: Helper & Action Widgets
    subgraph "Helper & Action Widgets"
        TAWidget["tooltip_action_button_widget.dart"]:::pres
        AW["action_widget.dart"]:::pres
        DTTW["default_tooltip_text_widget.dart"]:::pres
        FAW["floating_action_widget.dart"]:::pres
        PCI["showcase_circular_progress_indicator.dart"]:::pres
        TST["tooltip_slide_transition.dart"]:::pres
    end

    %% Constants & Enums
    subgraph "Constants & Enumerations"
        Const["constants.dart"]:::model
        Enum["enum.dart"]:::model
    end

    %% Example App
    ExampleApp["Example App\n(example/)"]:::ext

    %% CI/CD
    CI["GitHub Actions\n(CI/CD)"]:::ext

    %% External Systems
    FlutterEngine["Flutter Framework & Dart Runtime"]:::ext

    %% Connections
    ClientApp -->|"uses"| PublicAPI
    PublicAPI -->|"delegates to"| Controller
    Controller -->|"uses"| GetPos
    Controller -->|"uses"| Measure
    Controller -->|"builds"| OverlayBuilder
    OverlayBuilder -->|"clips with"| ShapeClipper
    PublicAPI -->|"imports models"| Model1
    PublicAPI -->|"imports models"| Model2
    PublicAPI -->|"imports models"| Model3
    PublicAPI -->|"imports models"| Model4
    OverlayBuilder -->|"renders"| ATL
    ATL --> AP
    ATL --> TLW
    TLW --> TW
    TW --> TT
    TW --> RAD
    RAD --> ROM
    ROM --> RPD
    PublicAPI -->|"includes showcase widget"| Target
    TW --> TAWidget
    TW --> AW
    TW --> DTTW
    TW --> FAW
    TW --> PCI
    TW --> TST
    PublicAPI --> Const
    PublicAPI --> Enum
    ClientApp --> ExampleApp
    PublicAPI --> FlutterEngine
    CI --> PublicAPI

    %% Click Events
    click PublicAPI "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/showcaseview.dart"
    click Controller "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/showcase/showcase_controller.dart"
    click GetPos "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/get_position.dart"
    click Measure "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/measure_size.dart"
    click OverlayBuilder "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/overlay_builder.dart"
    click ShapeClipper "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/shape_clipper.dart"
    click Model1 "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/models/tooltip_action_config.dart"
    click Model2 "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/models/tooltip_action_button.dart"
    click Model3 "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/models/action_button_icon.dart"
    click Model4 "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/models/linked_showcase_data.dart"
    click ATL "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/animated_tooltip_layout.dart"
    click AP "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/arrow_painter.dart"
    click TLW "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/tooltip_layout_widget.dart"
    click TW "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/tooltip_widget.dart"
    click TT "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/tooltip.dart"
    click RAD "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/render_animation_delegate.dart"
    click ROM "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/render_object_manager.dart"
    click RPD "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip/render_position_delegate.dart"
    click Target "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/showcase/showcase.dart"
    click TAWidget "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/tooltip_action_button_widget.dart"
    click AW "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/widget/action_widget.dart"
    click DTTW "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/widget/default_tooltip_text_widget.dart"
    click FAW "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/widget/floating_action_widget.dart"
    click PCI "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/widget/showcase_circular_progress_indicator.dart"
    click TST "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/widget/tooltip_slide_transition.dart"
    click Const "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/constants.dart"
    click Enum "https://github.com/simformsolutionspvtltd/flutter_showcaseview/blob/master/lib/src/enum.dart"
    click ExampleApp "https://github.com/simformsolutionspvtltd/flutter_showcaseview/tree/master/example/"

    %% Styles
    classDef publicAPI fill:#add8e6,stroke:#000,stroke-width:1px
    classDef core fill:#90ee90,stroke:#000,stroke-width:1px
    classDef util fill:#ffa500,stroke:#000,stroke-width:1px
    classDef pres fill:#ffff99,stroke:#000,stroke-width:1px
    classDef model fill:#dda0dd,stroke:#000,stroke-width:1px
    classDef ext fill:#d3d3d3,stroke:#000,stroke-width:1px
```
