Integrate ApiSettingsViewModel into main.dart

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 is contained in:
hunteraraujo
2023-09-02 17:42:58 -07:00
parent b0bd42a57e
commit e69e683f70

View File

@@ -1,3 +1,4 @@
import 'package:auto_gpt_flutter_client/viewmodels/api_settings_viewmodel.dart';
import 'package:flutter/material.dart';
import 'views/main_layout.dart';
import 'package:provider/provider.dart';
@@ -42,6 +43,7 @@ class MyApp extends StatelessWidget {
create: (context) => ChatViewModel(chatService)),
ChangeNotifierProvider(
create: (context) => TaskViewModel(taskService)),
ChangeNotifierProvider(create: (context) => ApiSettingsViewModel()),
],
child: const MainLayout(),
), // Set MainLayout as the home screen of the app