Repository navigation
Conversation
|
Just completed the necessary work for persistent bottom sheets. @HansMuller I referred to the online Material spec for animation values again. If anything seems off or if there are updated animations internally let me know |
|
Here are the latest bottom sheet motion specs. As always, it's a shame that the material motion specs aren't public. I don't know why they're not public. Overall duration open/close: 250ms |
HansMuller
left a comment
There was a problem hiding this comment.
This appears to be a nice improvement however I'm having some trouble with the curve definition.
| /// A curve that progresses linearly until a specified [startingPoint], at which | ||
| /// point [curve] will begin. Unlike [Interval], [curve] will not start at zero, | ||
| /// but will use [startingPoint] as the Y position. | ||
| class SuspendedCurve extends Curve { |
There was a problem hiding this comment.
This combination of a linear curve followed by an arbitrary one seems particularly suited to drag then fling situations (otherwise it's difficult to understand what motivated this particular combination). Some typical usage information would be helpful here.
The curves are documented with animated diagrams which may be more than what you want to do here. For now, rather than making this a general purpose class, maybe just add _SuspendedCurve to bottom_sheet.dart.
There was a problem hiding this comment.
Expanded in the class docs with the new commits.
I wasn't able to keep SuspendedCurve private in bottom_sheet.dart, since it is also used in scaffold.dart for persistent bottom sheets, so I moved it to bottom_sheet.dart and renamed it as BottomSheetSuspendedCurve.
|
|
||
| final double curveProgress = (t - startingPoint) / (1 - startingPoint); | ||
| final double transformed = curve.transform(curveProgress); | ||
| return lerpDouble(startingPoint, 1, transformed); |
There was a problem hiding this comment.
From the class doc I was't able to understand exactly how the linear curve would segue to the curve parameter.
Using the curve to sample a line from startingPoint to 1.0 seems reasonable, but to verify that it's correct is hard to do without definition of what the curved part of suspended curve is supposed to mean.
I wasn't able to adjust the animation for the scrim, since it appears to be hardcoded in routes.dart unfortunately |
dnfield
left a comment
There was a problem hiding this comment.
This needs test(s) before it could be merged. The existing CI failure seems like a flake though.
Would you be able to add some tests for this?
|
Same comment here as on the other one - this has had no activity in some time now, needs tests, and needs to be synchronized up to HEAD. Please feel free to re-open once some of that has been addressed. |
Boy, this was a hard one 😅 This PR eases the enter and exit transitions for bottom sheets, while also preserving regular dragging behavior.
TODO:
showModalBottomSheetshowBottomSheet