chore: address use of then method on awaited future

This commit is contained in:
Garrett Watson 2023-11-13 12:39:30 -05:00
parent 96d95f528d
commit 595ddf8035

View file

@ -243,9 +243,9 @@ class _InventoryBrowserAppBarState extends State<InventoryBrowserAppBar> {
filename: filename,
updates: Updates.statusAndProgress,
);
await FileDownloader().enqueue(downloadTask).then((b) {
final downloadStatus = await FileDownloader().enqueue(downloadTask);
if (context.mounted) {
if (b) {
if (downloadStatus) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Downloaded ${record.formattedName.toString()}"),
@ -259,7 +259,6 @@ class _InventoryBrowserAppBarState extends State<InventoryBrowserAppBar> {
);
}
}
});
final tempDirectory = await _tempDirectoryFuture;
final file = File(
"${tempDirectory.path}/${record.id.split("-")[1]}-${record.formattedName.toString()}${extension(uri)}");