Last active
September 18, 2021 16:02
-
-
Save shiburagi/bc4de0d26ed7b381ed0ad46e87eb74a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget build(BuildContext context) { | |
String loadUrl = | |
"https://www.thevocket.com/rakaman-mak-cik-ini-terpaksa-langgar-axia-untuk-keluar-parkir-curi-tumpuan-ramai/"; | |
return Scaffold( | |
appBar: AppBar( | |
// Here we take the value from the MyHomePage object that was created by | |
// the App.build method, and use it to set our appbar title. | |
title: Text(widget.title), | |
), | |
body: WebView( | |
initialUrl: loadUrl, | |
javascriptMode: JavascriptMode.unrestricted, | |
onProgress: (progress) { | |
print(progress); | |
}, | |
onWebViewCreated: (controller) { | |
print("created"); | |
}, | |
navigationDelegate: (navigation) { | |
if (navigation.url.contains(loadUrl)) | |
return NavigationDecision.navigate; | |
else { | |
String url = navigation.url; | |
print(url); | |
return NavigationDecision.prevent; | |
} | |
}, | |
onPageFinished: (url) {}, | |
onWebResourceError: (error) { | |
print(error); | |
}, | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment