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
The snapping behavior becomes inconsistent and unreliable when using the SlidingSheet widget with an initialSnap value other than 1.0.
initialSnap: 1.0
initialSnap: 0.3 (or any)
Steps to Reproduce:
Create a SlidingSheet widget with two or more snap positions defined.
Set the initialSnap parameter to a value other than 1.0 (e.g., 0.5).
Run the app and try to drag the sheet to different snap positions.
see the snapping behaviour is now broken.
Expected Behavior:
The sheet should snap correctly to the defined snap positions regardless of the initialSnap value.
Actual Behavior:
The sheet fails to snap properly to the defined positions when the initialSnap value is not 1.0. It may get stuck between positions or fail to reach certain snap points.
Additional Information:
Flutter version: 3.13.9
wtf_sliding_sheet: 1.1.2
Sheet setup
SlidingSheet(
controller: controller,
openDuration:constDuration(milliseconds:500),
snapSpec:SnapSpec(
snap:true,
initialSnap: .3,
positioning:SnapPositioning.relativeToSheetHeight,
snappings:<double>[.3, 1],
),
color:Colors.white70,
elevation:10,
cornerRadius:16,
cornerRadiusOnFullscreen:16.0,
closeOnBackdropTap:true,
closeOnBackButtonPressed:true,
addTopViewPaddingOnFullscreen:false,
isBackdropInteractable:false,
parallaxSpec:constParallaxSpec(
enabled:true,
amount:0.35,
endExtent:0.5,
),
liftOnScrollHeaderElevation:12.0,
liftOnScrollFooterElevation:0.0,
builder: (BuildContext context, SheetState state) {
returnContainer(
height:900,
child:Center(
child:Column(
mainAxisAlignment:MainAxisAlignment.spaceAround,
children:const<Widget>[
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
],
),
),
);
},
)
Full Code sample
import'package:flutter/material.dart';
import'package:wtf_sliding_sheet/wtf_sliding_sheet.dart';
classHomePageextendsStatefulWidget {
constHomePage({Key? key}) :super(key: key);
@overrideState<HomePage> createState() =>_HomePageState();
}
class_HomePageStateextendsState<HomePage> {
finalSheetController controller =SheetController();
@overrideWidgetbuild(BuildContext context) {
returnScaffold(
body:Stack(children:<Widget>[
Container(
color:Colors.blueGrey,
child:Center(
child:Text('Home Widget'),
),
),
Align(
alignment:Alignment.bottomCenter,
child:SafeArea(
child:SlidingSheet(
controller: controller,
openDuration:constDuration(milliseconds:500),
snapSpec:SnapSpec(
snap:true,
initialSnap: .3,
positioning:SnapPositioning.relativeToSheetHeight,
snappings:<double>[.3, 1],
),
color:Colors.white70,
elevation:10,
cornerRadius:16,
cornerRadiusOnFullscreen:16.0,
closeOnBackdropTap:true,
closeOnBackButtonPressed:true,
addTopViewPaddingOnFullscreen:false,
isBackdropInteractable:false,
parallaxSpec:constParallaxSpec(
enabled:true,
amount:0.35,
endExtent:0.5,
),
liftOnScrollHeaderElevation:12.0,
liftOnScrollFooterElevation:0.0,
builder: (BuildContext context, SheetState state) {
returnContainer(
height:900,
child:Center(
child:Column(
mainAxisAlignment:MainAxisAlignment.spaceAround,
children:const<Widget>[
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
Text('This is the content of the sheet'),
],
),
),
);
},
),
))
]),
);
}
}
The text was updated successfully, but these errors were encountered:
Description
The snapping behavior becomes inconsistent and unreliable when using the
SlidingSheet
widget with aninitialSnap
value other than 1.0.Steps to Reproduce:
SlidingSheet
widget with two or more snap positions defined.initialSnap
parameter to a value other than 1.0 (e.g., 0.5).Expected Behavior:
The sheet should snap correctly to the defined snap positions regardless of the
initialSnap
value.Actual Behavior:
The sheet fails to snap properly to the defined positions when the
initialSnap
value is not 1.0. It may get stuck between positions or fail to reach certain snap points.Additional Information:
3.13.9
1.1.2
Sheet setup
Full Code sample
The text was updated successfully, but these errors were encountered: