Skip to content

Commit

Permalink
feat: haptic feedback on long press and reordering actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jan 24, 2024
1 parent eb74772 commit 6242200
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/components/player/player_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ class PlayerQueue extends HookConsumerWidget {
itemCount: tracks.length,
shrinkWrap: true,
buildDefaultDragHandles: false,
onReorderStart: (index) {
HapticFeedback.selectionClick();
},
onReorderEnd: (index) {
HapticFeedback.selectionClick();
},
itemBuilder: (context, i) {
final track = tracks.elementAt(i);
return AutoScrollTag(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:fuzzywuzzy/fuzzywuzzy.dart';
import 'package:gap/gap.dart';
Expand Down Expand Up @@ -116,6 +117,7 @@ class TrackViewBodySection extends HookConsumerWidget {
},
onLongPress: () {
trackViewState.selectTrack(track.id!);
HapticFeedback.selectionClick();
},
onTap: () async {
if (trackViewState.isSelecting) {
Expand Down

0 comments on commit 6242200

Please sign in to comment.