AdaptivePresentationDesk<T> constructor

const AdaptivePresentationDesk<T>({
  1. Key? key,
  2. required List<T> slides,
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. T slide,
    3. bool selected,
    4. VoidCallback onTap,
    ),
  4. required Widget stageBuilder(
    1. BuildContext context,
    2. T slide
    ),
  5. required Widget notesBuilder(
    1. BuildContext context,
    2. T slide
    ),
  6. required String listTitle,
  7. required String notesTitle,
  8. Widget? header,
  9. Widget? emptyState,
  10. String? listDescription,
  11. Widget? listLeading,
  12. String? notesDescription,
  13. Widget? notesLeading,
  14. String modalListLabel = 'Open slides',
  15. Widget modalListIcon = const Icon(Icons.view_carousel_outlined),
  16. String modalNotesLabel = 'Open notes',
  17. Widget modalNotesIcon = const Icon(Icons.sticky_note_2_outlined),
  18. AdaptiveSize listDockedAt = AdaptiveSize.medium,
  19. AdaptiveSize notesDockedAt = AdaptiveSize.expanded,
  20. AdaptiveHeight minimumListDockedHeight = AdaptiveHeight.compact,
  21. AdaptiveHeight minimumNotesDockedHeight = AdaptiveHeight.medium,
  22. bool useContainerConstraints = true,
  23. bool considerOrientation = false,
  24. int? selectedIndex,
  25. int initialIndex = 0,
  26. ValueChanged<int>? onSelectedIndexChanged,
  27. double spacing = 16,
  28. double itemSpacing = 12,
  29. int listFlex = 2,
  30. int stageFlex = 4,
  31. int notesFlex = 2,
  32. EdgeInsetsGeometry listPadding = const EdgeInsets.all(16),
  33. EdgeInsetsGeometry stagePadding = const EdgeInsets.all(16),
  34. EdgeInsetsGeometry notesPadding = const EdgeInsets.all(16),
  35. double modalHeightFactor = 0.72,
  36. bool showModalDragHandle = true,
  37. bool animateSize = true,
  38. Duration animationDuration = const Duration(milliseconds: 250),
  39. Curve animationCurve = Curves.easeInOutCubic,
})

Creates an adaptive presentation desk.

Implementation

const AdaptivePresentationDesk({
  super.key,
  required this.slides,
  required this.itemBuilder,
  required this.stageBuilder,
  required this.notesBuilder,
  required this.listTitle,
  required this.notesTitle,
  this.header,
  this.emptyState,
  this.listDescription,
  this.listLeading,
  this.notesDescription,
  this.notesLeading,
  this.modalListLabel = 'Open slides',
  this.modalListIcon = const Icon(Icons.view_carousel_outlined),
  this.modalNotesLabel = 'Open notes',
  this.modalNotesIcon = const Icon(Icons.sticky_note_2_outlined),
  this.listDockedAt = AdaptiveSize.medium,
  this.notesDockedAt = AdaptiveSize.expanded,
  this.minimumListDockedHeight = AdaptiveHeight.compact,
  this.minimumNotesDockedHeight = AdaptiveHeight.medium,
  this.useContainerConstraints = true,
  this.considerOrientation = false,
  this.selectedIndex,
  this.initialIndex = 0,
  this.onSelectedIndexChanged,
  this.spacing = 16,
  this.itemSpacing = 12,
  this.listFlex = 2,
  this.stageFlex = 4,
  this.notesFlex = 2,
  this.listPadding = const EdgeInsets.all(16),
  this.stagePadding = const EdgeInsets.all(16),
  this.notesPadding = const EdgeInsets.all(16),
  this.modalHeightFactor = 0.72,
  this.showModalDragHandle = true,
  this.animateSize = true,
  this.animationDuration = const Duration(milliseconds: 250),
  this.animationCurve = Curves.easeInOutCubic,
})  : assert(spacing >= 0, 'spacing must be zero or greater.'),
      assert(itemSpacing >= 0, 'itemSpacing must be zero or greater.'),
      assert(listFlex > 0, 'listFlex must be greater than zero.'),
      assert(stageFlex > 0, 'stageFlex must be greater than zero.'),
      assert(notesFlex > 0, 'notesFlex must be greater than zero.'),
      assert(
        modalHeightFactor > 0 && modalHeightFactor <= 1,
        'modalHeightFactor must be between 0 and 1.',
      );