https://api.flutter.dev/flutter/dart-io/File/writeAsString.html
writeAsString method
Future<File> writeAsString (
String contents,
{FileMode mode: FileMode.write,
Encoding encoding: utf8,
bool flush: false}
)
Write a string to a file.
Opens the file, writes the string in the given encoding, and closes the file. Returns a Future<File> that completes with this File object once the entire operation has completed.
By default writeAsString creates the file for writing and truncates the file if it already exists. In order to append the bytes to an existing file, pass FileMode.append as the optional mode parameter.
If the argument flush is set to true, the data written will be flushed to the file system before the returned future completes.
上記ページを見ていて気になったんですが、最後の文章のflushはどういう意味なんでしょうか。
結局引数flushをtrueにセットしたら具体的にどうなるのかよくわかりません。
回答2件
あなたの回答
tips
プレビュー