Skip to content

Commit e6b016c

Browse files
committed
Load layouts from the same page instantly in embedded preview.
1 parent cec5557 commit e6b016c

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/src/transformers/node_transformers/passive_rectangle_transformer.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,14 @@ class PassiveRectangleWidget extends StatelessWidget {
132132
if (node case PortalMixin portal)
133133
if (portal.showPortal &&
134134
portal.layoutID != null &&
135-
portal.pageID != null)
135+
portal.pageID != null && portal.canvasID != null)
136136
Positioned.fill(
137137
child: manager.layoutRetrievalBuilder(
138138
context,
139139
node.innerBoxLocal.size,
140-
portal.layoutID!,
141140
portal.pageID!,
141+
portal.layoutID!,
142+
portal.canvasID!,
142143
),
143144
)
144145
],

lib/src/transformers/widget_node_transformer_manager.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import '../functions/functions_repository.dart';
1414
typedef LayoutRetrieverBuilder = Widget Function(
1515
BuildContext context,
1616
SizeC bounds,
17-
String layoutID,
1817
String pageID,
18+
String layoutID,
19+
String canvasID,
1920
);
2021

2122
/// A wrapper class for both [PassiveNodeTransformerManager] and

lib/src/ui/layout_builder.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ class _CodelesslyLayoutBuilderState extends State<CodelesslyLayoutBuilder> {
114114
late final PassiveNodeTransformerManager transformerManager =
115115
PassiveNodeTransformerManager(
116116
nodeRegistry.getNodeByID,
117-
(context, bounds, layoutID, pageID) =>
117+
(context, bounds, pageID, layoutID, canvasID) =>
118118
widget.layoutRetrievalBuilder
119-
?.call(context, bounds, layoutID, pageID) ??
119+
?.call(context, bounds, pageID, layoutID, canvasID) ??
120120
CodelesslyLayoutRetriever(
121121
controller: widget.controller,
122-
layoutID: layoutID,
123122
pageID: pageID,
123+
layoutID: layoutID,
124124
bounds: bounds,
125125
),
126126
);

0 commit comments

Comments
 (0)