Added initState() to downloader_menu.dart to fetch prefWorkingDirectory

This commit is contained in:
Ben Hall 2021-11-01 20:48:54 +00:00
parent 5836d15654
commit dd9975c435
1 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,18 @@ class DownloaderMenu extends StatefulWidget {
}
class _DownloaderMenuState extends State<DownloaderMenu> with PreferencesMixin {
@override
void initState() {
super.initState();
getPreference(prefWorkingDirectory).then((pref) {
if (pref is String) {
setState(() {
Directory.current = pref;
});
}
});
}
@override
Widget build(BuildContext context) {
return Expanded(