Skip to content

Commit d71b866

Browse files
committed
fix:android issue marked for review
1 parent b5b76c3 commit d71b866

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

lib/StorageProvider.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,20 @@ class StorageProvider {
5656
basePath = path.join(useCustomPath == true ? customPath.isNotEmpty ? customPath : appDir.path : appDir.path, 'Dartotsu');
5757
}
5858

59+
final baseDirectory = Directory(basePath);
60+
if (!baseDirectory.existsSync()) {
61+
baseDirectory.createSync(recursive: true);
62+
}
63+
5964
final fullPath = path.join(basePath, subPath ?? '');
60-
return Directory(fullPath);
61-
}
65+
final fullDirectory = Directory(fullPath);
6266

67+
if (subPath != null && subPath.isNotEmpty && !fullDirectory.existsSync()) {
68+
fullDirectory.createSync(recursive: true);
69+
}
70+
71+
return fullDirectory;
72+
}
6373
Future<Isar> initDB(String? path, {bool inspector = false}) async {
6474
Directory? dir;
6575
if (path == null) {

lib/logger.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Logger {
1717
if (!await directory.exists()) {
1818
await directory.create(recursive: true);
1919
}
20-
_logFile = File('${directory.path}\\appLogs.txt');
20+
_logFile = File('${directory.path}/appLogs.txt');
2121

2222
if (await _logFile!.exists()) {
2323
await _logFile!.delete();

0 commit comments

Comments
 (0)