add url launcher to open links

This commit is contained in:
2024-12-09 15:10:12 +02:00
parent 1754d6a588
commit 2bfdc67fae
3 changed files with 53 additions and 28 deletions

View File

@@ -103,10 +103,13 @@ class _BuildFileViewState extends State<BuildFileView> {
iconSize: 35,
padding: const EdgeInsets.all(0),
onPressed: () {
html.window.open(
widget.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
if (MzanziInnovationHub.of(context)!.theme.getPlatform() ==
"Web") {
html.window.open(
widget.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
} else {}
},
icon: Icon(
Icons.download,
@@ -164,10 +167,17 @@ class _BuildFileViewState extends State<BuildFileView> {
iconSize: 35,
padding: const EdgeInsets.all(0),
onPressed: () {
html.window.open(
widget.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
if (MzanziInnovationHub.of(context)!.theme.getPlatform() ==
"Web") {
html.window.open(
widget.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
} else {}
// html.window.open(
// widget.link,
// // '${AppEnviroment.baseFileUrl}/mih/$filePath',
// 'download');
},
icon: Icon(
Icons.download,

View File

@@ -210,10 +210,12 @@ class _FullScreenFileViewerState extends State<FullScreenFileViewer> {
iconSize: 30,
padding: const EdgeInsets.all(0),
onPressed: () {
html.window.open(
widget.arguments.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
html.window.open(
widget.arguments.link,
// '${AppEnviroment.baseFileUrl}/mih/$filePath',
'download');
} else {}
},
icon: Icon(
Icons.download,