forked from KritishPokharel/PKL_Landslide_App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpast_nep_data.dart
47 lines (43 loc) · 1.61 KB
/
past_nep_data.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Note: The website https://landslidespaceapp.neplinews.com/ is our own wesbite whose source code could be found in the visualization/LandslideCatalogue folder in our github repo.
//The website contains the map we developed to represent past data of landslide and is connected natively in the app.
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:webview_flutter/webview_flutter.dart';
class PastNepalData extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
const String flutterUrl = "https://landslidespaceapp.neplinews.com/";
class _MyAppState extends State<PastNepalData> {
late WebViewController _controller;
// ignore: unused_element
_loadPage() async {
var url = await _controller.currentUrl();
_controller.loadUrl(
url ="https://landslidespaceapp.neplinews.com/",
);
print(url);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppBar(
leading: IconButton(
icon: Icon(FontAwesomeIcons.arrowLeft,color: Colors.black,),
onPressed: () => Navigator.pop(context)),
title: Text("Past Landslide Data of Nepal",style: TextStyle(color: Colors.black),),
backgroundColor: Colors.white70,
),
body: SafeArea(
child: WebView(
key: Key("webview"),
initialUrl: flutterUrl,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller = webViewController;
},
),
),
);
}
}