Skip to content

Commit

Permalink
use Platform.pathSeparator for windows support.
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-jiao committed Feb 26, 2024
1 parent cb52bd7 commit b4a0c8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tools/ex_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class ExtFieldHandler<T> {
// an extension to control file list selection.
extension ExFile on FileSystemEntity {
// get file name
String get name => path.substring(path.lastIndexOf('/') + 1);
String get name => path.substring(path.lastIndexOf(Platform.pathSeparator) + 1);

// get the directory
String get directory => path.substring(0, path.lastIndexOf('/'));
String get directory => path.substring(0, path.lastIndexOf(Platform.pathSeparator));

static final ExtFieldHandler<bool> _selectionHandler = ExtFieldHandler();
bool get selected => _selectionHandler.getValue(path) ?? false;
Expand Down

0 comments on commit b4a0c8a

Please sign in to comment.