Sumit
Sumit

Reputation: 570

How to Change TextField's hintText FontFamily in flutter

Container(
  margin: EdgeInsets.only(top: 15.0, bottom: 30.0),
  height: 50.0,
  padding:
  EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
  decoration: BoxDecoration(
    color: Colors.white,
    borderRadius: BorderRadius.circular(29.5)),
  child: TextField(
    decoration: InputDecoration(
      hintText: 'Search', /////////////////////////////////Here See It
      icon: SvgPicture.asset('assets/icons/search.svg'),
      border: InputBorder.none),
  ),
),

enter image description here

How to Change TextField's hintText FontFamily in the flutter u can see it on the image what I am trying to say

Upvotes: 0

Views: 1242

Answers (1)

Tirth Patel
Tirth Patel

Reputation: 5736

Use hintStyle property of InputDecoration and assign TextStyle to it then add fontFamily.

InputDecoration(
    hintText: 'Search',
    hintStyle: TextStyle(fontFamily: 'some-font'),
)

Upvotes: 3

Related Questions