Skip to content

Commit

Permalink
Adding Full path to the storage
Browse files Browse the repository at this point in the history
  • Loading branch information
javad-zobeidi committed Mar 17, 2024
1 parent 3ec97f9 commit 5401dc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/src/storage/local_storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ class LocalStorage implements StorageDriver {
await file.writeAsBytes(bytes);
return file.path.replaceFirst(storagePath, '');
}

@override
String fullPath(String file) => "$storagePath/$file";
}
10 changes: 6 additions & 4 deletions lib/src/storage/storage_driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import 'dart:typed_data';

abstract class StorageDriver {
Future<String> put(
String filePath,
String fileName,
List<int> bytes,
);

Future<Uint8List?> get(String filepath);
Future<Uint8List?> get(String fileName);

String fullPath(String file);

Future<bool> exists(String filepath);
Future<bool> exists(String fileName);

Future<dynamic> delete(String filepath);
Future<dynamic> delete(String fileName);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ dependencies:
dev_dependencies:
lints: ^3.0.0
test: ^1.25.2
http: ^1.2.0
http: ^1.2.1
http_parser: ^4.0.2

0 comments on commit 5401dc3

Please sign in to comment.