getBackgroundColor function

Color getBackgroundColor({
  1. EasyThemeType? type,
  2. bool? ghost,
  3. Color? color,
})

Implementation

Color getBackgroundColor({
  EasyThemeType? type,
  bool? ghost,
  Color? color,
}) {
  bool isGhost = ghost != null && ghost;
  if (isGhost) return iTransparent;
  Color bgColor = color ?? iBorderColor;
  if (type == null) return bgColor;
  switch (type) {
    case EasyThemeType.primary:
      bgColor = iPrimary;
      break;
    case EasyThemeType.info:
      bgColor = iInfo;
      break;
    case EasyThemeType.success:
      bgColor = iSuccess;
      break;
    case EasyThemeType.warn:
      bgColor = iWarn;
      break;
    case EasyThemeType.error:
      bgColor = iError;
      break;
  }
  return bgColor;
}