Add the possibility to pass a custom Clipper to the slidable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
The relevant code is the private _SlidableClipper class, which the issue's snippet shows with getClip, getApproximateClipRect and shouldReclip, plus the Slidable widget constructor where an optional parameter would go. Start by reading how _SlidableClipper is created and applied, then decide how to expose it, such as an abstract base class with a default implementation. Done means Slidable accepts an optional custom clipper and default behaviour is unchanged. The API shape is not settled in the thread, so confirm it with a maintainer first.
Written by the indexing model from the issue text.
Description
Transform that class in an abstract one and become an optional parameter to the Slidable, i'm struggling to make some custom animations in my code using the package without this customization:
class _SlidableClipper extends CustomClipper<Rect> {
_SlidableClipper({
required this.axis,
required this.controller,
}) : super(reclip: controller.animation);
final Axis axis;
final SlidableController controller;
@override
Rect getClip(Size size) {
switch (axis) {
case Axis.horizontal:
final double offset = controller.ratio * size.width;
if (offset < 0) {
return Rect.fromLTRB(size.width + offset, 0, size.width, size.height);
}
return Rect.fromLTRB(0, 0, offset, size.height);
case Axis.vertical:
final double offset = controller.ratio * size.height;
if (offset < 0) {
return Rect.fromLTRB(
0,
size.height + offset,
size.width,
size.height,
);
}
return Rect.fromLTRB(0, 0, size.width, offset);
}
}
@override
Rect getApproximateClipRect(Size size) => getClip(size);
@override
bool shouldReclip(_SlidableClipper oldClipper) {
return oldClipper.axis != axis;
}
}
- Dominant language
- Dart
- Stars
- 2.9k
- Forks
- 646
- Avg merge
- 5m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from letsar/flutter_slidable
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
letsar/flutter_slidable#563 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
letsar/flutter_slidable#549 ·
Maintainers usually reply within 1 day
-
Lock action-pane intent for a continuous drag until neutral settlePossibly taken @lukemmtt claimed this 194 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
letsar/flutter_slidable#546 ·
Maintainers usually reply within 1 day
-
Example is not runnable on androidPossibly taken @akhil-ge0rge claimed this 350 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 18/100
letsar/flutter_slidable#540 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
letsar/flutter_slidable#535 ·
Maintainers usually reply within 1 day
All issues in letsar/flutter_slidable
Similar issues
-
[CarouselView] Crash (RangeError / ArgumentError) when children or itemCount is empty with infinite: true or CarouselController.animateToItemPossibly taken A pull request linked to this issue is open or already merged. Openp: material_ui package platform-android platform-ios platform-linux platform-macos platform-web team-design
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
flutter/flutter#195878 · 1 comment ·
Maintainers usually reply within 1 day
-
agent-ready area:testing bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pauljohanneskraft/Acai#479 ·
Maintainers usually reply within 3 days
-
[genkit_google_genai] Gemini tool call with no arguments fails with "requires a non-null input"Possibly taken @kenzieschmoll claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
genkit-ai/genkit-dart#692 ·
Maintainers usually reply within 11 days
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lollipopkit/flutter_server_box#1851 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day