1
1
import 'package:expansion_tile_card/expansion_tile_card.dart' ;
2
2
import 'package:flood_mobile/Api/auth_api.dart' ;
3
3
import 'package:flood_mobile/Api/client_api.dart' ;
4
+ import 'package:flood_mobile/Components/flood_snackbar.dart' ;
4
5
import 'package:flood_mobile/Components/settings_text_field.dart' ;
5
6
import 'package:flood_mobile/Components/text_size.dart' ;
6
7
import 'package:flood_mobile/Constants/theme_provider.dart' ;
@@ -194,6 +195,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
194
195
.then ((value) {
195
196
setState (() {});
196
197
});
198
+
199
+ final changeSettingsSnackBar = addFloodSnackBar (
200
+ SnackbarType .success, 'Settings changed' , 'Dismiss' );
201
+
202
+ ScaffoldMessenger .of (context)
203
+ .showSnackBar (changeSettingsSnackBar);
197
204
},
198
205
icon: Icon (
199
206
Icons .save,
@@ -735,23 +742,29 @@ class AuthenticationSection extends StatelessWidget {
735
742
AuthApi .registerUser (
736
743
context: context,
737
744
model: RegisterUserModel (
738
- username: usernameController.text,
739
- password: passwordController.text,
740
- client: client,
741
- type: (client == 'rTorrent' )
742
- ? (socket)
743
- ? 'socket'
744
- : 'tcp'
745
- : "web" ,
746
- version: 1 ,
747
- url: urlController.text,
748
- clientUsername: clientUsernameController.text,
749
- clientPassword: clientPasswordController.text,
750
- level: isAdmin ? 10 : 5 ,
751
- path: pathController.text,
752
- host: hostController.text,
753
- port: int .parse (portController.text)),
745
+ username: usernameController.text,
746
+ password: passwordController.text,
747
+ client: client,
748
+ type: (client == 'rTorrent' )
749
+ ? (socket)
750
+ ? 'socket'
751
+ : 'tcp'
752
+ : "web" ,
753
+ version: 1 ,
754
+ url: urlController.text,
755
+ clientUsername: clientUsernameController.text,
756
+ clientPassword: clientPasswordController.text,
757
+ level: isAdmin ? 10 : 5 ,
758
+ path: pathController.text,
759
+ host: hostController.text,
760
+ port: int .parse (portController.text),
761
+ ),
754
762
);
763
+ final addNewUserSnackBar = addFloodSnackBar (
764
+ SnackbarType .success, 'New user added' , 'Dismiss' );
765
+
766
+ ScaffoldMessenger .of (context)
767
+ .showSnackBar (addNewUserSnackBar);
755
768
},
756
769
style: ElevatedButton .styleFrom (
757
770
shape: RoundedRectangleBorder (
@@ -763,9 +776,10 @@ class AuthenticationSection extends StatelessWidget {
763
776
child: Text (
764
777
"Add" ,
765
778
style: TextStyle (
766
- color: Colors .white,
767
- fontSize: 16 ,
768
- fontWeight: FontWeight .w600),
779
+ color: Colors .white,
780
+ fontSize: 16 ,
781
+ fontWeight: FontWeight .w600,
782
+ ),
769
783
),
770
784
),
771
785
),
0 commit comments