import 'package:flutter/material.
dart';
void main(){
runApp(MyApp());
}
class MyApp extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primaryColor: Color(0xFF008080), // Teal color
fontFamily: 'Roboto',
),
home: ChangePasswordScreen(),
);
}
class ChangePasswordScreen extends StatefulWidget {
@override
_ChangePasswordScreenState createState() => _ChangePasswordScreenState();
}
class _ChangePasswordScreenState extends State<ChangePasswordScreen> {
bool _oldPasswordVisible = false;
bool _newPasswordVisible = false;
bool _confirmPasswordVisible = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: [Link],
appBar: AppBar(
backgroundColor: [Link],
elevation: 0,
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Color(0xFF008080)),
onPressed: () => [Link](context),
),
),
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const [Link](24.0),
child: Column(
crossAxisAlignment: [Link],
children: [
SizedBox(height: 40),
Text(
"Change Password",
style: TextStyle(
fontSize: 32,
fontWeight: [Link],
color: Color(0xFF008080),
),
),
SizedBox(height: 20),
Text(
"Enter your old password and a new password",
style: TextStyle(fontSize: 18, color: [Link][600]),
),
SizedBox(height: 40),
_buildInputField("Old Password", _oldPasswordVisible, () {
setState(() {
_oldPasswordVisible = !_oldPasswordVisible;
});
}),
SizedBox(height: 20),
_buildInputField("New Password", _newPasswordVisible, () {
setState(() {
_newPasswordVisible = !_newPasswordVisible;
});
}),
SizedBox(height: 20),
_buildInputField("Confirm New Password", _confirmPasswordVisible,
() {
setState(() {
_confirmPasswordVisible = !_confirmPasswordVisible;
});
}),
SizedBox(height: 40),
ElevatedButton(
onPressed: () {
// Handle password change logic
},
style: [Link](
primary: Color(0xFF008080),
onPrimary: [Link],
padding: [Link](vertical: 16),
shape: RoundedRectangleBorder(
borderRadius: [Link](12),
),
minimumSize: Size([Link], 50),
),
child: Text(
"Change Password",
style: TextStyle(fontSize: 18, fontWeight: [Link]),
),
),
SizedBox(height: 20),
Center(
child: TextButton(
onPressed: () {
[Link](context);
},
child: Text(
"Cancel",
style: TextStyle(color: Color(0xFF008080)),
),
),
),
],
),
),
),
),
);
}
Widget _buildInputField(String label, bool isVisible, VoidCallback onToggle) {
return Container(
decoration: BoxDecoration(
color: [Link][200],
borderRadius: [Link](12),
),
child: TextField(
obscureText: !isVisible,
style: TextStyle(color: Colors.black87),
decoration: InputDecoration(
prefixIcon: Icon([Link], color: Color(0xFF008080)),
labelText: label,
labelStyle: TextStyle(color: [Link][600]),
border: [Link],
contentPadding: [Link](horizontal: 20, vertical: 16),
suffixIcon: IconButton(
icon: Icon(
isVisible ? Icons.visibility_off : [Link],
color: Color(0xFF008080),
),
onPressed: onToggle,
),
),
),
);
}
}