getIconSize method

double getIconSize(
  1. BuildContext context, {
  2. FastButtonSize? size,
  3. double? iconSize,
  4. Widget? icon,
})

Implementation

double getIconSize(
  BuildContext context, {
  FastButtonSize? size,
  double? iconSize,
  Widget? icon,
}) {
  if (iconSize != null) return iconSize;
  if ((icon is FaIcon) && icon.size != null) return icon.size!;
  if ((icon is Icon) && icon.size != null) return icon.size!;

  if (size != null) {
    switch (size) {
      case FastButtonSize.large:
        return FastIconButtonSpec.large.iconSize;
      case FastButtonSize.medium:
        return FastIconButtonSpec.medium.iconSize;
      case FastButtonSize.small:
        return FastIconButtonSpec.small.iconSize;
    }
  }

  return kFastIconSizeSmall;
}