class LoginPage extends StatelessWidget {
final TextEditingController _usernameController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 100),
Container(
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.grey[800],
borderRadius: BorderRadius.circular(100),
),
child: FlutterLogo(size: 100),
),
SizedBox(height: 30),
Text(
"Welcome back!",
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
child: Text(
"Please log in to continue.",
style: TextStyle(fontSize: 16),
),
),
SizedBox(height: 30),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
child: TextField(
controller: _usernameController,
style: TextStyle(color: Colors.white),
decoration: InputDecoration(
labelText: "Username",
labelStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
borderRadius: BorderRadius.circular(10),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue),
borderRadius: BorderRadius.circular(10),
),
),
),
),
SizedBox(height: 20),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
child: TextField(
controller: _passwordController,
style: TextStyle(color: Colors.white),
obscureText: true,
decoration: InputDecoration(
labelText: "Password",
labelStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
borderRadius: BorderRadius.circular(10),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue),
borderRadius: BorderRadius.circular(10),
),
),
),
),
SizedBox(height: 20),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.blue,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: () {
String username = _usernameController.text;
Navigator.pushNamed(context, '/home', arguments: username);
},
child: Text("Login"),
),
SizedBox(height: 20),
GestureDetector(
onTap: () {
},
child: Text(
"Forgot Password?",
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: 40),
Text(
"Don't have an account?",
style: TextStyle(fontSize: 16),
),
SizedBox(height: 10),
GestureDetector(
onTap: () {
},
child: Text(
"Sign Up",
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
),
],
),
),
);
}
}