Shared WS

This commit is contained in:
mr
2024-08-27 15:38:21 +02:00
parent 36a70db69f
commit 6ba32a7dfa
19 changed files with 479 additions and 87 deletions

View File

@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:oc_front/core/models/shared_workspace_local.dart';
import 'package:oc_front/models/search.dart';
import 'package:oc_front/pages/catalog.dart';
import 'package:oc_front/core/models/workspace_local.dart';
import 'package:oc_front/widgets/items/item_row.dart';
import 'package:oc_front/widgets/menu_clipper/shared_workspace_menu.dart';
import 'package:oc_front/widgets/menu_clipper/workspace_menu.dart';
GlobalKey<EndDrawerWidgetState> endDrawerKey = GlobalKey<EndDrawerWidgetState>();
@@ -15,36 +17,47 @@ class EndDrawerWidgetState extends State<EndDrawerWidget> {
@override Widget build(BuildContext context) {
List<ItemRowWidget> itemRows = WorkspaceLocal.items.map(
(e) => ItemRowWidget(contextWidth: 400, item: e, keys: [endDrawerKey, CatalogFactory.key],)).toList();
return Container(
color: Colors.white,
width: 400,
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
print(WorkspaceLocal.workspaces[WorkspaceLocal.current]!.shared);
print(SharedWorkspaceLocal.workspaces);
return Stack( children: [
Container(
color: Colors.white,
width: 400,
height: MediaQuery.of(context).size.height,
child: Column( children: [
Container(
width: 400,
height: 50,
decoration: const BoxDecoration(color: Color.fromRGBO(38, 166, 154, 1)),
child: const Center(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(padding: EdgeInsets.only(right: 20), child: Icon(Icons.shopping_cart_outlined, size: 18, color: Colors.white)),
Text("Workspace", style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600))
])
Container(
width: 400,
height: 50,
decoration: const BoxDecoration(color: Color.fromRGBO(38, 166, 154, 1)),
child: const Center(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(padding: EdgeInsets.only(right: 20), child: Icon(Icons.shopping_cart_outlined, size: 18, color: Colors.white)),
Text("Workspace", style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600))
])
),
),
),
MenuWorkspaceWidget(simpliest: true, width: 400),
itemRows.isEmpty ? Container( height: MediaQuery.of(context).size.height - 100,
color: Colors.grey.shade300,
child: const Center(child: Text("WORKSPACE IS EMPTY",
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white))))
: Container( child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Column( children: itemRows)
)),
])
)
MenuWorkspaceWidget(simpliest: true, width: 400),
Column( children: [
itemRows.isEmpty ? Container( height: MediaQuery.of(context).size.height - 100,
color: Colors.grey.shade300,
child: const Center(child: Text("WORKSPACE IS EMPTY",
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w600, color: Colors.white))))
: Container( height: MediaQuery.of(context).size.height - 100, child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column( children: [ ...itemRows, Container(height: 50)])
)),
])
])
),
Positioned( bottom: 0, left: 0,
child: SharedMenuWorkspaceWidget( width: 400,
excluded: const [],
before: WorkspaceLocal.workspaces[WorkspaceLocal.current]!.shared,
selected: WorkspaceLocal.workspaces[WorkspaceLocal.current]!.shared,
reverse: itemRows.isEmpty, contextID: WorkspaceLocal.current ?? "",) )
]
);
}
}