getItemStyle method Null safety

  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: _getFillColor(theme, index, itemCount),
      borderColor: theme.primaryColor,
      borderWidth: 0.0,
      textAlign: TextAlign.start,
      textStyle: TextStyle(color: theme.colorScheme.onPrimary),
    ),
  );
}