Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-010
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-010
2021-010
Commits
f30ed14e
Commit
f30ed14e
authored
Oct 16, 2021
by
Lakshan Wijewardana W.M.W-IT18132588
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flutter web view update
parent
e0eb6f45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
38 deletions
+114
-38
Front_End/Rp_organic/android/app/src/main/AndroidManifest.xml
...t_End/Rp_organic/android/app/src/main/AndroidManifest.xml
+15
-0
Front_End/Rp_organic/android/app/src/main/res/xml/provider_paths.xml
...p_organic/android/app/src/main/res/xml/provider_paths.xml
+6
-0
Front_End/Rp_organic/lib/main.dart
Front_End/Rp_organic/lib/main.dart
+46
-37
Front_End/Rp_organic/pubspec.lock
Front_End/Rp_organic/pubspec.lock
+36
-1
Front_End/Rp_organic/pubspec.yaml
Front_End/Rp_organic/pubspec.yaml
+11
-0
No files found.
Front_End/Rp_organic/android/app/src/main/AndroidManifest.xml
View file @
f30ed14e
...
...
@@ -43,5 +43,20 @@
<meta-data
android:name=
"flutterEmbedding"
android:value=
"2"
/>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"com.example.Rp_organic.fileprovider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/provider_paths"
/>
</provider>
</application>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
</manifest>
Front_End/Rp_organic/android/app/src/main/res/xml/provider_paths.xml
0 → 100644
View file @
f30ed14e
<?xml version="1.0" encoding="utf-8"?>
<paths
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<external-path
name=
"external_files"
path=
"."
/>
</paths>
\ No newline at end of file
Front_End/Rp_organic/lib/main.dart
View file @
f30ed14e
import
'package:flutter/material.dart'
;
import
'package:flutter_webview_pro/webview_flutter.dart'
;
import
'package:modal_progress_hud/modal_progress_hud.dart'
;
void
main
(
)
=>
runApp
(
MyApp
());
class
MyApp
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
class
MyApp
extends
StatefulWidget
{
@override
_WebViewWebPageState
createState
()
=>
_WebViewWebPageState
();
}
class
_WebViewWebPageState
extends
State
<
MyApp
>
{
WebViewController
controller
;
bool
showSpinner
=
true
;
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Welcome to Flutter'
,
home:
Scaffold
(
appBar:
AppBar
(
toolbarHeight:
70
,
backgroundColor:
Colors
.
teal
[
800
],
title:
Container
(
child:
Image
.
asset
(
'assets/images/orgicheck lolgo2.png'
,
width:
300
,
height:
100
),
home:
WillPopScope
(
onWillPop:
()
async
{
String
url
=
await
controller
.
currentUrl
();
if
(
url
==
"https://test-flask-research.herokuapp.com/"
){
return
true
;
}
else
{
controller
.
goBack
();
return
false
;
}
},
child:
Scaffold
(
body:
ModalProgressHUD
(
inAsyncCall:
showSpinner
,
child:
Container
(
child:
SafeArea
(
child:
WebView
(
initialUrl:
"https://test-flask-research.herokuapp.com/"
,
javascriptMode:
JavascriptMode
.
unrestricted
,
gestureNavigationEnabled:
true
,
geolocationEnabled:
false
,
//support geolocation or not
onWebViewCreated:
(
WebViewController
wc
){
controller
=
wc
;
},
onPageFinished:
(
finished
){
setState
(()
{
showSpinner
=
false
;
});
},
),
),
),
),
centerTitle:
true
,
),
body:
Builder
(
builder:
(
BuildContext
context
)
{
return
WebView
(
initialUrl:
'https://test-flask-research.herokuapp.com/'
,
javascriptMode:
JavascriptMode
.
unrestricted
,
onProgress:
(
int
progress
)
{
print
(
"WebView is loading (progress :
$progress
%)"
);
},
navigationDelegate:
(
NavigationRequest
request
)
{
if
(
request
.
url
.
startsWith
(
'https://test-flask-research.herokuapp.com/'
))
{
print
(
'blocking navigation to
$request
}'
);
return
NavigationDecision
.
prevent
;
}
print
(
'allowing navigation to
$request
'
);
return
NavigationDecision
.
navigate
;
},
onPageStarted:
(
String
url
)
{
print
(
'Page started loading:
$url
'
);
},
onPageFinished:
(
String
url
)
{
print
(
'Page finished loading:
$url
'
);
},
gestureNavigationEnabled:
true
,
geolocationEnabled:
false
,
//support geolocation or not
);
}),
),
);
}
}
\ No newline at end of file
}
Front_End/Rp_organic/pubspec.lock
View file @
f30ed14e
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
...
...
@@ -49,7 +56,14 @@ packages:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.0.3"
equatable:
dependency: transitive
description:
name: equatable
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.6"
fake_async:
dependency: transitive
description:
...
...
@@ -62,6 +76,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_application_id:
dependency: "direct dev"
description:
name: flutter_application_id
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
...
...
@@ -88,6 +109,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
modal_progress_hud:
dependency: "direct main"
description:
name: modal_progress_hud
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
path:
dependency: transitive
description:
...
...
@@ -163,6 +191,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.22.0"
Front_End/Rp_organic/pubspec.yaml
View file @
f30ed14e
...
...
@@ -30,14 +30,25 @@ dependencies:
cupertino_icons
:
^1.0.0
webview_flutter
:
^1.0.0
flutter_webview_pro
:
^1.0.0
modal_progress_hud
:
^0.1.3
dev_dependencies
:
flutter_application_id
:
"
^1.0.0"
flutter_test
:
sdk
:
flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_application_id
:
android
:
id
:
"
com.example.Rp_organic"
name
:
"
Rp_organic"
ios
:
id
:
"
com.example.Rp_organic"
name
:
"
Rp_organic"
# The following section is specific to Flutter.
flutter
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment