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 SheetExtent and related components #251

Merged
merged 22 commits into from
Sep 27, 2024

Update documentation

006a583
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Refine SheetExtent and related components #251

Update documentation
006a583
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Report (with Flutter 3.22.3) succeeded Sep 27, 2024 in 1s

76 passed, 0 failed and 0 skipped

Tests passed successfully

✅ /home/runner/work/smooth_sheets/smooth_sheets/flutter-test-report.json

76 tests were completed in 14s with 76 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/draggable/draggable_sheet_test.dart 4✅ 977ms
test/foundation/physics_test.dart 32✅ 148ms
test/foundation/sheet_activity_test.dart 11✅ 125ms
test/foundation/sheet_notification_test.dart 3✅ 342ms
test/foundation/sheet_viewport_test.dart 4✅ 583ms
test/modal/modal_sheet_test.dart 6✅ 1s
test/navigation/navigation_sheet_test.dart 8✅ 2s
test/scrollable/scrollable_sheet_test.dart 8✅ 2s

✅ test/draggable/draggable_sheet_test.dart

✅ Inherited controller should be attached
✅ Opening keyboard does not interrupt sheet animation
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling

✅ test/foundation/physics_test.dart

✅ FixedBouncingBehavior returns same value for same input metrics
✅ DirectionAwareBouncingBehavior respects gesture direction
SheetPhysics subclasses
  ✅ can create dynamic inheritance relationships
Default configuration of SheetPhysics
  ✅ does not allow over/under dragging
  ✅ does not apply any resistance if position is in bounds
  ✅ prevents position from going out of bounds
  ✅ creates no ballistic simulation if position is in bounds
  ✅ creates ballistic simulation which ends at the nearest edge
  ✅ findSettledPosition
SnapToNearestEdge
  ✅ snaps to nearest edge if velocity is small enough
  ✅ is aware of fling gesture direction
  ✅ is disabled if position is out of bounds
  ✅ Boundary conditions
SnapToNearest
  ✅ snaps to nearest edge if velocity is small enough
  ✅ is aware of fling gesture direction
  ✅ is disabled if position is out of bounds
  ✅ Boundary condition: a drag ends exactly at the top detent
  ✅ Boundary condition: flings up exactly at the top detent
  ✅ Boundary condition: flings down exactly at the top detent
  ✅ Boundary condition: a drag ends exactly at the middle detent
  ✅ Boundary condition: flings up exactly at the middle detent
  ✅ Boundary condition: flings down exactly at the middle detent
  ✅ Boundary condition: a drag ends exactly at the bottom detent
  ✅ Boundary condition: flings up exactly at the bottom detent
  ✅ Boundary condition: flings down exactly at the bottom detent
BouncingSheetPhysics
  ✅ progressively applies friction if position is out of bounds
  ✅ does not allow to go beyond bounceable bounds
  ✅ applies friction even if position is on boundary
  ✅ can apply a reasonable friction to extremely large offset
sortPositionsAndFindNearest
  ✅ with two positions
  ✅ with three positions
  ✅ with more than three positions

✅ test/foundation/sheet_activity_test.dart

AnimatedSheetActivity
  ✅ should animate to the destination
  ✅ should absorb viewport changes
SettlingSheetActivity
  ✅ Create with velocity
  ✅ Create with duration
  ✅ Velocity should be set when the activity is initialized
  ✅ Progressively updates current position toward destination
  ✅ Should start an idle activity when it reaches destination
  ✅ Should absorb viewport changes
IdleSheetActivity
  ✅ should maintain previous position when keyboard appears
  ✅ should maintain previous position when content size changes, without animation if gap is small
  ✅ should maintain previous position when content size changes, with animation if gap is large

✅ test/foundation/sheet_notification_test.dart

✅ Drag gesture should dispatch drag start/update/end notifications in sequence
✅ Sheet animation should dispatch metrics update notifications
✅ Over-darg gesture should dispatch both darg and overflow notifications

✅ test/foundation/sheet_viewport_test.dart

Ignore pointer test:
  ✅ pointer events on a sheet should be ignored if activity says to do so
  ✅ content in a sheet should receive pointer events if activity allows
  ✅ content obscured by a sheet should never receive pointer events
  ✅ content not obscured by a sheet should always receive pointer events

✅ test/modal/modal_sheet_test.dart

Swipe-to-dismiss action test
  ✅ modal should be dismissed if swipe gesture has enough speed
  ✅ modal should not be dismissed if swipe gesture has not enough speed
  ✅ modal should be dismissed if drag distance is enough
  ✅ modal should not be dismissed if drag distance is not enough
PopScope test
  ✅ PopScope.onPopInvoked should be called when tap on barrier
  ✅ PopScope.onPopInvoked should be called when swipe to dismiss

✅ test/navigation/navigation_sheet_test.dart

✅ Attached controller emits correct pixel values when dragging
✅ Attached controller emits correct boundary values
✅ Inherited controller should be attached
✅ Works with DropdownButton without crashing
✅ Opening keyboard does not interrupts sheet animation
✅ Drag gestures should be ignored during a page transition
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling

✅ test/scrollable/scrollable_sheet_test.dart

✅ Inherited controller should be attached
✅ Opening keyboard does not interrupt sheet animation
Press-and-hold gesture should stop momentum scrolling
  ✅ in a plain ListView
  ✅ in a PageView with multiple ListViews
SheetKeyboardDismissible
  ✅ should dismiss the keyboard when dragging
  ✅ should dismiss the keyboard when scrolling
Infinite ballistic scroll activity test
  ✅ top edge
  ✅ bottom edge