-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathlink_web_view.dart
46 lines (39 loc) · 1.18 KB
/
link_web_view.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
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:webview_flutter/webview_flutter.dart';
// Project imports:
import 'package:notredame/features/app/widgets/base_scaffold.dart';
import 'package:notredame/features/ets/quick-link/models/quick_link.dart';
class LinkWebView extends StatefulWidget {
final QuickLink _links;
const LinkWebView(this._links);
@override
_LinkWebViewState createState() => _LinkWebViewState();
}
class _LinkWebViewState extends State<LinkWebView> {
bool isLoading = true;
@override
Widget build(BuildContext context) {
return BaseScaffold(
isLoading: isLoading,
showBottomBar: false,
appBar: AppBar(
title: Text(widget._links.name),
),
body: Stack(
children: <Widget>[
WebViewWidget(
controller: WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(onPageFinished: (String url) {
setState(() {
isLoading = false;
});
}))),
],
),
);
}
}