forked from CarGuo/gsy_github_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSYWebView.dart
More file actions
41 lines (37 loc) · 985 Bytes
/
GSYWebView.dart
File metadata and controls
41 lines (37 loc) · 985 Bytes
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
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:gsy_github_app_flutter/widget/GSYCommonOptionWidget.dart';
/**
* webview版本
* Created by guoshuyu
* on 2018/7/27.
*/
class GSYWebView extends StatelessWidget {
final String url;
final String title;
final OptionControl optionControl = new OptionControl();
GSYWebView(this.url, this.title);
_renderTitle() {
if (url == null || url.length == 0) {
return new Text(title);
}
optionControl.url = url;
return new Row(children: [
new Expanded(child: new Container()),
GSYCommonOptionWidget(optionControl),
]);
}
@override
Widget build(BuildContext context) {
return new WebviewScaffold(
withJavascript: true,
url: url,
scrollBar:true,
withLocalUrl: true,
appBar: new AppBar(
title: _renderTitle(),
),
);
}
}