Skip to content

Commit

Permalink
web view issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinPramodya committed Nov 9, 2020
1 parent 1f2b230 commit a4b45fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/page/screen/qr_scan_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class _QrScanScreenState extends State<QrScanScreen> {
_handleURLButtonPress(context, qrText);
}
});
// controller.resumeCamera();
});
}
}
9 changes: 9 additions & 0 deletions lib/page/screen/qr_webview_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';

import '../../app_localizations.dart';
Expand Down Expand Up @@ -33,6 +34,14 @@ class _QrWebviewScreenState extends State<QrWebviewScreen> {
),
body: WebView(
initialUrl: widget.url,
navigationDelegate: (NavigationRequest request) async {
if (await canLaunch(request.url)) {
await launch(request.url);
} else {
print("Cannot launch url");
}
return NavigationDecision.prevent;
},
javascriptMode: JavascriptMode.unrestricted,
));

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Self tracking app
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.16.0+35
version: 1.16.0+36

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down

0 comments on commit a4b45fb

Please sign in to comment.