AdaptiveApprovalDesk<T> constructor
const
AdaptiveApprovalDesk<T> ({
- Key? key,
- required List<
T> approvals, - required Widget itemBuilder(
- BuildContext context,
- T approval,
- bool selected,
- VoidCallback onTap,
- required Widget proposalBuilder(
- BuildContext context,
- T approval
- required Widget criteriaBuilder(
- BuildContext context,
- T approval
- required Widget historyBuilder(
- BuildContext context,
- T approval
- required String approvalTitle,
- required String criteriaTitle,
- required String historyTitle,
- Widget? header,
- Widget? emptyState,
- String? approvalDescription,
- Widget? approvalLeading,
- String? criteriaDescription,
- Widget? criteriaLeading,
- String? historyDescription,
- Widget? historyLeading,
- String modalApprovalLabel = 'Open approvals',
- Widget modalApprovalIcon = const Icon(Icons.approval_outlined),
- String modalCriteriaLabel = 'Open criteria',
- Widget modalCriteriaIcon = const Icon(Icons.fact_check_outlined),
- String modalHistoryLabel = 'Open history',
- Widget modalHistoryIcon = const Icon(Icons.history_outlined),
- AdaptiveSize approvalDockedAt = AdaptiveSize.medium,
- AdaptiveSize criteriaDockedAt = AdaptiveSize.expanded,
- AdaptiveSize historyDockedAt = AdaptiveSize.expanded,
- AdaptiveHeight minimumApprovalDockedHeight = AdaptiveHeight.compact,
- AdaptiveHeight minimumCriteriaDockedHeight = AdaptiveHeight.medium,
- AdaptiveHeight minimumHistoryDockedHeight = AdaptiveHeight.expanded,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- int? selectedIndex,
- int initialIndex = 0,
- ValueChanged<
int> ? onSelectedIndexChanged, - double spacing = 16,
- double itemSpacing = 12,
- int approvalFlex = 2,
- int proposalFlex = 4,
- int criteriaFlex = 2,
- int proposalPaneFlex = 3,
- int historyFlex = 2,
- EdgeInsetsGeometry approvalPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry proposalPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry criteriaPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry historyPadding = 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 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,
});