# yashrajsinhyz/single_touch_gesture architecture

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

- Interactive diagram: https://gitdiagram.com/yashrajsinhyz/single_touch_gesture
- Repository: https://github.com/yashrajsinhyz/single_touch_gesture

## Overview

##### Main Components
- Core Library: Represent the "lib" folder as the heart of the package. This includes:
- single_touch_gesture.dart (entry point for the public API).
- The "src" folder containing internal modules such as single_pointer_recognizer.dart and single_touch_widget.dart that implement the logic to restrict gestures.
- Example Application: Represent the "example" directory as a separate module that demonstrates the package’s usage. This example app shows how the package integrates into a full Flutter application covering multiple platforms (Android, iOS, macOS, etc.).
- Test Suite: Include the “test” directory that contains unit tests (e.g., single_touch_gesture_test.dart) to validate proper functionality.

##### Relationships & Interactions
- The Core Library modules interact internally where single_touch_gesture.dart exposes and coordinates functionalities provided by the underlying “src” components.
- The Test Suite interacts with the Core Library directly to execute automated tests.

##### Architectural Patterns & Design Principles
- Modularity: The separation into the core library and the example demonstrates a clean separation of concerns. The core package encapsulates the gesture prevention functionality, while the example application serves as a practical demonstration.
- Lightweight & Focused: The package focuses solely on intercepting gesture events to prevent multi-touch – emphasizing simplicity and ease of integration into any Flutter widget.
- Cross-platform Setup: The presence of platform-specific folders within the example (android, ios, linux, macos, windows, web) shows adherence to Flutter’s cross-platform principles. Indicate these as platform-specific adaptations that leverage a common Flutter framework.

##### Relevant Technologies & Frameworks
- Dart Language: Since the project is a Flutter package, it is built entirely using Dart.
- Build and Dependency Management: Highlight the role of pubspec.yaml (present in both the root and example) which manages dependencies and configurations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Flutter & Dart"]:::tech

    subgraph "Core Library (lib)"
        pubAPI["Public API (single_touch_gesture.dart)"]:::core
        recognizer["Gesture Recognizer (single_pointer_recognizer.dart)"]:::core
        widget["Gesture Widget (single_touch_widget.dart)"]:::core
    end

    pubAPI -->|"triggers"| recognizer
    pubAPI -->|"triggers"| widget

    subgraph "Example Application"
        exampleApp["Example App"]:::example
        subgraph "Platform Integrations"
            android["Android"]:::platform
            ios["iOS"]:::platform
            linux["Linux"]:::platform
            macos["macOS"]:::platform
            windows["Windows"]:::platform
            web["Web"]:::platform
        end
    end

    testSuite["Test Suite (single_touch_gesture_test.dart)"]:::test
    gestureSys["Flutter Gesture System (GestureDetector,RawGestureDetector)"]:::tech

    A --> pubAPI
    A --> exampleApp
    A --> testSuite
    A --> gestureSys

    exampleApp -->|"uses"| pubAPI
    testSuite -->|"tests"| pubAPI
    pubAPI -->|"integrates"| gestureSys

    click pubAPI "https://github.com/yashrajsinhyz/single_touch_gesture/blob/main/lib/single_touch_gesture.dart"
    click recognizer "https://github.com/yashrajsinhyz/single_touch_gesture/blob/main/lib/src/single_pointer_recognizer.dart"
    click widget "https://github.com/yashrajsinhyz/single_touch_gesture/blob/main/lib/src/single_touch_widget.dart"
    click exampleApp "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/"
    click testSuite "https://github.com/yashrajsinhyz/single_touch_gesture/blob/main/test/single_touch_gesture_test.dart"
    click android "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/android"
    click ios "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/ios"
    click linux "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/linux"
    click macos "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/macos"
    click windows "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/windows"
    click web "https://github.com/yashrajsinhyz/single_touch_gesture/tree/main/example/web"

    classDef core fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef example fill:#A3E4D7,stroke:#1D8348,stroke-width:2px;
    classDef test fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef platform fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef tech fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
```
