AAListItem constructor

AAListItem({
  1. required String title,
  2. String? subtitle,
  3. String? image,
  4. String? imageUrl,
  5. AutoImageTint? imageTint,
  6. String? trailingImage,
  7. AutoImageTint? trailingImageTint,
  8. String? loadingMessage,
  9. bool? isBrowsable,
  10. AAToggle? toggle,
  11. FutureOr<void> onPress(
    1. dynamic complete(),
    2. AAListItem self
    )?,
  12. String? id,
})

Implementation

AAListItem({
  required this.title,
  this.subtitle,
  String? image,
  String? imageUrl,
  this.imageTint,
  this.trailingImage,
  this.trailingImageTint,
  this.loadingMessage,
  this.isBrowsable,
  this.toggle,
  this.onPress,
  String? id,
})  : imageUrl = imageUrl ?? image,
      assert(
        isBrowsable != true || toggle == null,
        'A browsable row must not have a toggle set.',
      ),
      assert(
        isBrowsable != true || onPress != null,
        'A browsable row must have an onClickListener set.',
      ),
      assert(
        toggle == null || onPress == null,
        'If a row contains a toggle, it must not have an onClickListener set.',
      ),
      _elementId = id ?? const Uuid().v4();