We have now made a login screen successfully so now we need to make a sign up screen as well!
We’re going to be writing the SignUp class in the same dart file so we can access the Map we made earlier. First thing you should do is to move the database out of the Login class so you can also access it from the SignUp class as well.
After that make a Stateless widget class with an app bar that says “Sign Up”
import 'package:flutter/material.dart';
class SignUp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Sign Up"))
);
}
}
Then add two Strings called username_signup and password_signup to store what you enter into the TextFormFields.
import 'package:flutter/material.dart';
class SignUp extends StatelessWidget {
String username_signup;
String password_signup;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Sign Up"))
);
}
}
After that make a variable called formKey2 to use to store the username and password.