fa method

FaIcon fa({
  1. IconData? icon,
  2. Key? key,
  3. double? size,
  4. Color? color,
  5. String? semanticLabel,
  6. TextDirection? textDirection,
})

FaIcon(package:font_awesome_flutter)のラッパー 引数でアイコン(https://fontawesome.com/icons/)や 色、サイズの指定がされておらず 既に共通設定されている場合はそれを参照する(呼び出し時に上書き可能)

例: XXX.faIcon = FontAwesomeIcons.solidHeart; XXX.faColor = Colors.pink; XXX.faSize = 14;

Text.rich( TextSpan( children: const TextSpan(text: 'サンプル'), WidgetSpan( child: XXX.fa( color: Colors.red, size: 20, ), ), , ), )

Implementation

FaIcon fa({
  IconData? icon,
  Key? key,
  double? size,
  Color? color,
  String? semanticLabel,
  TextDirection? textDirection,
}) {
  icon ??= _faIcon ?? FontAwesomeIcons.circleQuestion;
  if (color == null && _faColor != null) color = _faColor;
  if (size == null && _faSize != null) size = _faSize;
  return FaIcon(
    icon,
    key: key,
    size: size,
    color: color,
    semanticLabel: semanticLabel,
    textDirection: textDirection,
  );
}