How garlictot/bye-distract works
Project Type and Purpose
• This is a cross-platform Flutter application (“flutter_application_1”) targeting Android, iOS, Linux, macOS, Windows and Web.
• The “lib” folder contains your Dart UI, business logic and data-access code (config/api_config.dart, models, pages).
• No server-side code is present here; this is purely a client-side app that likely calls external REST APIs.
File Structure
• Top-level “android”, “ios”, “linux”, “macos”, “windows” and “web” folders are the platform‐specific embedder/runners generated by Flutter.
• The “lib” folder holds all the Dart code:
• lib/main.dart – entry point
• lib/config/api_config.dart – endpoint configuration
• lib/models – data model definitions (e.g., Task)
• lib/pages – UI screens (login, register, study rooms, todo list, statistics, etc.)
• “test” folder contains widget tests.
• pubspec.yaml declares Flutter and plugin dependencies.
• Platform folders contain build scripts (e.g., Gradle for Android, Xcode projects for iOS/macOS, CMake for Linux/Windows).
README
• This is the default Flutter template README; no additional architectural notes are provided.
• We must infer architecture from files: a standard Flutter layered client.
a. Main Components
1. UI Layer (Dart/UI)
– Pages: login_page, register_page, study_room_page, etc.
2. Business‐Logic / Controller Layer (could be your set of state managers or controllers invoked by pages)
3. Data Layer
– API Config (api_config.dart)
– HTTP Client (Dart’s http or Dio library)
– Models (task.dart, study room models, etc.)
4. Flutter Engine & Embedder
– Platform channels bridge your Dart code and native platform
5. Platform Runners
– Android (MainActivity.kt + Gradle)
– iOS (AppDelegate.swift + Xcode)
– Linux, macOS, Windows, Web (their respective runner code)
6. External Services
– REST API server(s)
– (Optionally) Local storage / SQLite / SharedPreferences if used
b. Relationships and Interactions
• User taps UI → UI Layer invokes Business Logic
• Business Logic calls Data Layer → constructs HTTP request using api_config → remote API
• Remote API responds with JSON → Data Layer parses into Model objects
• Business Logic notifies UI → UI updates widgets
• UI may also trigger local caching via plugins (if implemented)
c. Architectural Patterns / Principles
• Layered Architecture: UI → Logic → Data
• Platform Abstraction: Flutter Engine isolates Dart code from native embedding
d. Key Technologies / Frameworks
• Flutter SDK / Dart
• Platform SDKs: Android SDK, iOS CocoaTouch, Linux CMake, macOS Xcode, Windows CMake, Web (HTML/JS)
• Networking: Dart http package or similar
• State management (setState, Provider, Bloc, etc., if present)