File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import 'package:rutorrentflutter/models/torrent.dart';
9
9
import '../api/api_conf.dart' ;
10
10
import 'package:rutorrentflutter/utilities/constants.dart' ;
11
11
12
+ import 'custom_dialog.dart' ;
13
+
12
14
class TorrentTile extends StatelessWidget {
13
15
final Torrent torrent;
14
16
TorrentTile (this .torrent);
@@ -46,6 +48,24 @@ class TorrentTile extends StatelessWidget {
46
48
return Consumer <Api >(
47
49
builder: (context, api, child) {
48
50
return GestureDetector (
51
+ onLongPress: () {
52
+ showDialog (
53
+ context: context,
54
+ builder: (context) => CustomDialog (
55
+ title: 'Remove Torrent' ,
56
+ optionRightText: 'Remove Torrent and Delete Data' ,
57
+ optionLeftText: 'Remove Torrent' ,
58
+ optionRightOnPressed: () {
59
+ ApiRequests .removeTorrentWithData (
60
+ torrent.api, torrent.hash);
61
+ Navigator .pop (context);
62
+ },
63
+ optionLeftOnPressed: () {
64
+ ApiRequests .removeTorrent (torrent.api, torrent.hash);
65
+ Navigator .pop (context);
66
+ },
67
+ ));
68
+ },
49
69
behavior: HitTestBehavior .opaque,
50
70
onTap: () {
51
71
Navigator .push (
Original file line number Diff line number Diff line change @@ -167,6 +167,13 @@ packages:
167
167
url: "https://pub.dartlang.org"
168
168
source: hosted
169
169
version: "1.0.11"
170
+ flutter_slidable:
171
+ dependency: "direct main"
172
+ description:
173
+ name: flutter_slidable
174
+ url: "https://pub.dartlang.org"
175
+ source: hosted
176
+ version: "0.5.7"
170
177
flutter_svg:
171
178
dependency: "direct main"
172
179
description:
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ dependencies:
32
32
flutter_vlc_player : ^3.0.6
33
33
package_info : ^0.4.3
34
34
wakelock : ^0.2.0+1
35
+ flutter_slidable : ^0.5.7
35
36
flutter_svg : ^0.19.1
36
37
37
38
dev_dependencies :
You can’t perform that action at this time.
0 commit comments