email added to profile view adnd custom text field changes

This commit is contained in:
2024-08-14 15:40:06 +05:30
parent cd83375b98
commit 17c100a035
5 changed files with 141 additions and 120 deletions

View File

@@ -12,8 +12,10 @@ class CustomTextFieldWidget extends StatelessWidget {
final ValueChanged<String>? onChange;
final bool isEnabled;
final bool isObscure;
final Widget? suffix;
final BorderRadius? borderRadius;
final Color? borderColor;
final Color? disabledColor;
final double? borderWidth;
final Widget? bottomChild;
final TextInputType? inputType;
@@ -33,17 +35,21 @@ class CustomTextFieldWidget extends StatelessWidget {
this.isObscure = false,
this.borderRadius,
this.borderColor,
this.disabledColor,
this.borderWidth = 1.0,
this.bottomChild,
this.textCapitalization,
this.inputType,
this.inputFormatters,
this.inputFormatters, this.suffix,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: isEnabled
? Colors.white
: disabledColor ?? CustomAppColors.kSmokeColor.withOpacity(0.5),
borderRadius: borderRadius,
border: Border.all(
color: borderColor ?? CustomAppColors.kSmokeColor,
@@ -54,75 +60,74 @@ class CustomTextFieldWidget extends StatelessWidget {
vertical: 10.h,
horizontal: 15.w,
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
child: Row(
children: [
// CustomTextWidget(
// text: heading,
// fontSize: 10.sp,
// fontWeight: FontWeight.w500,
// fontColor: CustomAppColors.kLightTextColor,
// alignment: Alignment.centerLeft,
// textAlign: TextAlign.left,
// ),
Text(
heading,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w500,
color: CustomAppColors.kLightTextColor,
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
heading,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w500,
color: CustomAppColors.kLightTextColor,
),
),
4.verticalSpace,
TextField(
controller: controller,
enabled: isEnabled,
obscureText: isObscure,
minLines: minLines,
maxLines: maxLines,
maxLength: maxLength,
inputFormatters: inputFormatters,
onChanged: (_) {
if (onChange != null) {
onChange!(_);
}
},
keyboardType: inputType,
textCapitalization: textCapitalization ?? TextCapitalization.none,
cursorColor: CustomAppColors.kSecondaryColor,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kIconColor,
),
decoration: InputDecoration(
isDense: true,
hintText: hintText,
hintStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
counterText: "",
contentPadding: EdgeInsets.zero,
border: const OutlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
disabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
),
),
if (bottomChild != null) bottomChild!,
],
),
),
4.verticalSpace,
TextField(
controller: controller,
enabled: isEnabled,
obscureText: isObscure,
minLines: minLines,
maxLines: maxLines,
maxLength: maxLength,
inputFormatters: inputFormatters,
onChanged: (_) {
if (onChange != null) {
onChange!(_);
}
},
keyboardType: inputType,
textCapitalization: textCapitalization ?? TextCapitalization.none,
cursorColor: CustomAppColors.kSecondaryColor,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kIconColor,
),
decoration: InputDecoration(
isDense: true,
hintText: hintText,
hintStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
counterText: "",
contentPadding: EdgeInsets.zero,
border: const OutlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
disabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
),
),
if (bottomChild != null) bottomChild!,
suffix ?? const SizedBox.shrink(),
],
),
);