flutterColorToHex static method
Convert the given Flutter color
object to a hex ARGB string. With our without a leading hash sign based on leadingHashSign
.
Implementation
static String flutterColorToHex(Color color, bool leadingHashSign) {
return '${leadingHashSign ? '#' : ''}'
'${color.alpha.toRadixString(16).padLeft(2, '0')}'
'${color.red.toRadixString(16).padLeft(2, '0')}'
'${color.green.toRadixString(16).padLeft(2, '0')}'
'${color.blue.toRadixString(16).padLeft(2, '0')}';
}