AdaptiveApprovalDesk<T> constructor

const AdaptiveApprovalDesk<T>({
  1. Key? key,
  2. required List<T> approvals,
  3. required Widget itemBuilder(
    1. BuildContext context,
    2. T approval,
    3. bool selected,
    4. VoidCallback onTap,
    ),
  4. required Widget proposalBuilder(
    1. BuildContext context,
    2. T approval
    ),
  5. required Widget criteriaBuilder(
    1. BuildContext context,
    2. T approval
    ),
  6. required Widget historyBuilder(
    1. BuildContext context,
    2. T approval
    ),
  7. required String approvalTitle,
  8. required String criteriaTitle,
  9. required String historyTitle,
  10. Widget? header,
  11. Widget? emptyState,
  12. String? approvalDescription,
  13. Widget? approvalLeading,
  14. String? criteriaDescription,
  15. Widget? criteriaLeading,
  16. String? historyDescription,
  17. Widget? historyLeading,
  18. String modalApprovalLabel = 'Open approvals',
  19. Widget modalApprovalIcon = const Icon(Icons.approval_outlined),
  20. String modalCriteriaLabel = 'Open criteria',
  21. Widget modalCriteriaIcon = const Icon(Icons.fact_check_outlined),
  22. String modalHistoryLabel = 'Open history',
  23. Widget modalHistoryIcon = const Icon(Icons.history_outlined),
  24. AdaptiveSize approvalDockedAt = AdaptiveSize.medium,
  25. AdaptiveSize criteriaDockedAt = AdaptiveSize.expanded,
  26. AdaptiveSize historyDockedAt = AdaptiveSize.expanded,
  27. AdaptiveHeight minimumApprovalDockedHeight = AdaptiveHeight.compact,
  28. AdaptiveHeight minimumCriteriaDockedHeight = AdaptiveHeight.medium,
  29. AdaptiveHeight minimumHistoryDockedHeight = 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 approvalFlex = 2,
  38. int proposalFlex = 4,
  39. int criteriaFlex = 2,
  40. int proposalPaneFlex = 3,
  41. int historyFlex = 2,
  42. EdgeInsetsGeometry approvalPadding = const EdgeInsets.all(16),
  43. EdgeInsetsGeometry proposalPadding = const EdgeInsets.all(16),
  44. EdgeInsetsGeometry criteriaPadding = const EdgeInsets.all(16),
  45. EdgeInsetsGeometry historyPadding = 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 approval desk.

Implementation

const AdaptiveApprovalDesk({
  super.key,
  required this.approvals,
  required this.itemBuilder,
  required this.proposalBuilder,
  required this.criteriaBuilder,
  required this.historyBuilder,
  required this.approvalTitle,
  required this.criteriaTitle,
  required this.historyTitle,
  this.header,
  this.emptyState,
  this.approvalDescription,
  this.approvalLeading,
  this.criteriaDescription,
  this.criteriaLeading,
  this.historyDescription,
  this.historyLeading,
  this.modalApprovalLabel = 'Open approvals',
  this.modalApprovalIcon = const Icon(Icons.approval_outlined),
  this.modalCriteriaLabel = 'Open criteria',
  this.modalCriteriaIcon = const Icon(Icons.fact_check_outlined),
  this.modalHistoryLabel = 'Open history',
  this.modalHistoryIcon = const Icon(Icons.history_outlined),
  this.approvalDockedAt = AdaptiveSize.medium,
  this.criteriaDockedAt = AdaptiveSize.expanded,
  this.historyDockedAt = AdaptiveSize.expanded,
  this.minimumApprovalDockedHeight = AdaptiveHeight.compact,
  this.minimumCriteriaDockedHeight = AdaptiveHeight.medium,
  this.minimumHistoryDockedHeight = AdaptiveHeight.expanded,
  this.useContainerConstraints = true,
  this.considerOrientation = false,
  this.selectedIndex,
  this.initialIndex = 0,
  this.onSelectedIndexChanged,
  this.spacing = 16,
  this.itemSpacing = 12,
  this.approvalFlex = 2,
  this.proposalFlex = 4,
  this.criteriaFlex = 2,
  this.proposalPaneFlex = 3,
  this.historyFlex = 2,
  this.approvalPadding = const EdgeInsets.all(16),
  this.proposalPadding = const EdgeInsets.all(16),
  this.criteriaPadding = const EdgeInsets.all(16),
  this.historyPadding = const EdgeInsets.all(16),
  this.modalHeightFactor = 0.72,
  this.showModalDragHandle = true,
  this.animateSize = true,
  this.animationDuration = const Duration(milliseconds: 250),
  this.animationCurve = Curves.easeInOutCubic,
});