From e69e683f70fab81ed485c2fa275cd5eb14c75567 Mon Sep 17 00:00:00 2001 From: hunteraraujo Date: Sat, 2 Sep 2023 17:42:58 -0700 Subject: [PATCH] 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. --- lib/main.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 467cc2a6..ade23b4c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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