[Flutter]Text(テキスト)の下線の色を設定するには?

Flutter

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

Textの下線の色を設定する方法を紹介します。

スポンサーリンク

方法

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

Textの下線の色を設定するには、TextStyleの引数「decorationColor」を使います。

具体的には、TextStyleの引数「decorationColor」に下線の色を指定します。

Text(
  'Hello Flutter',
  style: TextStyle(
    decoration: TextDecoration.underline,
    decorationColor: /*下線の色*/,
  ),
),

TextStyleの引数「decorationColor」を使えば、Text(テキスト)の下線の色を設定することが出来ます。

使用例

以下は、使用例です。

Text(
  'Hello Flutter',
  style: TextStyle(
    decoration: TextDecoration.underline,
    decorationColor: Colors.red,
  ),
),

コメント

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