build(BuildContext context) {
return TextField(
focusNode: widget.focusNode,
controller: widget.controller,
decoration: InputDecoration(
hintText: widget.hintText,
hintStyle: TextStyle(
color: Colors.red,
fontSize: 16,
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: borderColor), // 동적 border 색상
),
),
onChanged: (value) {
setState(() {
borderColor =
value.isEmpty ? CGColor.secondary_2nd : CGColor.primary_2nd;
});
},
);
}
Widget
TextField 속성에 hitText와 hintStyle을 지정해주면 된다.