number static method

Widget number(
  1. num value, {
  2. int decimals = 2,
  3. String? suffix,
  4. bool colorSign = false,
})

Implementation

static Widget number(num value, {int decimals = 2, String? suffix, bool colorSign = false}) =>
    Builder(builder: (c) {
      final s = _group(value, decimals);
      final neg = value < 0;
      return Align(
        alignment: Alignment.centerRight,
        child: Text(
          suffix == null ? s : '$s\u202F$suffix',
          style: _mono(c).copyWith(
            color: colorSign ? (neg ? const Color(0xFFEF4444) : const Color(0xFF1DB88A)) : null,
          ),
        ),
      );
    });