Files
pipelines/app/lib/features/artifacts/actions/artifact_transfer_stub.dart
T

30 lines
1.0 KiB
Dart

import 'artifact_file.dart';
import 'artifact_transfer.dart';
/// Native fallback for artifact file actions.
///
/// A save/share plugin is not a dependency of this slice, so a non-web host
/// reports `unsupported` instead of pretending to save a file. The action row
/// disables the control and shows this exact explanation.
bool get artifactDownloadSupported => false;
bool get artifactShareSupported => false;
String get artifactDownloadUnsupportedMessage =>
'Downloading files is not supported on this platform yet.';
String get artifactShareUnsupportedMessage =>
'File sharing is not supported on this platform yet.';
Future<ArtifactTransferResult> saveArtifactFile(ArtifactFile file) async =>
ArtifactTransferResult(
ArtifactTransferState.unsupported,
artifactDownloadUnsupportedMessage,
);
Future<ArtifactTransferResult> shareArtifactFile(ArtifactFile file) async =>
ArtifactTransferResult(
ArtifactTransferState.unsupported,
artifactShareUnsupportedMessage,
);