Skip to content

Commit

Permalink
Merge pull request #32 from JordyHers/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
JordyHers authored Jun 10, 2024
2 parents f376ed5 + 74d7cf5 commit ab8d784
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class _HomePageState extends State<HomePage> {
height: height,
initialY: 100,
initialX: 100,
pinned: true,
enableAnimation: false,
builder: (context) => const Text(
'Pinned Flutter Floaty 🎉',
Expand Down
3 changes: 2 additions & 1 deletion lib/src/flutter_floaty.dart
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,10 @@ class _FlutterFloatyState extends State<FlutterFloaty>
}

void _animateTransition() {
final limitAxisX = (Config.dynamicWidth(context) - width) / 2;
_xPositionAnimation = Tween<double>(
begin: xPosition,
end: widget.initialX,
end: widget.initialX.clamp(0, limitAxisX),
).animate(
CurvedAnimation(
parent: _controller,
Expand Down

0 comments on commit ab8d784

Please sign in to comment.