openWorkflowAttachments method

Future<void> openWorkflowAttachments({
  1. required String pageTitle,
})

打开审批附件管理页

Implementation

Future<void> openWorkflowAttachments({
  required String pageTitle,
}) async {
  if (!workflowAttachmentEnabled || !mounted) {
    return;
  }

  final List<Map<String, dynamic>>? result =
      await context.navigator.push<List<Map<String, dynamic>>>(
    AttachmentsPage(
      title: pageTitle,
      attachments: List<Map<String, dynamic>>.from(workflowAttachments),
      selectType: workflowAttachmentConfig.selectType,
      subSystemCode: workflowAttachmentSubSystemCode,
      maxCount: workflowAttachmentConfig.maxCount,
    ).buildPageRoute(),
  );

  if (result == null) {
    return;
  }

  workflowAttachments
    ..clear()
    ..addAll(result);

  safeSetState(() {});
}