Skip to content

Commit

Permalink
Readd pathwithoutleadingslash
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 15, 2024
1 parent 09781be commit 887fb98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/lw_file_system_api/lib/src/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ abstract class ArchiveData<T> {
class SimpleArchiveData extends ArchiveData<SimpleArchiveData> {
SimpleArchiveData(super.archive, {super.state});
SimpleArchiveData.empty() : super.empty();
SimpleArchiveData.fromBytes(List<int> bytes) : super.fromBytes(bytes);
SimpleArchiveData.fromBytes(super.bytes);

@override
SimpleArchiveData updateState(ArchiveState state) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/lw_file_system_api/lib/src/entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sealed class FileSystemEntity<T> {

String get parent => location.parent;

bool get absolute => location.absolute;
String get pathWithoutLeadingSlash => location.pathWithoutLeadingSlash;
}

class FileSystemFile<T> extends FileSystemEntity<T> {
Expand Down
3 changes: 3 additions & 0 deletions packages/lw_file_system_api/lib/src/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class AssetLocation with AssetLocationMappable {

static const empty = AssetLocation(path: '');

String get pathWithoutLeadingSlash =>
path.startsWith('/') ? path.substring(1) : path;

bool get isEmpty => path.isEmpty;

bool get isRemote => remote.isNotEmpty;
Expand Down

0 comments on commit 887fb98

Please sign in to comment.