convert mih web app from JS to WASm
This commit is contained in:
parent
eb213b01b6
commit
f9c71b656e
17 changed files with 78 additions and 127 deletions
|
|
@ -16,7 +16,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:http/http.dart' as http2;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
import 'package:mzansi_innovation_hub/mih_helpers/mih_utils_stub.dart'
|
||||
if (dart.library.js_interop) 'package:mzansi_innovation_hub/mih_helpers/mih_utils_web.dart';
|
||||
|
||||
class BuildClaimStatementFileList extends StatefulWidget {
|
||||
const BuildClaimStatementFileList({
|
||||
|
|
@ -110,7 +111,7 @@ class _BuildClaimStatementFileListState
|
|||
backgroundColor: MihColors.green(),
|
||||
onTap: () {
|
||||
if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
html.window.open(url, 'download');
|
||||
openWebWindow(url, 'download');
|
||||
} else {
|
||||
nativeFileDownload(url);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import 'package:flutter/material.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:supertokens_flutter/http.dart' as http;
|
||||
import 'package:http/http.dart' as http2;
|
||||
import "package:universal_html/html.dart" as html;
|
||||
import 'package:mzansi_innovation_hub/mih_helpers/mih_utils_stub.dart'
|
||||
if (dart.library.js_interop) 'package:mzansi_innovation_hub/mih_helpers/mih_utils_web.dart';
|
||||
|
||||
class BuildFilesList extends StatefulWidget {
|
||||
const BuildFilesList({
|
||||
|
|
@ -103,7 +104,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
|
|||
backgroundColor: MihColors.green(),
|
||||
onTap: () {
|
||||
if (MzansiInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
html.window.open(url, 'download');
|
||||
openWebWindow(url, 'download');
|
||||
} else {
|
||||
nativeFileDownload(url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue