How alexiscardozzo/enterpro_app works
Project Type and Purpose
• Type: A client-side, multi-platform educational app built with Flutter (mobile, web, desktop).
• Purpose: Gamified learning in math, finance, programming, with customizable avatars and progress tracking, all running locally (no remote server code in the repo).
File Structure
• Top-Level Directories:
• android, ios, macos, linux, windows, web → platform-specific runners & build scripts
• lib → core Dart code: models/, providers/, services/, screens/, main.dart
• assets → static files (avatars)
• test → widget tests
• Patterns & Layers:
• Presentation Layer: lib/screens/
• State Management: lib/providers/ using ChangeNotifier or similar
• Domain Models: lib/models/
• Data Layer: lib/services/database_helper.dart (SQLite via sqflite or similar)
• Platform Layer: Generated plugin registrants + native code in android/app/src, ios/Runner/, macos/Runner/ etc.
• Build & Config:
• Flutter CLI + pubspec.yaml for dependencies
• Gradle/Kotlin scripts for Android
• Xcode/CMake configs for iOS/macOS/Linux/Windows
Extract Architectural Insights from README
• Single-codebase Flutter front-end
• No dedicated backend—data persists locally
• Native performance via C++ plugins and Swift/C++ platform code
• Multi-platform targets (mobile, desktop, web)
Main Components & Their Interactions
a. Flutter Engine & Framework
• Renders UI, hosts Dart VM, invokes platform channels
b. Presentation Layer (Screens)
• Screens (HabitList, MathGameScreen, AvatarCustomization, etc.) present UI
• Depend on Providers for state
c. State Management (Providers)
• Expose methods & notify listeners
• E.g., HabitProvider, GamificationProvider
d. Data Layer (Services)
• DatabaseHelper → CRUD on local SQLite
e. Platform Layer
• Native runners (Android’s MainActivity.kt, iOS AppDelegate.swift, Linux main.cc, Windows main.cpp)
• Generated plugins integrate 3rd-party or custom C++ code for performance
f. Assets & Static Resources
• Local images (avatars) and web manifest
g. Tests
• widget_test.dart for UI behavior
Interaction Flow Example:
Screen → calls Provider → Provider calls DatabaseHelper → SQLite DB → returns raw data → Provider maps to Model → notifies Screen → UI updates.
Architectual Patterns & Principles
• Separation of Concerns: UI vs. state vs. data
• MVVM-style: Screens (View) + Providers (ViewModel) + Models (Model)
• Platform Abstraction via Flutter + platform channels
• Single source of truth in Providers