dynToHex function

dynamic dynToHex(
  1. dynamic value
)

Implementation

dynamic dynToHex(dynamic value) {
  if (value is int) return value.toHexWithPrefix;
  if (value is String) return value;

  throw Exception('Could not convert $value to hex');
}