Skip to content

Commit

Permalink
feat: dismissible queues #69
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Nov 28, 2023
1 parent c6cb134 commit 5c426a8
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions lib/ui/pages/queues_page.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_scrollbar_modified/flutter_scrollbar_modified.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';

import 'package:get/get.dart';

import 'package:namida/controller/navigator_controller.dart';
import 'package:namida/controller/queue_controller.dart';
import 'package:namida/core/dimensions.dart';
import 'package:namida/core/namida_converter_ext.dart';
import 'package:namida/core/translations/language.dart';
import 'package:namida/ui/widgets/custom_widgets.dart';
import 'package:namida/ui/widgets/library/queue_tile.dart';

Expand Down Expand Up @@ -36,7 +37,26 @@ class QueuesPage extends StatelessWidget {
return AnimatingTile(
key: ValueKey(i),
position: i,
child: QueueTile(queue: q),
child: FadeDismissible(
key: Key("${i}_${q.date}"),
onDismissed: (onDismissed) {
final oldQueue = q;
QueueController.inst.removeQueue(oldQueue);
snackyy(
title: lang.UNDO_CHANGES,
message: lang.UNDO_CHANGES_DELETED_QUEUE,
displaySeconds: 3,
button: TextButton(
onPressed: () {
QueueController.inst.reAddQueue(oldQueue);
Get.closeAllSnackbars();
},
child: Text(lang.UNDO),
),
);
},
child: QueueTile(queue: q),
),
);
},
);
Expand Down

0 comments on commit 5c426a8

Please sign in to comment.