Updated main.dart to provide ApiSettingsViewModel at the top-level using MultiProvider. This ensures that the ViewModel is accessible throughout the app, allowing for dynamic updates to the API's base URL.
This commit refactors the main.dart file to include service initialization and dependency injection:
- RestApiUtility Initialization: Initialize the RestApiUtility with a mock API endpoint.
- Service Initialization: Initialize ChatService and TaskService with the created RestApiUtility.
- Dependency Injection: Pass the initialized services to MyApp constructor.
- Provider Update: Replace the ChangeNotifierProvider creation in MultiProvider to use the new ChatViewModel and TaskViewModel initialized with the respective services.
This setup allows for better separation of concerns and easier testing, as the services are now decoupled from the view models.
In this commit, the app underwent significant UI improvements by leveraging new, more modular widgets (NewTaskButton and TaskListTile). This ensures better code maintainability and a cleaner architecture.
Key changes include:
Integrated ChangeNotifierProvider in main.dart to facilitate the creation and broadcasting of TaskViewModel.
Refactored TaskView to utilize the newly created NewTaskButton and TaskListTile widgets.
Updated MainLayout to reflect the changes and provide a more cohesive user experience.