getGradient function
Implementation
Gradient? getGradient(Styles styles) {
if (styles.backgroundImage != null &&
(styles.backgroundImage as String).indexOf('linear-gradient') != -1) {
return HexColor.getLineGradient(styles.backgroundImage as String);
} else if (styles.backgroundColor != null &&
getTypeOf(styles.backgroundColor) == 'String' &&
(styles.backgroundColor as String).indexOf('linear-gradient') != -1) {
return HexColor.getLineGradient(styles.backgroundColor);
} else {
return null;
}
}