Skip to content

Commit b0950e8

Browse files
committed
delete torrent snackbar
1 parent 7d91353 commit b0950e8

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

lib/Components/delete_torrent_sheet.dart

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import 'package:flood_mobile/Constants/theme_provider.dart';
33
import 'package:flood_mobile/Model/torrent_model.dart';
44
import 'package:flutter/material.dart';
55

6+
import 'flood_snackbar.dart';
7+
68
class DeleteTorrentSheet extends StatefulWidget {
79
final TorrentModel torrent;
810

@@ -85,10 +87,10 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
8587
child: Text(
8688
"No",
8789
style: TextStyle(
88-
color:
89-
ThemeProvider.theme.textTheme.bodyText1?.color,
90-
fontSize: 16,
91-
fontWeight: FontWeight.w900),
90+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
91+
fontSize: 16,
92+
fontWeight: FontWeight.w900,
93+
),
9294
),
9395
),
9496
),
@@ -100,15 +102,23 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
100102
Expanded(
101103
child: Container(
102104
height: MediaQuery.of(context).size.height * 0.06,
103-
decoration:
104-
BoxDecoration(borderRadius: BorderRadius.circular(20)),
105+
decoration: BoxDecoration(
106+
borderRadius: BorderRadius.circular(20),
107+
),
105108
child: ElevatedButton(
106109
onPressed: () {
107110
TorrentApi.deleteTorrent(
108111
hash: widget.torrent.hash,
109112
deleteWithData: deleteWithData,
110113
context: context);
111114
Navigator.of(context).pop();
115+
116+
final deleteTorrentSnackBar = addFloodSnackBar(
117+
SnackbarType.caution,
118+
'Torrent deleted successfuly',
119+
'Dismiss');
120+
ScaffoldMessenger.of(context)
121+
.showSnackBar(deleteTorrentSnackBar);
112122
},
113123
style: ElevatedButton.styleFrom(
114124
shape: RoundedRectangleBorder(
@@ -120,10 +130,10 @@ class _DeleteTorrentSheetState extends State<DeleteTorrentSheet> {
120130
child: Text(
121131
"Yes",
122132
style: TextStyle(
123-
color:
124-
ThemeProvider.theme.textTheme.bodyText1?.color,
125-
fontSize: 16,
126-
fontWeight: FontWeight.w900),
133+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
134+
fontSize: 16,
135+
fontWeight: FontWeight.w900,
136+
),
127137
),
128138
),
129139
),

0 commit comments

Comments
 (0)