documentDirectory property
Obtains the document path where the file can be placed by determining the platform.
Use getLibraryDirectory
for iOS
and getApplicationDocumentsDirectory
for others.
Web
returns Null.
ファイルを置けるドキュメントパスをプラットフォームを判別して取得します。
iOS
はgetLibraryDirectory
、その他はgetApplicationDocumentsDirectory
を利用します。
Web
はNullを返します。
Implementation
static Future<String?> get documentDirectory async {
if (Platform.isIOS) {
return (await getLibraryDirectory()).path;
} else {
return (await getApplicationDocumentsDirectory()).path;
}
}