Skip to content

Commit

Permalink
Hide control buttons when first/last page reached (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupi007 committed Sep 20, 2022
1 parent 947f293 commit 5825bba
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lib/src/utilities/yaru_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,20 @@ class _YaruCarouselState extends State<YaruCarousel> {
Widget icon,
) {
return Positioned.fill(
child: Align(
alignment: alignement,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: const CircleBorder(),
backgroundColor: Theme.of(context).colorScheme.background,
child: AnimatedOpacity(
opacity: onPressed != null ? 1 : 0,
duration: _kAnimationDuration,
curve: _kAnimationCurve,
child: Align(
alignment: alignement,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: const CircleBorder(),
backgroundColor: Theme.of(context).colorScheme.background,
),
onPressed: onPressed,
child: icon,
),
onPressed: onPressed,
child: icon,
),
),
);
Expand Down

0 comments on commit 5825bba

Please sign in to comment.