Skip to content

Commit

Permalink
Fixes letsar#361
Browse files Browse the repository at this point in the history
  • Loading branch information
letsar committed Jul 14, 2022
1 parent b4e78de commit 0032081
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.2
### Fixed
* ClipBehavior.none issue (https://github.com/letsar/flutter_slidable/issues/361).

## 1.3.1
### Fixed
* Rare LateInitializationError with DrawerMotion (https://github.com/letsar/flutter_slidable/issues/289).
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.3.1"
version: "1.3.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
22 changes: 15 additions & 7 deletions lib/src/dismissal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,22 @@ class _SizeTransition extends AnimatedWidget {
} else {
alignment = const AlignmentDirectional(0, -1);
}

final align = Align(
alignment: alignment,
heightFactor: axis == Axis.vertical ? value : null,
widthFactor: axis == Axis.horizontal ? value : null,
child: child,
);

if (value == 1) {
// We don't want to clip our child in normal conditions.
return align;
}

// We can't use ClipBehavior.none on Flutter versions < 3.
return ClipRect(
clipBehavior: value == 1 ? Clip.none : Clip.hardEdge,
child: Align(
alignment: alignment,
heightFactor: axis == Axis.vertical ? value : null,
widthFactor: axis == Axis.horizontal ? value : null,
child: child,
),
child: align,
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_slidable
description: A Flutter implementation of slidable list item with directional slide actions that can be dismissed.
version: 1.3.1
version: 1.3.2
homepage: https://github.com/letsar/flutter_slidable

environment:
Expand Down

0 comments on commit 0032081

Please sign in to comment.