Files
PeachDeployments/lib/Peach/see/service/ViewServiceEditor.dart
alvocool 38881d1fe1 Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:15:30 +03:00

27 lines
821 B
Dart

import 'package:file_picker/file_picker.dart';
import '../parent/ParentViewModel.dart';
import 'ConnectServiceEditor.dart';
class ViewServiceEditor extends ParentViewModel {
ConnectServiceEditor connection;
ViewServiceEditor(super.context, this.connection);
/// True on desktop, where a local build can actually run.
bool get canBuildLocally => getDataManager().buildSupported;
/// Opens the OS folder picker for the service's source project.
void pickProjectDirectory() async {
try {
final directory = await FilePicker.getDirectoryPath(
dialogTitle: 'Select the service project folder',
);
if (directory == null) return;
connection.onProjectDirectoryPicked(directory);
} catch (error) {
handleError(error, pickProjectDirectory, () {}, "Retry");
}
}
}