convert mih web app from JS to WASm

This commit is contained in:
yaso 2026-07-09 12:02:58 +02:00
parent eb213b01b6
commit f9c71b656e
17 changed files with 78 additions and 127 deletions

View file

@ -58,10 +58,13 @@ class _MihSignInState extends State<MihSignIn> {
void submitSignInForm() async {
await signUserIn();
if (successfulSignIn) {
TextInput.finishAutofillContext();
context.goNamed(
'mihHome',
extra: true,
);
} else {
TextInput.finishAutofillContext(shouldSave: false);
}
}

View file

@ -7,7 +7,8 @@ import 'package:mzansi_innovation_hub/mih_providers/mih_file_viewer_provider.dar
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_core/theme.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
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';
import 'package:fl_downloader/fl_downloader.dart';
class MihExpandedFileView extends StatefulWidget {
@ -227,7 +228,7 @@ class _MihExpandedFileViewState extends State<MihExpandedFileView> {
padding: const EdgeInsets.all(0),
onPressed: () {
if (kIsWeb) {
html.window.open(
openWebWindow(
fileViewerProvider.fileLink, 'download');
} else {
nativeFileDownload(

View file

@ -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);
}

View file

@ -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);
}