@@ -126,7 +126,8 @@ class _FeaturesChildState extends State<FeaturesChild>
126126
127127 _autoSetQuadrantAlignment (rect! );
128128
129- final size = MediaQuery .maybeOf (context)? .size ??
129+ final size =
130+ MediaQuery .maybeOf (context)? .size ??
130131 MediaQueryData .fromView (View .of (context)).size;
131132
132133 switch (_quadrantAlignment! ) {
@@ -146,8 +147,12 @@ class _FeaturesChildState extends State<FeaturesChild>
146147 } else {
147148 alignment = Alignment .bottomCenter;
148149 }
149- introduceRect =
150- Rect .fromLTWH (left, 0 , dialogWidth, introduceRect.height);
150+ introduceRect = Rect .fromLTWH (
151+ left,
152+ 0 ,
153+ dialogWidth,
154+ introduceRect.height,
155+ );
151156 }
152157 case QuadrantAlignment .left:
153158 introduceRect = Rect .fromLTRB (0 , 0 , rect! .left, size.height);
@@ -187,8 +192,12 @@ class _FeaturesChildState extends State<FeaturesChild>
187192 } else {
188193 alignment = Alignment .topCenter;
189194 }
190- introduceRect =
191- Rect .fromLTWH (left, introduceRect.top, dialogWidth, size.height);
195+ introduceRect = Rect .fromLTWH (
196+ left,
197+ introduceRect.top,
198+ dialogWidth,
199+ size.height,
200+ );
192201 }
193202 case QuadrantAlignment .inside:
194203 introduceRect = rect! ;
@@ -287,100 +296,100 @@ class _FeaturesChildState extends State<FeaturesChild>
287296 return rect == null
288297 ? const Center (child: CircularProgressIndicator ())
289298 : Stack (
290- children: [
291- // Border widget
299+ children: [
300+ // Border widget
301+ Positioned .fromRect (
302+ rect: rect! .inflate (widget.childConfig.borderSizeInflate),
303+ child: AnimatedBuilder (
304+ animation: _scaleAnimation,
305+ builder: (context, child) {
306+ return Transform .scale (
307+ scale: _scaleAnimation.value,
308+ child: Material (
309+ color: widget.childConfig.backgroundColor,
310+ shape: widget.childConfig.shapeBorder,
311+ ),
312+ );
313+ },
314+ ),
315+ ),
316+
317+ // Child widget.
318+ if (widget.childConfig.enableAnimation &&
319+ widget.childConfig.isAnimateChild)
292320 Positioned .fromRect (
293- rect: rect! . inflate (widget.childConfig.borderSizeInflate) ,
321+ rect: rect! ,
294322 child: AnimatedBuilder (
295323 animation: _scaleAnimation,
296324 builder: (context, child) {
297325 return Transform .scale (
298326 scale: _scaleAnimation.value,
299- child: Material (
300- color: widget.childConfig.backgroundColor,
301- shape: widget.childConfig.shapeBorder,
302- ),
327+ child: widget.child,
303328 );
304329 },
305330 ),
331+ )
332+ else
333+ Positioned .fromRect (
334+ rect: rect! ,
335+ child: widget.child,
306336 ),
307337
308- // Child widget.
309- if (widget.childConfig.enableAnimation &&
310- widget.childConfig.isAnimateChild)
311- Positioned .fromRect (
312- rect: rect! ,
313- child: AnimatedBuilder (
314- animation: _scaleAnimation,
315- builder: (context, child) {
316- return Transform .scale (
317- scale: _scaleAnimation.value,
318- child: widget.child,
319- );
320- },
321- ),
322- )
323- else
324- Positioned .fromRect (
325- rect: rect! ,
326- child: widget.child,
327- ),
328-
329- // Introduction widget.
330- Positioned .fromRect (
331- rect: introduceRect,
332- child: IgnorePointer (
333- child: Padding (
334- padding: widget.padding,
335- child: Align (
336- alignment: alignment,
337- child: widget.introduceConfig.builder (
338- context,
339- rect! ,
340- widget.introduce,
341- ),
338+ // Introduction widget.
339+ Positioned .fromRect (
340+ rect: introduceRect,
341+ child: IgnorePointer (
342+ child: Padding (
343+ padding: widget.padding,
344+ child: Align (
345+ alignment: alignment,
346+ child: widget.introduceConfig.builder (
347+ context,
348+ rect! ,
349+ widget.introduce,
342350 ),
343351 ),
344352 ),
345353 ),
346-
347- Scaffold (
348- resizeToAvoidBottomInset : true ,
349- backgroundColor : Colors .transparent ,
350- body : Stack (
351- children : [
352- // Skip text widget.
353- if ( ! ( widget.isLastState && widget.doneConfig.enabled) &&
354- widget.skipConfig .enabled)
355- Positioned . fill (
356- child : Align (
357- alignment : widget.skipConfig.alignment,
358- child : widget.skip ,
359- ) ,
354+ ),
355+
356+ Scaffold (
357+ resizeToAvoidBottomInset : true ,
358+ backgroundColor : Colors .transparent,
359+ body : Stack (
360+ children : [
361+ // Skip text widget.
362+ if ( ! (widget.isLastState && widget.doneConfig .enabled) &&
363+ widget.skipConfig.enabled)
364+ Positioned . fill (
365+ child : Align (
366+ alignment : widget.skipConfig.alignment ,
367+ child : widget.skip ,
360368 ),
369+ ),
361370
362- // Next text widget.
363- if (! (widget.isLastState && widget.doneConfig.enabled) &&
364- widget.nextConfig.enabled)
365- Positioned .fill (
366- child: Align (
367- alignment: widget.nextConfig.alignment,
368- child: widget.next,
369- ),
371+ // Next text widget.
372+ if (! (widget.isLastState && widget.doneConfig.enabled) &&
373+ widget.nextConfig.enabled)
374+ Positioned .fill (
375+ child: Align (
376+ alignment: widget.nextConfig.alignment,
377+ child: widget.next,
370378 ),
379+ ),
371380
372- // Done text widget.
373- if (widget.isLastState && widget.doneConfig.enabled)
374- Positioned .fill (
375- child: Align (
376- alignment: widget.doneConfig.alignment,
377- child: widget.done,
378- ),
381+ // Done text widget.
382+ if (widget.isLastState && widget.doneConfig.enabled)
383+ Positioned .fill (
384+ child: Align (
385+ alignment: widget.doneConfig.alignment,
386+ child: widget.done,
379387 ),
380- ] ,
381- ) ,
388+ ) ,
389+ ] ,
382390 ),
383- ],
384- );
391+ ),
392+ ],
393+ );
385394 }
386395}
0 commit comments