getIcon method
get converted icon widget. if icon already set, return now icon widget.
Implementation
Widget getIcon(bool onlyIconData) {
if (elParams.p.type != EnumBtnType.block) {
if (elParams.p.type == EnumBtnType.icon ||
elParams.p.type == EnumBtnType.iconFilled ||
elParams.p.type == EnumBtnType.iconFilledTonal ||
elParams.p.type == EnumBtnType.iconOutlined) {
if (elParams.p.iconBtnParams?.icon != null) {
return elParams.p.iconBtnParams!.icon!;
}
} else if (elParams.p.type == EnumBtnType.faSmall ||
elParams.p.type == EnumBtnType.faExtended ||
elParams.p.type == EnumBtnType.fa ||
elParams.p.type == EnumBtnType.faLarge) {
if (elParams.p.faButtonParams?.fabExtParams.icon != null) {
return elParams.p.faButtonParams!.fabExtParams.icon!;
}
} else {
if (elParams.p.normalBtnParams?.icon != null) {
return elParams.p.normalBtnParams!.icon!;
}
}
}
if (onlyIconData) {
return Icon(params[EnumSpWMLParams.iconNum]);
} else {
return Icon(
params[EnumSpWMLParams.iconNum]!,
size: params.containsKey(EnumSpWMLParams.iconSize)
? params[EnumSpWMLParams.iconSize]
: null,
color: params.containsKey(EnumSpWMLParams.iconColor)
? params[EnumSpWMLParams.iconColor]
: null,
);
}
}