mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
desktop: Switch to file_picker
This commit is contained in:
parent
777c89fed4
commit
25b0a9f436
6 changed files with 9 additions and 21 deletions
|
|
@ -1,21 +1,13 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:file_chooser/file_chooser.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:musicus_common/musicus_common.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
class MusicusDesktopPlatform extends MusicusPlatform {
|
||||
@override
|
||||
Future<String> chooseBasePath() async {
|
||||
final result = await showOpenPanel(
|
||||
canSelectDirectories: true,
|
||||
);
|
||||
|
||||
if (result != null && !result.canceled) {
|
||||
return result.paths.first;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return await FilePicker.platform.getDirectoryPath();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue