Download file from download button, save to download folder on the local system

509 views Asked by At
I am working in flutter web automation as fresher. 

I download the file from Download button present on the web. And downlaoded file by default download in PDF format. I just need to verify the download file name. Can anyone help me.

class DownloadButton extends StatelessWidget {
  final VoidCallback callback;
  const DownloadButton(this.callback,{Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return OutlinedButton(onPressed: ()=>callback(), child: Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        Row(
          children: [
            Text(Strings.global_download),
            SizedBox(width: 6,),
            Icon(Icons.download)
          ],
        )
      ],
    ));
  }
}
1

There are 1 answers

2
Jan-Stepien On

The file is not accessable at this level- provide usage of DownloadButton(...) You can access the file in parent widget ( where callback is defined)