buildChildWithIcon function
A utility function to build a widget containing an icon and optional text with a specified gap.
Parameters:
iconButton: The custom icon button that contains the icon, optional text, and color.iconPadding: The padding between the icon and the text, if text is provided.textStyle: The style for the text, if text is provided.
Returns: A widget containing the icon and optional text wrapped with appropriate padding.
Implementation
Widget buildChildWithIcon(
CustomIconButton iconButton, double iconPadding, TextStyle textStyle) {
return buildChildWithIC(
iconButton.text, iconButton.icon, iconPadding, textStyle);
}