Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine settling behavior during ballistic animation #241

Merged
merged 10 commits into from
Sep 14, 2024
Prev Previous commit
Next Next commit
Add const keywords
fujidaiti committed Sep 13, 2024
commit 4aac917af7bb7f78ddc228e1cb671866c65925c5
4 changes: 2 additions & 2 deletions example/lib/tutorial/bottom_bar_visibility.dart
Original file line number Diff line number Diff line change
@@ -137,10 +137,10 @@ class _ExampleSheet extends StatelessWidget {
const halfSize = Extent.proportional(0.5);
const fullSize = Extent.proportional(1);

final multiStopPhysics = BouncingSheetPhysics(
const multiStopPhysics = BouncingSheetPhysics(
parent: SnappingSheetPhysics(
snappingBehavior: SnapToNearest(
snapTo: const [minSize, halfSize, fullSize],
snapTo: [minSize, halfSize, fullSize],
),
),
);
8 changes: 4 additions & 4 deletions example/lib/tutorial/sheet_content_scaffold.dart
Original file line number Diff line number Diff line change
@@ -50,13 +50,13 @@ class _ExampleSheet extends StatelessWidget {
),
);

final physics = BouncingSheetPhysics(
const physics = BouncingSheetPhysics(
parent: SnappingSheetPhysics(
snappingBehavior: SnapToNearest(
snapTo: [
const Extent.proportional(0.2),
const Extent.proportional(0.5),
const Extent.proportional(1),
Extent.proportional(0.2),
Extent.proportional(0.5),
Extent.proportional(1),
],
),
),
10 changes: 5 additions & 5 deletions example/lib/tutorial/sheet_physics.dart
Original file line number Diff line number Diff line change
@@ -87,11 +87,11 @@ class _MySheet extends StatelessWidget {
// - the extent at which ony (_halfwayFraction * 100)% of the content is visible, or
// - the extent at which the entire content is visible.
// Note that the "extent" is the visible height of the sheet.
final snappingPhysics = SnappingSheetPhysics(
const snappingPhysics = SnappingSheetPhysics(
snappingBehavior: SnapToNearest(
snapTo: [
const Extent.proportional(_halfwayFraction),
const Extent.proportional(1),
Extent.proportional(_halfwayFraction),
Extent.proportional(1),
],
),
// Tips: The above configuration can be replaced with a 'SnapToNearestEdge',
@@ -104,9 +104,9 @@ class _MySheet extends StatelessWidget {
_PhysicsKind.bouncing => const BouncingSheetPhysics(),
_PhysicsKind.clampingSnapping =>
// Use 'parent' to combine multiple physics behaviors.
ClampingSheetPhysics(parent: snappingPhysics),
const ClampingSheetPhysics(parent: snappingPhysics),
_PhysicsKind.bouncingSnapping =>
BouncingSheetPhysics(parent: snappingPhysics),
const BouncingSheetPhysics(parent: snappingPhysics),
};
}