mirror of
https://github.com/foss42/apidash.git
synced 2025-06-22 07:24:39 +08:00
file extension param support for downloader
This commit is contained in:
@ -104,12 +104,14 @@ class SaveInDownloadsButton extends StatefulWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
this.content,
|
this.content,
|
||||||
this.mimeType,
|
this.mimeType,
|
||||||
|
this.ext,
|
||||||
this.name,
|
this.name,
|
||||||
this.showLabel = true,
|
this.showLabel = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Uint8List? content;
|
final Uint8List? content;
|
||||||
final String? mimeType;
|
final String? mimeType;
|
||||||
|
final String? ext;
|
||||||
final String? name;
|
final String? name;
|
||||||
final bool showLabel;
|
final bool showLabel;
|
||||||
|
|
||||||
@ -129,10 +131,9 @@ class _SaveInDownloadsButtonState extends State<SaveInDownloadsButton> {
|
|||||||
onPressed: (widget.content != null)
|
onPressed: (widget.content != null)
|
||||||
? () async {
|
? () async {
|
||||||
var message = "";
|
var message = "";
|
||||||
var ext = getFileExtension(widget.mimeType);
|
|
||||||
var path = await getFileDownloadpath(
|
var path = await getFileDownloadpath(
|
||||||
widget.name,
|
widget.name,
|
||||||
ext,
|
widget.ext ?? getFileExtension(widget.mimeType),
|
||||||
);
|
);
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user