colorToHexString function

String? colorToHexString(
  1. Color? color
)

Implementation

String? colorToHexString(Color? color) {
  if (color == null) return null;
  return '#${(color.value & 0xFFFFFF).toRadixString(16).padLeft(6, '0').toUpperCase()}';
}