How flyapex/netplus works
Project type and purpose
• This is a cross-platform Flutter client application (“netplus”) targeting Android, iOS, Linux, macOS, Windows and Web.
• It presents a user-centric ordering/offers system: login, home, offers, orders, push notifications, connectivity checks.
High-level architecture overview
• The Flutter “engine” and host platform embedding live in each “android/”, “ios/”, etc. folder.
• The real app logic sits under “lib/” with a classic layered structure:
• Presentation Layer: “lib/view/…” (Widgets, pages)
• Business Logic Layer: “lib/controller/…” (NavController, PostController, UserController, DbController)
• Data Layer: “lib/api/api.dart” (network client), local persistence via DbController, plus Firebase Interaction in “lib/firebase_options.dart” and notification helpers.
A. Flutter Host & Engine (per-platform runners)
• Android embedding (MainActivity.kt)
• iOS embedding (AppDelegate.swift)
• Linux/macOS/Windows/ Web runner
B. Flutter Framework & Dart VM (single core)
C. Presentation Layer
• UI Widgets & Pages under “lib/view”
D. Business Logic Layer
• Controllers (Nav, Post, User, DB) under “lib/controller”
• Connectivity & Permissions helpers under “lib/utils”
E. Data Layer
• API client (“api.dart”) connecting to external REST endpoints
• Local persistence (DbController) – e.g. SQLite or local file
• Firebase (Auth, Analytics, Cloud Messaging)
F. External Services
• Third-party REST API
• Firebase Cloud Messaging & Analytics
• Google Services configuration (google-services.json, GoogleService-Info.plist)
Relationships & data flow
• User taps UI Widget → Presentation Layer → calls Business Logic Controller
• Controller → Data Layer:
• For network calls, invokes Api client → External REST API → JSON response → models (send/receive) → returns data to controller → updates UI
• For local cache, uses DbController → local DB → Controller
• For notifications, uses PushNotification and NotificationHelper → Firebase Cloud Messaging
• ConnectivityController monitors network state → informs controllers/UI of offline/online
• Permission helpers prompt OS to grant notification/location, etc.
Architectural patterns & design principles
• Separation of Concerns: clear division Presentation / Logic / Data
• MVVM-like or MVC-like layering with controllers as ViewModels
• Dependency injection via Bind (in “lib/utils/bind.dart”)
• Reactive updates: controllers push state changes back to UI widgets
• Platform-agnostic core in lib/; platform-specific runner only handles embedding.