patch swb directory selection on windows

had paths with mixed usage of / and \

closes https://github.com/cypherstack/stack_wallet/issues/829
This commit is contained in:
sneurlax 2024-07-11 20:09:34 -05:00 committed by julian-CStack
parent d1780aa82e
commit 91037cc5a6

View file

@ -82,17 +82,20 @@ class SWBFileSystem {
}
Future<void> pickDir(BuildContext context) async {
final String? path;
final String? chosenPath;
if (Platform.isIOS) {
path = startPath?.path;
chosenPath = startPath?.path;
} else {
path = await FilePicker.platform.getDirectoryPath(
final String path = Platform.isWindows
? startPath!.path.replaceAll("/", "\\")
: startPath!.path;
chosenPath = await FilePicker.platform.getDirectoryPath(
dialogTitle: "Choose Backup location",
initialDirectory: startPath!.path,
initialDirectory: path,
lockParentWindow: true,
);
}
dirPath = path;
dirPath = chosenPath;
}
Future<void> openFile(BuildContext context) async {