-
Notifications
You must be signed in to change notification settings - Fork 44.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into integrate-benchmark-autogpt
- Loading branch information
Showing
7 changed files
with
185 additions
and
28 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:auto_gpt_flutter_client/viewmodels/skill_tree_viewmodel.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
// TODO: Add view model for task queue instead of skill tree view model | ||
class TaskQueueView extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final viewModel = Provider.of<SkillTreeViewModel>(context); | ||
|
||
// Reverse the node hierarchy | ||
final reversedHierarchy = | ||
viewModel.selectedNodeHierarchy?.reversed.toList() ?? []; | ||
|
||
return Material( | ||
color: Colors.white, | ||
child: Stack( | ||
children: [ | ||
// The list of tasks (tiles) | ||
ListView.builder( | ||
itemCount: reversedHierarchy.length, | ||
itemBuilder: (context, index) { | ||
final node = reversedHierarchy[index]; | ||
return Container( | ||
margin: EdgeInsets.fromLTRB(20, 5, 20, 5), | ||
decoration: BoxDecoration( | ||
color: Colors.white, // white background | ||
border: Border.all( | ||
color: Colors.black, width: 1), // thin black border | ||
borderRadius: BorderRadius.circular(4), // small corner radius | ||
), | ||
child: ListTile( | ||
title: Center(child: Text('Node ID: ${node.id}')), | ||
subtitle: Center(child: Text('Color: ${node.color}')), | ||
), | ||
); | ||
}, | ||
), | ||
|
||
// Checkmark button at the bottom right | ||
Positioned( | ||
bottom: 50, | ||
right: 50, | ||
child: Tooltip( | ||
message: 'Run suite of tests', | ||
child: ElevatedButton( | ||
onPressed: () { | ||
// Add your logic here to run the suite of tests | ||
}, | ||
child: Icon(Icons.check, color: Colors.green), | ||
style: ButtonStyle( | ||
shape: MaterialStateProperty.all<RoundedRectangleBorder>( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(8.0), | ||
), | ||
), | ||
backgroundColor: MaterialStateProperty.all(Colors.white), | ||
side: MaterialStateProperty.all( | ||
BorderSide(color: Colors.green, width: 3)), | ||
minimumSize: | ||
MaterialStateProperty.all(Size(50, 50)), // Square size | ||
padding: MaterialStateProperty.all(EdgeInsets.all(0)), | ||
), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |