How shreemanarjun/flutter_sharez works
Project Type & Purpose
• Flutter Sharez is a multi-platform mobile/desktop/web application built using Flutter.
• Its primary purpose is to enable file sharing between various devices through sender and receiver functionalities.
• It uses Riverpod for state management, AutoRoute for navigation, and integrates several packages for networking (dio), storage (hive_flutter), and more.
File Structure
• Top-Level Platform Directories: Notice separate directories for android, ios, macos, and web. These represent how the Flutter project is configured to run on different platforms.
• lib Directory: This is the heart of the application. It is organized into subdirectories:
• app and shared: Core application bootstrap and shared widgets/components.
• core: Contains foundational modules such as local_storage, routing (including auto_route configuration), theming, and global helper utilities.
• data: Contains models for file handling, server info, and services categorized into sender and receiver functionalities.
• features: Divided into individual modules (confirm_connection, counter, device_share, downloads, file_selector, receive, send, settings, update_app_version, etc.) each encapsulating a particular functional area with its own controller, view, state and sometimes service integration.
• Additional Directories: Testing, configuration files (pubspec.yaml, analysis_options.yaml), GitHub workflows, and localization assets (l10n) that provide further structure and tooling support.
Key Architectural Components to Capture
a. UI / Presentation Layer:
• Visual Components & Screens: Represented by the "features" directory, including screens for sending/receiving files, home, settings, dialogs, etc.
• Navigation: Managed through auto_route in the core/router folder.
• Theme & Localization: Handled by core/theme and l10n folders.
b. Business Logic / State Management:
• Riverpod Providers: Distributed throughout the project in feature-specific state management (e.g., counter, file downloads, selected file state, connectivity) and in shared pods.
• Controllers/Notifiers: Found within various features that define interaction logic.
c. Data Layer:
• Models: Under lib/data/model showing file models, server models, update models, etc.
• Services: Separated into sender and receiver services that encapsulate file transfer logic.
• Network & API Clients: In the shared/api_client directory, handling HTTP communication via packages like dio.
• Local Storage: Provided under core/local_storage using implementations like Hive.
d. Platform Abstraction:
• Specific configurations and platform-dependent files for Android, iOS, macos, and web ensuring native integration.