0% found this document useful (0 votes)
9 views3 pages

Change Password

Docunmen

Uploaded by

riha soft
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Change Password

Docunmen

Uploaded by

riha soft
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

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: Colors.white,
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0,
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Color(0xFF008080)),
onPressed: () => Navigator.pop(context),
),
),
body: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 40),
Text(
"Change Password",
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Color(0xFF008080),
),
),
SizedBox(height: 20),
Text(
"Enter your old password and a new password",
style: TextStyle(fontSize: 18, color: Colors.grey[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: ElevatedButton.styleFrom(
primary: Color(0xFF008080),
onPrimary: Colors.white,
padding: EdgeInsets.symmetric(vertical: 16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
minimumSize: Size(double.infinity, 50),
),
child: Text(
"Change Password",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
),
SizedBox(height: 20),
Center(
child: TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(
"Cancel",
style: TextStyle(color: Color(0xFF008080)),
),
),
),
],
),
),
),
),
);
}

Widget _buildInputField(String label, bool isVisible, VoidCallback onToggle) {


return Container(
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: BorderRadius.circular(12),
),
child: TextField(
obscureText: !isVisible,
style: TextStyle(color: Colors.black87),
decoration: InputDecoration(
prefixIcon: Icon(Icons.lock, color: Color(0xFF008080)),
labelText: label,
labelStyle: TextStyle(color: Colors.grey[600]),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 16),
suffixIcon: IconButton(
icon: Icon(
isVisible ? Icons.visibility_off : Icons.visibility,
color: Color(0xFF008080),
),
onPressed: onToggle,
),
),
),
);
}
}

You might also like