0
0
Fluttermobile~10 mins

Secure storage for credentials 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 Flutter secure storage package.

Flutter
import '[1]';
Drag options to blanks, or click blank then click option'
Apackage:flutter/material.dart
Bpackage:flutter_secure_storage/flutter_secure_storage.dart
Cpackage:flutter/widgets.dart
Dpackage:flutter_secure_storage/flutter_secure_storage.dartx
Attempts:
3 left
💡 Hint
Common Mistakes
Importing material.dart instead of flutter_secure_storage.
Adding extra characters at the end of the import path.
2fill in blank
medium

Complete the code to create an instance of FlutterSecureStorage.

Flutter
final storage = [1]();
Drag options to blanks, or click blank then click option'
AFlutterStorage
BSecureStorage
CSecureFlutterStorage
DFlutterSecureStorage
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names like SecureStorage or FlutterStorage.
3fill in blank
hard

Fix 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'
A'12345'
B12345
Ctoken
Dtoken123
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a number without quotes causes an error.
Passing a variable name instead of a string literal.
4fill in blank
hard

Fill 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'
Aread
B'token'
C'password'
Dwrite
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' instead of 'read' to get a value.
Using wrong key names.
5fill in blank
hard

Fill 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'
Adelete
B'password'
Ctoken
D'token'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' or 'read' instead of 'delete'.
Using wrong key strings or missing quotes.