AdaptivePresentationDesk<T> constructor
const
AdaptivePresentationDesk<T> ({
- Key? key,
- required List<
T> slides, - required Widget itemBuilder(
- BuildContext context,
- T slide,
- bool selected,
- VoidCallback onTap,
- required Widget stageBuilder(
- BuildContext context,
- T slide
- required Widget notesBuilder(
- BuildContext context,
- T slide
- required String listTitle,
- required String notesTitle,
- Widget? header,
- Widget? emptyState,
- String? listDescription,
- Widget? listLeading,
- String? notesDescription,
- Widget? notesLeading,
- String modalListLabel = 'Open slides',
- Widget modalListIcon = const Icon(Icons.view_carousel_outlined),
- String modalNotesLabel = 'Open notes',
- Widget modalNotesIcon = const Icon(Icons.sticky_note_2_outlined),
- AdaptiveSize listDockedAt = AdaptiveSize.medium,
- AdaptiveSize notesDockedAt = AdaptiveSize.expanded,
- AdaptiveHeight minimumListDockedHeight = AdaptiveHeight.compact,
- AdaptiveHeight minimumNotesDockedHeight = AdaptiveHeight.medium,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- int? selectedIndex,
- int initialIndex = 0,
- ValueChanged<
int> ? onSelectedIndexChanged, - double spacing = 16,
- double itemSpacing = 12,
- int listFlex = 2,
- int stageFlex = 4,
- int notesFlex = 2,
- EdgeInsetsGeometry listPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry stagePadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry notesPadding = const EdgeInsets.all(16),
- double modalHeightFactor = 0.72,
- bool showModalDragHandle = true,
- bool animateSize = true,
- Duration animationDuration = const Duration(milliseconds: 250),
- 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.',
);