mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
mobile: Fine tune account settings
If the user enters something into the login fields, the values will be copied to the registration screen. Also, the password is required to delete an account now.
This commit is contained in:
parent
0e10edb87f
commit
5ffecb97c6
3 changed files with 127 additions and 25 deletions
|
|
@ -4,6 +4,14 @@ import 'package:musicus_common/musicus_common.dart';
|
|||
|
||||
/// A screen for creating a new Musicus account.
|
||||
class RegisterScreen extends StatefulWidget {
|
||||
final String username;
|
||||
final String password;
|
||||
|
||||
RegisterScreen({
|
||||
this.username,
|
||||
this.password,
|
||||
});
|
||||
|
||||
@override
|
||||
_RegisterScreenState createState() => _RegisterScreenState();
|
||||
}
|
||||
|
|
@ -16,6 +24,19 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||
|
||||
bool _loading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
if (widget.username != null) {
|
||||
nameController.text = widget.username;
|
||||
}
|
||||
|
||||
if (widget.password != null) {
|
||||
passwordController.text = widget.password;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final backend = MusicusBackend.of(context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue