Skip to content

Commit

Permalink
fixed the otp view issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinPramodya committed Nov 22, 2020
1 parent ce214f5 commit 0612660
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
27 changes: 19 additions & 8 deletions lib/page/screen/qr_webview_screen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import 'package:flutter/material.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
import 'package:selftrackingapp/main.dart';
import 'package:selftrackingapp/page/screen/privacy_policy_screen.dart';
import 'package:selftrackingapp/page/screen/root_screen.dart';
import 'package:selftrackingapp/page/screen/welcome_screen.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';

import '../../app_localizations.dart';
import 'qr_scan_screen.dart';

class QrWebviewScreen extends StatefulWidget {
final String url;
Expand All @@ -26,6 +31,12 @@ class _QrWebviewScreenState extends State<QrWebviewScreen> {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => HomeScreen()));
}),
iconTheme: IconThemeData(color: Colors.black),
title: Text(
AppLocalizations.of(context).translate("qr_title"),
Expand All @@ -34,14 +45,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;
},
// 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
1 change: 1 addition & 0 deletions lib/page/screen/root_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class _RootScreenState extends State<RootScreen> {
fontSize: 20.0,
),
),
automaticallyImplyLeading: false,
),
body: MultiProvider(
providers: [
Expand Down
2 changes: 1 addition & 1 deletion lib/page/screen/welcome_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
BorderRadius.all(Radius.circular(20.0))),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushReplacement(
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RootScreen()));
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.17.1+38
version: 1.17.2+39

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

0 comments on commit 0612660

Please sign in to comment.