mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-27 19:04:25 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user