You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to dynamically change swipeDismissible of ModalSheetPage from true to false based on the passed route arguments to make some modal pages swipe dismissible and some not. When attempting to do that the modals break with the following error:
======== Exception caught by rendering library =====================================================
The following assertion was thrown during performLayout():
The sheet extent and the dimensions values must be finalized during the layout phase.
'package:smooth_sheets/src/foundation/sheet_viewport.dart':
Failed assertion: line 88 pos 7: '_extent.metrics.hasDimensions'
The relevant error-causing widget was:
NavigationSheet NavigationSheet:file:///Users/sebastianwaloszek/Documents/github/smooth_sheets/cookbook/lib/showcase/ai_playlist_generator.dart:199:16
When the exception was thrown, this was the stack:
#2 RenderSheetViewport.performLayout (package:smooth_sheets/src/foundation/sheet_viewport.dart:88:7)
#3 RenderObject.layout (package:flutter/src/rendering/object.dart:2575:7)
#4 RenderBox.layout (package:flutter/src/rendering/box.dart:2389:11)
#5 RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:239:12)
#6 RenderObject.layout (package:flutter/src/rendering/object.dart:2575:7)
#7 RenderBox.layout (package:flutter/src/rendering/box.dart:2389:11)
#8 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:21)
#9 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:2414:7)
#10 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1051:18)
#11 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1064:15)
#12 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:582:23)
#13 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:991:13)
#14 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#15 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#16 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#17 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#18 _invoke (dart:ui/hooks.dart:312:13)
#19 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#20 _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
The following RenderObject was being processed when the exception was fired: _RenderNavigationSheetViewport#74797 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: offset=Offset(0.0, 0.0) (can use size)
... constraints: BoxConstraints(w=393.0, h=793.0)
... size: Size(393.0, 793.0)
... transform matrix: [0] 0.0,0.0,0.0,0.0
[1] 0.0,0.0,0.0,0.0
[2] 0.0,0.0,0.0,0.0
[3] 0.0,0.0,0.0,0.0
... origin: null
... alignment: null
... transformHitTests: true
RenderObject: _RenderNavigationSheetViewport#74797 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(w=393.0, h=793.0)
size: Size(393.0, 793.0)
transform matrix: [0] 0.0,0.0,0.0,0.0
[1] 0.0,0.0,0.0,0.0
[2] 0.0,0.0,0.0,0.0
[3] 0.0,0.0,0.0,0.0
origin: null
alignment: null
transformHitTests: true
... child: _RenderSheetContentLayoutObserver#93029 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: <none> (can use size)
... constraints: BoxConstraints(w=393.0, h=793.0)
... size: Size(393.0, 793.0)
... alignment: Alignment.topCenter
... widthFactor: expand
... heightFactor: expand
... child: RenderPhysicalShape#0e4dc relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: offset=Offset(0.0, 0.0) (can use size)
... constraints: BoxConstraints(0.0<=w<=393.0, 0.0<=h<=793.0)
... size: Size(393.0, 793.0)
... elevation: 0.0
... color: Color(0xfffffbfe)
... shadowColor: Color(0xfffffbfe)
... clipper: ShapeBorderClipper
... child: RenderCustomPaint#6b0ef relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: <none> (can use size)
... constraints: BoxConstraints(0.0<=w<=393.0, 0.0<=h<=793.0)
... size: Size(393.0, 793.0)
... painter: null
... foregroundPainter: _ShapeBorderPainter#cdf11()
... child: _RenderInkFeatures#cad18 relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData: <none> (can use size)
... constraints: BoxConstraints(0.0<=w<=393.0, 0.0<=h<=793.0)
... size: Size(393.0, 793.0)
====================================================================================================
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
NavigationSheet: markAsDimensionsWillChange() was called more times than markAsDimensionsChanged() in a frame.
'package:smooth_sheets/src/foundation/sheet_extent.dart':
Failed assertion: line 304 pos 13: '_markAsDimensionsWillChangeCallCount == 0'
When the exception was thrown, this was the stack:
#2 SheetExtent.markAsDimensionsWillChange.<anonymous closure>.<anonymous closure> (package:smooth_sheets/src/foundation/sheet_extent.dart:304:13)
#3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1322:11)
#5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#6 _invoke (dart:ui/hooks.dart:312:13)
#7 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#8 _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
====================================================================================================
Describe the bug 🐞
I want to be able to dynamically change
swipeDismissible
ofModalSheetPage
fromtrue
tofalse
based on the passed route arguments to make some modal pages swipe dismissible and some not. When attempting to do that the modals break with the following error:Video 🎞️
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-13.at.16.40.30.mp4
How to reproduce? 😈
swipeDismissible
set totrue
.swipeDismissible
tofalse
.Expected behavior ⚖️
First modal page is swipe dismissible and the second one is not.
Sample project 🔬
Slightly modified version of ai playlist generator.
The text was updated successfully, but these errors were encountered: