passwordTextField method
Stack
passwordTextField()
Implementation
Stack passwordTextField() {
return Stack(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.dp),
border: Border.all(
color: ColorHelper.grey01,
width: 1.dp,
),
),
padding: EdgeInsets.symmetric(horizontal: 20.dp, vertical: 4.dp),
margin: EdgeInsets.only(top: 10.dp),
child: TextField(
controller: controller.passwordTextController,
obscureText: controller.shouldObscurePassword.value,
keyboardType: TextInputType.text,
autofillHints: const [AutofillHints.password],
style: TextStyle(
fontSize: 16.dp,
fontWeight: FontWeight.w400,
color: ColorHelper.black01,
),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 12.dp),
hintText: '*****************',
hintStyle: TextStyle(
fontSize: 16.dp,
fontWeight: FontWeight.w400,
color: ColorHelper.grey01,
),
border: InputBorder.none,
suffixIcon: IconButton(
icon: SvgPicture.asset(
controller.shouldObscurePassword.value
? "assets/auth/eye_off.svg"
: "assets/auth/eye_on.svg",
width: 20.dp,
height: 20.dp,
colorFilter: const ColorFilter.mode(
ColorHelper.grey02,
BlendMode.srcIn,
),
),
onPressed: () {
controller.shouldObscurePassword.value =
!controller.shouldObscurePassword.value;
},
),
),
),
),
Positioned(
left: 16.dp,
top: 2.dp,
child: Container(
color: ColorHelper.white,
padding: EdgeInsets.symmetric(horizontal: 8.dp),
child: Text(
'Password',
style: TextStyle(
fontSize: 14.dp,
fontWeight: FontWeight.w400,
color: ColorHelper.grey02,
),
),
),
),
],
);
}