Skip to content

Commit

Permalink
add completion toast on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder committed Nov 26, 2021
1 parent 6e0c58c commit c191719
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ class _HomePageState extends State<HomePage>
Platform.isMacOS) {
launch(_filePath);
} else {
_toast.showMobileToast(
"Files saved in Downloads.");
await OpenFile.open(_filePath);
}
}
Expand Down
10 changes: 10 additions & 0 deletions lib/services/toast_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ class ToastService {
toastDuration: const Duration(seconds: 2),
);
}

void showMobileToast(String text) {
Fluttertoast.showToast(
msg: text,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
textColor: Colors.white,
fontSize: 16.0);
}
}

0 comments on commit c191719

Please sign in to comment.