11import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh;
22import 'package:cookethflow/core/theme/colors.dart' ;
33import 'package:cookethflow/features/workspace/pages/canvas_page.dart' ;
4+ import 'package:cookethflow/features/workspace/providers/workspace_provider.dart' ;
45import 'package:cookethflow/features/workspace/widgets/export_project_button.dart' ;
56import 'package:cookethflow/features/workspace/widgets/toolbar.dart' ; // Assuming this might be used later
67import 'package:cookethflow/features/workspace/widgets/undo_redo_button.dart' ;
78import 'package:cookethflow/features/workspace/widgets/workspace_drawer.dart' ;
89import 'package:cookethflow/features/workspace/widgets/zoom_control_button.dart' ;
910import 'package:flutter/material.dart' ;
11+ import 'package:provider/provider.dart' ;
1012import 'package:flutter_screenutil/flutter_screenutil.dart' ;
1113import 'package:phosphor_flutter/phosphor_flutter.dart' ;
1214
@@ -20,33 +22,37 @@ class WorkspaceDesktop extends StatelessWidget {
2022 rh.ResponsiveLayoutHelper .getDeviceType (context) ==
2123 rh.DeviceType .desktop;
2224
23- return Scaffold (
24- backgroundColor: const Color (0xFFFF8F8F8 ),
25- body: Padding (
26- padding: EdgeInsets .symmetric (horizontal: 40. w, vertical: 40. h),
27- child: Stack (
28- children: [
29- // 1. CanvasPage - This should be the base layer, filling the entire available space
30- const CanvasPage (),
31-
32- const WorkspaceDrawer (),
33- SizedBox (width: 20. w),
34- // Undo/Redo Controls Container
35- Positioned (top: 0 ,left: 0.21 .sw,child: UndoRedoButton ()),
36- // Export project button
37- Positioned (top: 0 ,right: 0.02 .sw,child: ExportProjectButton ()),
38-
39- Positioned (right: 0 ,top: 0.15 .sh,child: ToolBar ()),
40-
41- // 3. Zoom Control - Positioned at the bottom right of the Stack
42- Positioned (
43- bottom: 0. h, // Aligns to the bottom edge of the Stack
44- right: 0. w, // Aligns to the right edge of the Stack
45- child: ZoomControlButton (),
25+ return Consumer <WorkspaceProvider >(
26+ builder: (context,provider,child) {
27+ return Scaffold (
28+ backgroundColor: provider.currentWorkspaceColor,
29+ body: Padding (
30+ padding: EdgeInsets .symmetric (horizontal: 40. w, vertical: 40. h),
31+ child: Stack (
32+ children: [
33+ // 1. CanvasPage - This should be the base layer, filling the entire available space
34+ const CanvasPage (),
35+
36+ const WorkspaceDrawer (),
37+ SizedBox (width: 20. w),
38+ // Undo/Redo Controls Container
39+ Positioned (top: 0 ,left: 0.21 .sw,child: UndoRedoButton ()),
40+ // Export project button
41+ Positioned (top: 0 ,right: 0.02 .sw,child: ExportProjectButton ()),
42+
43+ Positioned (right: 0 ,top: 0.15 .sh,child: ToolBar ()),
44+
45+ // 3. Zoom Control - Positioned at the bottom right of the Stack
46+ Positioned (
47+ bottom: 0. h, // Aligns to the bottom edge of the Stack
48+ right: 0. w, // Aligns to the right edge of the Stack
49+ child: ZoomControlButton (),
50+ ),
51+ ],
4652 ),
47- ] ,
48- ),
49- ),
53+ ) ,
54+ );
55+ }
5056 );
5157 }
5258}
0 commit comments