Add ScrollInterCeptionBehavior for toggling autoscroll
Summary
Briefly describe what this PR changes and why.
- Motivation / Context: With current implementation scroll interceptor does not work with trackpads. So chrome like auto-scroll was added.
Type of change
- [ ] fix: Bug fix (non-breaking change)
- [x] feat: New feature / new component
- [ ] perf: Performance improvement
- [ ] refactor/chore: Code refactor or tooling update
- [ ] docs: Documentation only
- [ ] build/devtools: Generators, scripts, or infra changes
Scope (check all that apply)
- [x] Components (lib/src/components/...)
- [ ] Utilities (lib/src/util.dart, animation/collection, platform)
- [ ] Icons / Fonts (icons/, lib/icons/, pubspec fonts)
- [ ] Theme / Colors (lib/src/theme/, colors/ + style transpilers)
- [x] Docs app (docs/)
- [ ] Generators / Tools (gen/bin/)
- [ ] Example app (example/)
- [ ] Tests (example/test/, test_widget/)
- [ ] CI / Workflows
Linked issues
Closes # Refs #
Screenshots / Videos (if UI)
Include light/dark and relevant states.
Breaking changes
- [ ] Yes (add migration notes below)
- [x] No
How I tested
- Manual verification in docs app (Chrome)
Checklist
Please ensure the following are complete before requesting review. See CONTRIBUTING.md for details.
- [x] Code formatted (dart format .)
- [x] Analyzer passes (flutter analyze)
- [ ] Tests added/updated and passing (flutter test where applicable)
- [ ] Public API documented (public_member_api_docs)
- [ ] Docs/examples updated (docs pages or README images)
- [ ] Exports updated in lib/shadcn_flutter.dart (for new public widgets)
- [ ] A11y validated in docs (run_docs_web_semantics.bat)
- [ ] Generators run when relevant:
- [ ] LLMs / Guides (gen_dotguides.bat)
- [ ] CHANGELOG updated (if user-visible change)
Additional notes
Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?
Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?
Whats the extra configuration?
Turns out chrome supports both drag scrolling and tap scrolling. Should I remove the Behavior class then or add extra configuration?
Whats the extra configuration?
switch between hold or tap scrolling (current)
final bool holdDrag;
extra config that enables combined hold drag + move / tap release to activate scrolling (default chrome behavior)
final bool holdDragOrTap;
Could be a new Enum
or just remove behavior class so when enabled it works in that holdDragOrTap combined interaction.
I couldn't picture what youre describing, try it out, ill leave feedback later.