[Flutter]TextFormFieldのパディングを設定するには?

Flutter

どうも、ちょげ(@chogetarou)です。

TextFormFieldのパディングを設定する方法を紹介します。

スポンサーリンク

方法

インターフェース, インターネット, プログラム, ブラウザ, Www

TextFormFieldのパディングを設定するには、InputDecorationを使います。

まず、TextFormFieldの引数「decoraiton」にInputDecorationを指定します。

そして、InputDecorationの引数「contentPadding」にパディングを指定します。

パディングの指定は、EdgeInsetsを使って行います。

TextFormField(
  decoration: InputDecoration(
    contentPadding: /*EdgeInsetsでパディングを設定*/,
  ),
),

InputDecorationを使えば、TextFomFieldのパディングを設定することが出来ます。

使用例

以下は、使用例です。

TextFormField(
  decoration: InputDecoration(
    contentPadding: EdgeInsets.all(50),
    border: OutlineInputBorder(),
  ),
),

コメント

タイトルとURLをコピーしました