import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class GroupTextFiled extends StatelessWidget { final TextEditingController? controller; final String? placeholder; final double? height; final int? maxLines; final int? maxLength; final Alignment? alignment; final EdgeInsets? padding; final bool autoFocus; final ValueChanged? onSubmitted; final TextInputAction? textInputAction; final TextInputType? keyboardType; final FocusNode? focusNode; final TextStyle? textStyle; final TextStyle? placeholderTextStyle; final List? inputFormatters; final bool? enabled; final Decoration? decoration; final TextAlign textAlign; final ValueChanged? onChanged; const GroupTextFiled({ super.key, this.controller, this.placeholder, this.height, this.maxLines, this.maxLength, this.alignment, this.padding, this.autoFocus = false, this.onSubmitted, this.textInputAction, this.keyboardType, this.focusNode, this.textStyle, this.placeholderTextStyle, this.inputFormatters, this.enabled, this.decoration, this.onChanged, this.textAlign = TextAlign.start, }); @override Widget build(BuildContext context) { return InkWell( enableFeedback: false, onTap: focusNode != null ? () => focusNode!.requestFocus() : null, child: Container( height: height ?? 40, padding: padding ?? EdgeInsets.zero, alignment: alignment ?? Alignment.centerLeft, decoration: decoration, child: TextField( cursorColor: Colors.blue.withValues(alpha: 0.5), autofocus: autoFocus, keyboardType: keyboardType, textInputAction: textInputAction, style: textStyle ?? const TextStyle(color: Colors.white, fontSize: 14), controller: controller, inputFormatters: inputFormatters, maxLines: maxLines, maxLength: maxLength, onSubmitted: onSubmitted, focusNode: focusNode, enabled: enabled, onChanged: onChanged, textAlign: textAlign, decoration: InputDecoration( hintText: placeholder, border: InputBorder.none, labelText: "", counterText: "", isDense: true, isCollapsed: true, floatingLabelBehavior: FloatingLabelBehavior.always, hintStyle: placeholderTextStyle ?? const TextStyle(color: Color(0xff999999), fontSize: 14), ), ), ), ); } }