Skip to content

Commit

Permalink
Re-enabled dark mode for HTML document views
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Nov 15, 2022
1 parent 6e5d76d commit c494fac
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ class WebViewRouteState extends State<WebViewRoute> {
loadingURL = kLoadingDarkHTMLFilePath;
}

// var url = widget.initialURL;
// if (darkMode) {
// url = _darkURLForURL(url);
// }
var url = widget.initialURL;
if (darkMode) {
url = _darkURLForURL(url);
}

InAppWebView webView = InAppWebView(
initialFile: loadingURL,
// TODO: Fix this
//initialUrlRequest: URLRequest(url: Uri.parse(url)),
initialUrlRequest: URLRequest(url: Uri.parse(url)),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: true,
Expand All @@ -111,7 +110,7 @@ class WebViewRouteState extends State<WebViewRoute> {
setState(() {
String url = widget.initialURL;
if (darkMode) {
_darkURLForURL(url);
url = _darkURLForURL(url);
}
Uri uri = Uri.parse(url);
controller.loadUrl(urlRequest: URLRequest(url: uri));
Expand Down

0 comments on commit c494fac

Please sign in to comment.