import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:wow_english/common/extension/string_extension.dart'; class TextFieldCustomerWidget extends StatefulWidget { const TextFieldCustomerWidget({super.key, this.controller, this.hitStyle, this.textStyle, this.bgImageName, this.hitText, this.width, this.height, this.textAlign, this.textInputType, this.obscureText, this.onChangeValue }); final TextEditingController? controller; final TextStyle? hitStyle; final TextStyle? textStyle; final String? bgImageName; final String? hitText; final double? width; final double? height; final TextAlign? textAlign; final TextInputType? textInputType; final bool? obscureText; final Function(String value)? onChangeValue; @override State createState() { return _TextFieldCustomerWidgetState(); } } class _TextFieldCustomerWidgetState extends State { @override Widget build(BuildContext context) { return Container( height: widget.height??45.h, width: widget.width??double.infinity, alignment: Alignment.center, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( '${widget.bgImageName}'.assetPng ), fit: BoxFit.fill, ) ), child: TextField( controller: widget.controller, textAlign: widget.textAlign??TextAlign.center, textInputAction: TextInputAction.done, keyboardType: widget.textInputType, obscureText: widget.obscureText?? false, decoration: InputDecoration( hintText: widget.hitText??'', border: InputBorder.none, hintStyle: widget.hitStyle?? const TextStyle( fontSize: 16, color:Color(0xFF999999) ) ), style: widget.textStyle?? const TextStyle( color: Color(0xFF333333), fontSize: 16, ), onChanged: widget.onChangeValue, ), ); } }