@@ -6,10 +6,14 @@ import 'package:flutter/material.dart';
6
6
import 'flood_snackbar.dart' ;
7
7
8
8
class DeleteTorrentSheet extends StatefulWidget {
9
- final int index ;
9
+ final int themeIndex ;
10
10
final List <TorrentModel > torrents;
11
+ final List <int > indexes;
11
12
12
- DeleteTorrentSheet ({required this .torrents, required this .index});
13
+ DeleteTorrentSheet (
14
+ {required this .torrents,
15
+ required this .indexes,
16
+ required this .themeIndex});
13
17
14
18
@override
15
19
_DeleteTorrentSheetState createState () => _DeleteTorrentSheetState ();
@@ -52,7 +56,8 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
52
56
Checkbox (
53
57
key: Key ('Checkbox delete with data' ),
54
58
value: deleteWithData,
55
- activeColor: ThemeProvider .theme (widget.index).primaryColorDark,
59
+ activeColor:
60
+ ThemeProvider .theme (widget.themeIndex).primaryColorDark,
56
61
onChanged: (bool ? value) {
57
62
setState (() {
58
63
deleteWithData = value ?? false ;
@@ -90,7 +95,7 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
90
95
child: Text (
91
96
"No" ,
92
97
style: TextStyle (
93
- color: ThemeProvider .theme (widget.index )
98
+ color: ThemeProvider .theme (widget.themeIndex )
94
99
.textTheme
95
100
.bodyLarge
96
101
? .color,
@@ -118,6 +123,7 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
118
123
hashes.add (element.hash);
119
124
});
120
125
TorrentApi .deleteTorrent (
126
+ id: widget.indexes,
121
127
hashes: hashes,
122
128
deleteWithData: deleteWithData,
123
129
context: context);
@@ -136,14 +142,14 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
136
142
shape: RoundedRectangleBorder (
137
143
borderRadius: BorderRadius .circular (14.0 ),
138
144
),
139
- backgroundColor:
140
- ThemeProvider . theme (widget.index) .primaryColorDark,
145
+ backgroundColor: ThemeProvider . theme (widget.themeIndex)
146
+ .primaryColorDark,
141
147
),
142
148
child: Center (
143
149
child: Text (
144
150
"Yes" ,
145
151
style: TextStyle (
146
- color: ThemeProvider .theme (widget.index )
152
+ color: ThemeProvider .theme (widget.themeIndex )
147
153
.textTheme
148
154
.bodyLarge
149
155
? .color,
0 commit comments