State Management
We use the Provider package for simple and efficient state management across the application. This ensures that our UI remains reactive and updates automatically when the underlying data changes.Why Provider?
Why Provider?
provider allows us to inject state objects (ChangeNotifiers) into the widget tree, making it easy to manage both local and global application states. It is a lightweight and flexible alternative to more complex patterns like BLoC.Dependency Injection (DI)
To keep our code decoupled and testable, we use a service locator pattern for Dependency Injection.GetIt Service Locator
The
get_it package acts as our central service locator. It provides global access to singleton instances of our repositories, services, and state objects.Communication & Networking
The Super App communicates with thestresspilot backend using RESTful APIs over HTTP.
HTTP Client
We utilize the
dio package for all HTTP requests. It features interceptors for authentication and logging, which can be found in core/network/http_client.dart.Key Features Architecture
Our application is built with a feature-based folder structure following Clean Architecture principles.Modular Features
Each feature (
projects, endpoints, results) is self-contained with its own data models, repositories, and presentation logic.Dynamic UI Generation
The UI for configuring endpoints is built dynamically using the
shadcn_ui component library, allowing us to render different input fields based on the selected plugin type.Core Packages Used
dio: For robust HTTP networking.provider: For reactive state management.get_it&injectable: For Dependency Injection.shadcn_ui: For a modern and consistent UI component library.stomp_dart_client: For real-time communication via STOMP/WebSockets.