new: upgrade on macos

This commit is contained in:
lollipopkit
2023-08-30 17:06:24 +08:00
parent 8004c41094
commit 2f4b522189
11 changed files with 44 additions and 88 deletions

View File

@@ -1,12 +1,14 @@
import '../../../core/utils/platform.dart';
class PathWithPrefix {
/// It's used on platform's file system.
/// So use [Platform.pathSeparator] to join path.
class LocalPath {
final String _prefixPath;
String _path = '/';
String? _prePath;
String get path => _prefixPath + _path;
PathWithPrefix(String prefixPath) : _prefixPath = _trimSuffix(prefixPath);
LocalPath(String prefixPath) : _prefixPath = _trimSuffix(prefixPath);
void update(String newPath) {
_prePath = _path;
@@ -21,7 +23,7 @@ class PathWithPrefix {
_path = '/';
return;
}
_path = pathJoin(_path, newPath);
_path = joinPath(_path, newPath);
}
bool get canBack => path != '$_prefixPath/';