Skip to content

Commit

Permalink
Correct email preview on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jul 28, 2021
1 parent 149cdb5 commit b3c055f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/ui/app/app_webview.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/utils/web_stub.dart'
Expand Down Expand Up @@ -52,8 +54,9 @@ class _MobileWebViewState extends State<_MobileWebView>
super.didUpdateWidget(oldWidget);

if (widget.html != oldWidget.html) {
_webViewController.loadUrl(
Uri.dataFromString(widget.html, mimeType: 'text/html').toString());
_webViewController.loadUrl(Uri.dataFromString(widget.html,
mimeType: 'text/html', encoding: Encoding.getByName('utf-8'))
.toString());
}
}

Expand All @@ -62,8 +65,9 @@ class _MobileWebViewState extends State<_MobileWebView>
super.build(context);

return WebView(
initialUrl:
Uri.dataFromString(widget.html, mimeType: 'text/html').toString(),
initialUrl: Uri.dataFromString(widget.html,
mimeType: 'text/html', encoding: Encoding.getByName('utf-8'))
.toString(),
onWebViewCreated: (WebViewController webViewController) {
_webViewController = webViewController;
},
Expand Down

0 comments on commit b3c055f

Please sign in to comment.