AdaptiveIncidentDesk<T> constructor

const AdaptiveIncidentDesk<T>({
  1. Key? key,
  2. required List<T> incidents,
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. T incident,
    3. bool selected,
    4. VoidCallback onTap,
    ),
  4. required Widget detailBuilder(
    1. BuildContext context,
    2. T incident
    ),
  5. required Widget contextBuilder(
    1. BuildContext context,
    2. T incident
    ),
  6. required Widget timelineBuilder(
    1. BuildContext context,
    2. T incident
    ),
  7. required String listTitle,
  8. required String contextTitle,
  9. required String timelineTitle,
  10. Widget? header,
  11. Widget? emptyState,
  12. String? listDescription,
  13. Widget? listLeading,
  14. String? contextDescription,
  15. Widget? contextLeading,
  16. String? timelineDescription,
  17. Widget? timelineLeading,
  18. String modalListLabel = 'Open incidents',
  19. Widget modalListIcon = const Icon(Icons.warning_amber_outlined),
  20. String modalContextLabel = 'Open context',
  21. Widget modalContextIcon = const Icon(Icons.people_outline),
  22. String modalTimelineLabel = 'Open timeline',
  23. Widget modalTimelineIcon = const Icon(Icons.timeline_outlined),
  24. AdaptiveSize listDockedAt = AdaptiveSize.medium,
  25. AdaptiveSize contextDockedAt = AdaptiveSize.expanded,
  26. AdaptiveSize timelineDockedAt = AdaptiveSize.expanded,
  27. AdaptiveHeight minimumListDockedHeight = AdaptiveHeight.compact,
  28. AdaptiveHeight minimumContextDockedHeight = AdaptiveHeight.medium,
  29. AdaptiveHeight minimumTimelineDockedHeight = AdaptiveHeight.expanded,
  30. bool useContainerConstraints = true,
  31. bool considerOrientation = false,
  32. int? selectedIndex,
  33. int initialIndex = 0,
  34. ValueChanged<int>? onSelectedIndexChanged,
  35. double spacing = 16,
  36. double itemSpacing = 12,
  37. int listFlex = 2,
  38. int detailFlex = 4,
  39. int contextFlex = 2,
  40. int detailPaneFlex = 3,
  41. int timelineFlex = 2,
  42. EdgeInsetsGeometry listPadding = const EdgeInsets.all(16),
  43. EdgeInsetsGeometry detailPadding = const EdgeInsets.all(16),
  44. EdgeInsetsGeometry contextPadding = const EdgeInsets.all(16),
  45. EdgeInsetsGeometry timelinePadding = const EdgeInsets.all(16),
  46. double modalHeightFactor = 0.72,
  47. bool showModalDragHandle = true,
  48. bool animateSize = true,
  49. Duration animationDuration = const Duration(milliseconds: 250),
  50. Curve animationCurve = Curves.easeInOutCubic,
})

Creates an adaptive incident desk.

Implementation

const AdaptiveIncidentDesk({
  super.key,
  required this.incidents,
  required this.itemBuilder,
  required this.detailBuilder,
  required this.contextBuilder,
  required this.timelineBuilder,
  required this.listTitle,
  required this.contextTitle,
  required this.timelineTitle,
  this.header,
  this.emptyState,
  this.listDescription,
  this.listLeading,
  this.contextDescription,
  this.contextLeading,
  this.timelineDescription,
  this.timelineLeading,
  this.modalListLabel = 'Open incidents',
  this.modalListIcon = const Icon(Icons.warning_amber_outlined),
  this.modalContextLabel = 'Open context',
  this.modalContextIcon = const Icon(Icons.people_outline),
  this.modalTimelineLabel = 'Open timeline',
  this.modalTimelineIcon = const Icon(Icons.timeline_outlined),
  this.listDockedAt = AdaptiveSize.medium,
  this.contextDockedAt = AdaptiveSize.expanded,
  this.timelineDockedAt = AdaptiveSize.expanded,
  this.minimumListDockedHeight = AdaptiveHeight.compact,
  this.minimumContextDockedHeight = AdaptiveHeight.medium,
  this.minimumTimelineDockedHeight = AdaptiveHeight.expanded,
  this.useContainerConstraints = true,
  this.considerOrientation = false,
  this.selectedIndex,
  this.initialIndex = 0,
  this.onSelectedIndexChanged,
  this.spacing = 16,
  this.itemSpacing = 12,
  this.listFlex = 2,
  this.detailFlex = 4,
  this.contextFlex = 2,
  this.detailPaneFlex = 3,
  this.timelineFlex = 2,
  this.listPadding = const EdgeInsets.all(16),
  this.detailPadding = const EdgeInsets.all(16),
  this.contextPadding = const EdgeInsets.all(16),
  this.timelinePadding = 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(detailFlex > 0, 'detailFlex must be greater than zero.'),
      assert(contextFlex > 0, 'contextFlex must be greater than zero.'),
      assert(
        detailPaneFlex > 0,
        'detailPaneFlex must be greater than zero.',
      ),
      assert(timelineFlex > 0, 'timelineFlex must be greater than zero.'),
      assert(
        modalHeightFactor > 0 && modalHeightFactor <= 1,
        'modalHeightFactor must be between 0 and 1.',
      );