getItemStyle method

  1. @override
FortuneItemStyle getItemStyle(
  1. ThemeData theme,
  2. int index,
  3. int itemCount
)
override

Creates an FortuneItemStyle based on the passed theme while considering an item's index with respect to the overall itemCount.

Implementation

@override
FortuneItemStyle getItemStyle(ThemeData theme, int index, int itemCount) {
  return getDisabledItemStyle(
    theme,
    index,
    itemCount,
    () => FortuneItemStyle(
      color: color ??
          Color.alphaBlend(
            theme.colorScheme.primary.withOpacity(0.3),
            theme.colorScheme.surface,
          ),
      borderColor: borderColor ?? theme.colorScheme.primary,
      borderWidth: borderWidth ?? 1.0,
      textStyle: textStyle ?? TextStyle(color: theme.colorScheme.onSurface),
      textAlign: textAlign ?? TextAlign.center,
    ),
  );
}