How bmin-mit/floating-notes works
Main Components
• Cross-platform Flutter Application Core – This is the central part of your system, where the Dart code and Flutter framework reside.
• UI/Presentation Layer – Under the “lib/src/screens” (for pages like home and note creation) and “lib/src/widgets” (for note lists, editors, and buttons). These components define the user interfaces.
• Business Logic Layer (BLoC) – Found in “lib/src/blocs/notes”. This layer handles state management and event processing for note-related operations.
• Data Layer – Includes “lib/src/models” (e.g., note.dart representing the data model) and “lib/src/resources/notes” (the provider and repository for handling and abstracting data operations).
• Platform Specific Launchers – All directories like “android”, “ios”, “linux”, “macos”, “windows”, and “web” illustrate how Flutter packages its core code into native projects. They interact with the Flutter engine and serve as the entry points for the app on each platform.
Relationships and Interactions
• The UI Layer sends user actions to the Business Logic (BLoC), which then processes events and updates state.
• The BLoC communicates with the Data Layer (via the notes provider and repository) to fetch, update, or store note data.
• The Data Layer accesses and formats the data (based on the note model) for use by the BLoC.
• At runtime, the Flutter engine (managed by each platform-specific project) integrates the cross-platform code, handling rendering and platform channel communications.
Architectural Patterns and Key Design Principles
• The separation of concerns is enforced via the layered approach: UI, Business Logic (using the BLoC pattern), and Data.
• This design supports modularity and testability, as each layer is decoupled from the others.
• Use of the “provider” pattern within the “notes_provider” and “notes_repository” which may abstract data sources (local storage, APIs, etc.) even though this project is minimal and may only use local state.
• The cross-platform nature of Flutter is ensured by generating multiple platform-specific projects that integrate with the single shared codebase.
Relevant Technologies, Frameworks, and Libraries
• Flutter & Dart – The foundational technology for building the UI, managing state through the BLoC pattern, and overall application logic.
• BLoC Library – Evidenced by files like “notes_bloc.dart”, “notes_event.dart”, and “notes_state.dart.”
• Native platform projects – Managed through Gradle for Android, Xcode for iOS/macOS, and CMake for Linux/Windows.
• Resource & Model Management – Handled in the “lib/src/models” and “lib/src/resources” directories.