FLStaticItemData constructor

FLStaticItemData({
  1. FLStaticListCellType cellType = FLStaticListCellType.normal,
  2. Widget? leading,
  3. String? title,
  4. TextStyle? titleStyle,
  5. String? subtitle,
  6. TextStyle? subtitleStyle,
  7. FLStaticListCellAccessoryType accessoryType = FLStaticListCellAccessoryType.accNone,
  8. String? accessoryString,
  9. Widget? customTrailing,
  10. Color? cellColor,
  11. VoidCallback? onTap,
  12. bool accItemValue = false,
  13. bool selected = false,
  14. ValueChanged<bool?>? onChanged,
  15. String? buttonTitle,
  16. Color? buttonTitleColor,
  17. Color? buttonColor,
  18. VoidCallback? onButtonPressed,
  19. Widget? customizeContent,
})

Implementation

FLStaticItemData({
  this.cellType = FLStaticListCellType.normal,
  this.leading,
  this.title,
  this.titleStyle,
  this.subtitle,
  this.subtitleStyle,
  this.accessoryType = FLStaticListCellAccessoryType.accNone,
  this.accessoryString,
  this.customTrailing,
  this.cellColor,
  this.onTap,
  this.accItemValue = false,
  this.selected = false,
  this.onChanged,
  this.buttonTitle,
  this.buttonTitleColor,
  this.buttonColor,
  this.onButtonPressed,
  this.customizeContent,
})  : assert(() {
        if (cellType == FLStaticListCellType.normal &&
            (leading == null && title == null && subtitle == null)) {
          throw AssertionError(
            'List cell must have a leading or title or subtitle',
          );
        }

        if (cellType == FLStaticListCellType.customization &&
            customizeContent == null) {
          throw AssertionError(
            'Must specify the content when cell\s type is customization',
          );
        }

        if (customTrailing != null &&
            accessoryType != FLStaticListCellAccessoryType.accNone) {
          throw AssertionError(
              'Could not set trailing widget when accessory type != none');
        }
        if (accessoryString != null &&
            accessoryType != FLStaticListCellAccessoryType.accDetail) {
          throw AssertionError(
              'Accessory string only can be shown when cell\'s accessory type is accDetail');
        }
        return true;
      }()),
      super();