Flutter TextFormFieldの右側にアイコンを表示する
環境
Windows11 pro 64bit
Flutter 3.3.7
構文
TextFormFieldの右側にアイコンを表示するには、InputDecorationの引数「suffixIcon」を使います。
形式
TextFormField( decoration: InputDecoration( suffixIcon: Icon(/*アイコン*/), ), )
使用例
TextFormField( decoration: InputDecoration( suffixIcon: Icon(Icons.clear_rounded), border: OutlineInputBorder(), ), ),
説明
TextFormFieldの引数「decoration」に「InputDecoration」を指定します。
InputDecorationの引数「suffixIcon」に左側に表示したいアイコンを指定します。