mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-22 22:54:22 +01:00
Add SideBarView with Toggleable Icons
This commit is contained in:
41
frontend/lib/views/side_bar_view.dart
Normal file
41
frontend/lib/views/side_bar_view.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SideBarView extends StatelessWidget {
|
||||
final ValueNotifier<String> selectedViewNotifier;
|
||||
|
||||
SideBarView({required this.selectedViewNotifier});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
child: ValueListenableBuilder(
|
||||
valueListenable: selectedViewNotifier,
|
||||
builder: (context, String selectedView, _) {
|
||||
return SizedBox(
|
||||
width: 60,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
IconButton(
|
||||
splashRadius: 0.1,
|
||||
color:
|
||||
selectedView == 'TaskView' ? Colors.blue : Colors.black,
|
||||
icon: Icon(Icons.chat),
|
||||
onPressed: () => selectedViewNotifier.value = 'TaskView',
|
||||
),
|
||||
IconButton(
|
||||
splashRadius: 0.1,
|
||||
color: selectedView == 'SkillTreeView'
|
||||
? Colors.blue
|
||||
: Colors.black,
|
||||
icon: Icon(Icons.emoji_events), // trophy icon
|
||||
onPressed: () =>
|
||||
selectedViewNotifier.value = 'SkillTreeView',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user