@@ -137,15 +137,7 @@ class PassiveRectangleWidget extends StatelessWidget {
137137 Positioned .fill (
138138 child: settings.isPreview
139139 // Show stripes in preview mode
140- ? CustomPaint (
141- painter: StripePainter (
142- bgColor: const Color (0xFFBA79F4 ).withOpacity (0.1 ),
143- stripeColor: const Color (0xFFBA79F4 ),
144- nbOfStripes:
145- (node.outerBoxGlobal.size.longestSide / 20 )
146- .round (),
147- ),
148- )
140+ ? PortalPreviewWidget (node: node)
149141 : manager.layoutRetrievalBuilder (
150142 context,
151143 node.innerBoxLocal.size,
@@ -166,6 +158,51 @@ class PassiveRectangleWidget extends StatelessWidget {
166158 }
167159}
168160
161+ class PortalPreviewWidget extends StatelessWidget {
162+ final BaseNode node;
163+
164+ const PortalPreviewWidget ({
165+ super .key,
166+ required this .node,
167+ });
168+
169+ @override
170+ Widget build (BuildContext context) {
171+ return Container (
172+ clipBehavior: Clip .antiAlias,
173+ decoration: BoxDecoration (
174+ borderRadius: BorderRadius .circular (4 ),
175+ border: Border .all (
176+ color: const Color (0xFFBA79F4 ),
177+ width: 2 ,
178+ ),
179+ ),
180+ child: CustomPaint (
181+ painter: StripePainter (
182+ bgColor: const Color (0xFFBA79F4 ).withOpacity (0.1 ),
183+ stripeColor: const Color (0xFFBA79F4 ),
184+ nbOfStripes: (node.outerBoxGlobal.size.longestSide / 10 ).round (),
185+ ),
186+ child: Center (
187+ child: Container (
188+ padding: const EdgeInsets .symmetric (horizontal: 12 , vertical: 6 ),
189+ decoration: BoxDecoration (
190+ color: const Color (0xFFBA79F4 ),
191+ borderRadius: BorderRadius .circular (4 ),
192+ ),
193+ child: const Text (
194+ 'Embedded Canvas' ,
195+ style: TextStyle (
196+ color: Colors .white,
197+ ),
198+ ),
199+ ),
200+ ),
201+ ),
202+ );
203+ }
204+ }
205+
169206List <Widget > wrapWithPaddingNoScroll (
170207 BaseNode node,
171208 List <Widget > children, {
0 commit comments