Skip to content

Commit

Permalink
refactor: move blob_storage_handler.dart and add download feature
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Nov 14, 2023
1 parent 0f45591 commit 9546e7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/util/multimodal/persistent_storage_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:typed_data';
import 'package:cross_file/cross_file.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'blob_storage_handler.dart';
import 'package:studyu_core/core.dart';
import 'encrypted_audio_file.dart';
import 'encrypter_handler.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:typed_data';

import 'package:studyu_core/env.dart' as env;

Expand All @@ -9,4 +10,8 @@ class BlobStorageHandler {
// we use uploadBinary instead of upload until this is fixed: https://github.com/supabase/supabase-flutter/issues/685
await env.client.storage.from(_observationsBucketName).uploadBinary(aFileName, aFile.readAsBytesSync());
}

Future<Uint8List> downloadObservation(String aFile) async {
return await env.client.storage.from(_observationsBucketName).download(aFile);
}
}
1 change: 1 addition & 0 deletions core/lib/src/util/util.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export 'extensions.dart';
export 'multimodal/blob_storage_handler.dart';
export 'supabase_object.dart';

0 comments on commit 9546e7d

Please sign in to comment.