diff --git a/lib/src/resources/firebase_storage_provider.dart b/lib/src/resources/firebase_storage_provider.dart index e45f9c5..8d043ce 100644 --- a/lib/src/resources/firebase_storage_provider.dart +++ b/lib/src/resources/firebase_storage_provider.dart @@ -1,4 +1,22 @@ import 'dart:async'; import 'dart:io'; -import 'package:' \ No newline at end of file +import 'package:firebase_storage/firebase_storage.dart'; +import 'package:uuid/uuid.dart'; + +class FirebaseStorageProvider { + final FirebaseStorage _storage; + final Uuid _uuid; + // [FirebaseStorage] and [Uuid] instances can be injected for testing purposes. + // Don't remove. + FirebaseStorageProvider([FirebaseStorage storage, Uuid uuid]) + : _storage = storage ?? FirebaseStorage.instance, + _uuid = uuid ?? Uuid(); + + /// Uploads a given file to the firebase storage bucket. + /// + /// It returns a [StorageUploadTask] which contains the status of the upload. + /// The [folder] parameters allows the file to be stored at any path in the + /// bucket. + StorageUploadTask uploadFile(File file, {String folder}) {} +} diff --git a/pubspec.yaml b/pubspec.yaml index c958b3f..ce4e226 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: mockito: ^4.0.0 rxdart: ^0.20.0 sqflite: ^1.1.0 + uuid: ^2.0.0 dev_dependencies: flutter_test: