How wxlf1e/skeleton works
Main Components
• UI/Presentation Layer: Represented by the “lib/ui” folder which contains screens/views (such as login, register, home, splash, account, dictionary, and gemini) alongside common widgets. Indicate material and Cupertino styles for Android/iOS.
• Application/BLoC Layer: Capture the state management and business logic, e.g., the various cubits and state files (e.g., theme.cubit, login.cubit, splash.cubit) within the “lib/ui” subdirectories.
• Data Layer: Indicate the abstract repository interfaces and implementation details in “lib/data” (data sources, remote endpoints implemented in “lib/data/data_source”; models in “lib/data/model”; repository in “lib/data/repository”). Also include how Dio is used for networking interactions.
• Dependency Injection (DI): Represent the “lib/di” folder where the service locator (using Get It) is configured to wire up the various services, repositories, and BLoC components.
• Services/Utility Layer: Show additional helper classes and services such as “lib/services/shared_preference.dart” and the diverse helper functions in “lib/utils”, which support functionality like validators, debouncing, and extensions.
• Assets & Resources: Include assets like fonts, images, translations, and vectors (in the “assets” folder) used across the UI.
• Platform-Specific Integrations: Illustrate that the project is maintained across multiple platforms with dedicated directories for Android, iOS, Linux, macOS, Windows, and web. These handle platform-specific configuration, build files, and integration settings (including Firebase, Google services, etc.).
• External Systems: Mark external dependencies such as Firebase (for authentication), remote servers (consumed via Dio with interceptors), and perhaps cloud services supporting offline capabilities and potentially generative AI interactions.
Relationships and Data Flow
• BLoC layer to the Repository/Data layer to indicate that data and business logic are abstracted via clean interfaces.
• That the Repository layer utilizes the remote data source (e.g., endpoints defined under “lib/data/data_source/remote/endpoint”) to fetch or update data via network requests.
• That Dependency Injection (DI) ties together the networking components, repositories, and BLoC classes, ensuring decoupling and easier testing.
• Platform-specific adapters that allow Flutter code to dispatch platform-specific UI or services based on the target (Android, iOS, etc.).
Architectural Patterns and Design Principles
• Clean Architecture or layered approach: UI, Business Logic, and Data layers.
• Use of patterns such as dependency injection (with Get It), state management (BLoC), advanced routing (GoRouter), and modularization.
• Use annotations or legends to point out key libraries/technologies like Flutter SDK, Dart, BLoC, Dio, Firebase, and Get It along with their responsibilities.