Flutter Textで表示するテキストを太字にするサンプル

環境
Windows11 pro 64bit
Flutter 3.3.7

構文
fontWeight: FontWeight.bold,
Textのテキストを太字にするには、引数「style」を使います。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Text(
'テスト内容',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
Text( 'テスト内容', style: TextStyle( fontWeight: FontWeight.bold, ), ),
Text(
  'テスト内容',
  style: TextStyle(
    fontWeight: FontWeight.bold,
  ),
),

Textの引数「style」にTextStyleを指定します。
TextStyleの引数「fontWeight」に「FontWeight.bold」を指定します。

Flutter

Posted by arkgame