Latest Front with debug

This commit is contained in:
mr
2024-08-30 12:52:32 +02:00
parent 8beddba367
commit 0b294a782c
42 changed files with 1367 additions and 925 deletions

View File

@@ -1,11 +1,14 @@
import 'package:flutter/material.dart';
import 'package:oc_front/core/models/shared_workspace_local.dart';
import 'package:oc_front/core/services/specialized_services/shared_service.dart';
import 'package:oc_front/core/services/specialized_services/workspace_service.dart';
import 'package:oc_front/models/response.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/pages/shared.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';
import 'package:oc_front/widgets/inputs/shallow_dropdown_input.dart';
GlobalKey<EndDrawerWidgetState> endDrawerKey = GlobalKey<EndDrawerWidgetState>();
class EndDrawerWidget extends StatefulWidget {
@@ -17,8 +20,6 @@ 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();
print(WorkspaceLocal.workspaces[WorkspaceLocal.current]!.shared);
print(SharedWorkspaceLocal.workspaces);
return Stack( children: [
Container(
color: Colors.white,
@@ -38,7 +39,19 @@ class EndDrawerWidgetState extends State<EndDrawerWidget> {
),
),
MenuWorkspaceWidget(simpliest: true, width: 400),
ShallowDropdownInputWidget(
current: WorkspaceLocal.current,
width: 400,
all: () async => WorkspaceLocal.getWorkspacesShallow(),
canRemove: (p0) => p0 != null,
remove: (p0) async {
await WorkspaceService().delete(context, p0, {}).then( (e) => WorkspaceLocal.deleteWorkspace(p0));
},
type: SharedWorkspaceType.workspace,
change: (String? change) {
WorkspaceLocal.changeWorkspace(change.toString());
}
),
Column( children: [
itemRows.isEmpty ? Container( height: MediaQuery.of(context).size.height - 100,
color: Colors.grey.shade300,
@@ -51,12 +64,29 @@ class EndDrawerWidgetState extends State<EndDrawerWidget> {
])
])
),
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 ?? "",) )
itemRows.isEmpty ? Container() : Positioned( bottom: 0, left: 0,
child: ShallowDropdownInputWidget(
type: SharedWorkspaceType.workspace,
all: () async => SharedWorkspaceLocal.workspaces.values.map(
(e) => Shallow(id: e.id ?? "", name: e.name ?? "") ).toList(),
current: WorkspaceLocal.workspaces[WorkspaceLocal.current]?.shared,
width: 400,
filled: Colors.grey.shade300,
hintColor: Colors.grey,
color: Colors.black,
canLoad: (String? change) => SharedWorkspaceLocal.workspaces[change] == null
|| !SharedWorkspaceLocal.workspaces[change]!.workspaces.map( (e) => e.id ).contains(WorkspaceLocal.current),
canRemove: (String? change) => SharedWorkspaceLocal.workspaces[change] == null
|| SharedWorkspaceLocal.workspaces[change]!.workspaces.map( (e) => e.id ).contains(WorkspaceLocal.current),
load: (String val) async {
await SharedService().addWorkspace(context, val, WorkspaceLocal.current ?? "");
SharedWorkspaceLocal.init(context, false);
},
remove: (String val) async {
await SharedService().removeWorkspace(context, val, WorkspaceLocal.current ?? "");
SharedWorkspaceLocal.init(context, false);
})
)
]
);
}