icon method

RoundedIcon icon(
  1. BuildContext context
)

Implementation

RoundedIcon icon(BuildContext context) {
  final themeColors = ReownAppKitModalTheme.colorsOf(context);
  final radiuses = ReownAppKitModalTheme.radiusesOf(context);
  switch (type) {
    case ToastType.success:
      return RoundedIcon(
        assetPath: 'lib/modal/assets/icons/checkmark.svg',
        assetColor: themeColors.success100,
        circleColor: themeColors.success100.withOpacity(0.15),
        borderColor: Colors.transparent,
        padding: 5.0,
        size: 24.0,
        borderRadius: radiuses.isSquare() ? 0.0 : null,
      );
    case ToastType.error:
      return RoundedIcon(
        assetPath: 'lib/modal/assets/icons/close.svg',
        assetColor: themeColors.error100,
        circleColor: themeColors.error100.withOpacity(0.15),
        borderColor: Colors.transparent,
        padding: 5.0,
        size: 24.0,
        borderRadius: radiuses.isSquare() ? 0.0 : null,
      );
    default:
      return RoundedIcon(
        assetPath: 'lib/modal/assets/icons/info.svg',
        assetColor: themeColors.accent100,
        circleColor: themeColors.accent100.withOpacity(0.15),
        borderColor: Colors.transparent,
        padding: 5.0,
        size: 24.0,
        borderRadius: radiuses.isSquare() ? 0.0 : null,
      );
  }
}