【Flutter】Windowsのディレクトリの取得、ドキュメント、ダウンロードフォルダ

アプリと一緒なんですが、たまたまWindowsで試したので。。

Pathの取得方法

import 'package:path_provider/path_provider.dart';
var directory = await getApplicationDocumentsDirectory();
debugPrint(directory.path);

Pathの取得結果

ドキュメントフォルダ - getApplicationDocumentsDirectory()

C:\Users\417\Documents

ダウンロードフォルダ - getDownloadsDirectory()

C:\Users\417\Downloads

仮置きフォルダ - getTemporaryDirectory()

C:\Users\417~1\AppData\Local\Temp

アプリ用のフォルダ - getApplicationSupportDirectory()

SharedPreferencesもここに置かれていました。

C:\Users\417\AppData\Roaming\company_name\app_name

Flutter開発で知らないと損すること Flutter開発で知らないと損すること

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です