0
0
Fluttermobile~10 mins

Cloud Storage for files in Flutter - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the Firebase Storage package in Flutter.

Flutter
import 'package:firebase_[1]/firebase_storage.dart';
Drag options to blanks, or click blank then click option'
Aauth
Bstorage
Ccore
Ddatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'firebase_auth' instead of 'firebase_storage'.
Using 'firebase_core' which is for core Firebase features.
2fill in blank
medium

Complete the code to create a reference to the root of Firebase Storage.

Flutter
final storageRef = FirebaseStorage.instance.[1]();
Drag options to blanks, or click blank then click option'
Aref
Breference
CrootRef
DgetReference
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'reference' instead of 'ref'.
Using 'getReference' which is not a valid method.
3fill in blank
hard

Fix the error in the code to upload a file to Firebase Storage.

Flutter
await storageRef.child('uploads/file.txt').[1](file);
Drag options to blanks, or click blank then click option'
AuploadFile
BstoreFile
CputFile
DsendFile
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'uploadFile' which does not exist.
Using 'storeFile' which is not a valid method.
4fill in blank
hard

Fill in the blank to get the download URL of an uploaded file.

Flutter
String url = await storageRef.child('uploads/file.txt').[1]();
Drag options to blanks, or click blank then click option'
AdownloadLink
BdownloadURL
CgetUrl
DgetDownloadURL
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'downloadURL()' which is not a method.
Using 'getUrl()' which does not exist.
5fill in blank
hard

Fill all three blanks to delete a file from Firebase Storage and handle errors.

Flutter
try {
  await storageRef.child('uploads/file.txt').[1]();
} catch (e) {
  print('Error: ' + e.[2]);
} finally {
  print('File [3] deleted');
}
Drag options to blanks, or click blank then click option'
Adelete
Bmessage
Csuccessfully
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove()' instead of 'delete()'.
Accessing error with 'toString()' instead of 'message'.
Missing the word 'successfully' in the print statement.