Skip to content

Commit

Permalink
fix: animate in swiper
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Sep 17, 2024
1 parent fff36e4 commit 7881ab4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ui/route/delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
class AnnixRouterDelegate extends RouterDelegate<List<RouteSettings>>
with ChangeNotifier, PopNavigatorRouterDelegateMixin<List<RouteSettings>> {
final _panelController = PanelController();
get panelController => _panelController;
PanelController get panelController => _panelController;
get isPanelOpen =>
_panelController.isAttached &&
(_panelController.isPanelOpen ||
Expand Down
1 change: 0 additions & 1 deletion lib/ui/route/predictive_back_page_transitions_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'package:animations/animations.dart';
import 'package:annix/utils/context_extension.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand Down
6 changes: 5 additions & 1 deletion lib/ui/widgets/swiper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class PlayingTrackSwiper extends HookConsumerWidget {

useEffect(() {
if (playingIndex != null && controller.hasClients) {
controller.jumpToPage(playingIndex);
controller.animateToPage(
playingIndex,
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
return null;
}, [queue, playingIndex]);
Expand Down

0 comments on commit 7881ab4

Please sign in to comment.