Complete the code to import the Flutter package needed for file storage.
import '[1]';
The dart:io package provides file storage capabilities in Flutter.
Complete the code to get the path to the app's documents directory using path_provider.
final directory = await get[1]Directory();getApplicationDocumentsDirectory() returns the directory for user documents, suitable for file storage.
Fix the error in the code to write a string to a file.
final file = File(path); await file.[1]('Hello Flutter');
To write text to a file, use writeAsString. Other options are for reading.
Fill both blanks to read the content of a file as a string.
final file = File([1]); String content = await file.[2]();
You need the file path as a string and then call readAsString() to get the file content.
Fill all three blanks to create a file, write text, and then read it back.
final file = File([1]); await file.[2]('Flutter Rocks'); String text = await file.[3]();
Use a file path string like 'data.txt', then writeAsString to save text, and readAsString to read it back.