Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Flutter secure storage package.
Flutter
import '[1]';
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing material.dart instead of flutter_secure_storage.
Adding extra characters at the end of the import path.
✗ Incorrect
The correct import for Flutter secure storage is package:flutter_secure_storage/flutter_secure_storage.dart.
2fill in blank
mediumComplete the code to create an instance of FlutterSecureStorage.
Flutter
final storage = [1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names like SecureStorage or FlutterStorage.
✗ Incorrect
The class to create a secure storage instance is FlutterSecureStorage.
3fill in blank
hardFix the error in the code to write a value securely.
Flutter
await storage.write(key: 'token', value: [1]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a number without quotes causes an error.
Passing a variable name instead of a string literal.
✗ Incorrect
The value must be a string, so it should be enclosed in quotes like '12345'.
4fill in blank
hardFill both blanks to read a stored value asynchronously.
Flutter
String? token = await storage.[1](key: [2]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' instead of 'read' to get a value.
Using wrong key names.
✗ Incorrect
Use read method with the key 'token' to get the stored value.
5fill in blank
hardFill all three blanks to delete a stored credential securely.
Flutter
await storage.[1](key: [2]); // Delete the [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' or 'read' instead of 'delete'.
Using wrong key strings or missing quotes.
✗ Incorrect
Use delete method with the key 'token' to remove the stored token.