mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-07 15:24:31 +01:00
Conditionally show skill tree toggle based off isDeveloperModeEnabled
This commit is contained in:
@@ -30,7 +30,8 @@ class SettingsViewModel extends ChangeNotifier {
|
||||
Future<void> _loadPreferences() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
_isDarkModeEnabled = prefs.getBool('isDarkModeEnabled') ?? false;
|
||||
_isDeveloperModeEnabled = prefs.getBool('isDeveloperModeEnabled') ?? false;
|
||||
// TODO: We should make this disable test suites
|
||||
_isDeveloperModeEnabled = prefs.getBool('isDeveloperModeEnabled') ?? true;
|
||||
_baseURL = prefs.getString('baseURL') ?? 'http://127.0.0.1:8000/ap/v1';
|
||||
_restApiUtility.updateBaseURL(_baseURL);
|
||||
_continuousModeSteps = prefs.getInt('continuousModeSteps') ?? 10;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:auto_gpt_flutter_client/viewmodels/settings_viewmodel.dart';
|
||||
import 'package:auto_gpt_flutter_client/viewmodels/skill_tree_viewmodel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -30,16 +31,18 @@ class SideBarView extends StatelessWidget {
|
||||
? null
|
||||
: () => selectedViewNotifier.value = 'TaskView',
|
||||
),
|
||||
IconButton(
|
||||
splashRadius: 0.1,
|
||||
color: selectedView == 'SkillTreeView'
|
||||
? Colors.blue
|
||||
: Colors.black,
|
||||
icon: const Icon(Icons.emoji_events),
|
||||
onPressed: skillTreeViewModel.isBenchmarkRunning
|
||||
? null
|
||||
: () => selectedViewNotifier.value = 'SkillTreeView',
|
||||
),
|
||||
if (Provider.of<SettingsViewModel>(context, listen: true)
|
||||
.isDeveloperModeEnabled)
|
||||
IconButton(
|
||||
splashRadius: 0.1,
|
||||
color: selectedView == 'SkillTreeView'
|
||||
? Colors.blue
|
||||
: Colors.black,
|
||||
icon: const Icon(Icons.emoji_events),
|
||||
onPressed: skillTreeViewModel.isBenchmarkRunning
|
||||
? null
|
||||
: () => selectedViewNotifier.value = 'SkillTreeView',
|
||||
),
|
||||
IconButton(
|
||||
splashRadius: 0.1,
|
||||
color: selectedView == 'SettingsView'
|
||||
|
||||
Reference in New Issue
Block a user