Skip to content

Commit 5af7c94

Browse files
authored
Merge pull request #122 from ManavSarkar/master
Snackbar for add new user and add new torrent not working
2 parents f512b90 + 1b5713d commit 5af7c94

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/Components/bottom_floating_menu_button.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
99
import '../Api/torrent_api.dart';
1010
import '../Constants/theme_provider.dart';
1111
import '../Provider/client_provider.dart';
12+
import 'flood_snackbar.dart';
1213

1314
class BottomFloatingMenuButton extends StatefulWidget {
1415
@override
@@ -301,6 +302,15 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
301302
sequentialDownload,
302303
isCompleted: completed,
303304
context: context);
305+
final addTorrentSnackbar =
306+
addFloodSnackBar(
307+
SnackbarType.information,
308+
'Torrent added successfully',
309+
'Dismiss');
310+
311+
ScaffoldMessenger.of(context)
312+
.showSnackBar(
313+
addTorrentSnackbar);
304314
Navigator.pop(context);
305315
},
306316
style: ElevatedButton.styleFrom(
@@ -565,6 +575,14 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
565575
isSequential: sequentialDownload,
566576
isCompleted: completed,
567577
context: context);
578+
final addTorrentSnackbar =
579+
addFloodSnackBar(
580+
SnackbarType.information,
581+
'Torrent added successfully',
582+
'Dismiss');
583+
584+
ScaffoldMessenger.of(context)
585+
.showSnackBar(addTorrentSnackbar);
568586
Navigator.pop(context);
569587
},
570588
style: ElevatedButton.styleFrom(

lib/Pages/settings_screen.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,11 @@ class AuthenticationSection extends StatelessWidget {
763763
level: isAdmin ? 10 : 5,
764764
path: pathController.text,
765765
host: hostController.text,
766-
port: int.parse(portController.text),
766+
port: int.parse(
767+
portController.text.isEmpty
768+
? "0"
769+
: portController.text,
770+
),
767771
),
768772
);
769773
final addNewUserSnackBar = addFloodSnackBar(

0 commit comments

Comments
 (0)