How yashrajsinhyz/single_touch_gesture works
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.