Browse Source

上传一下代码

tags/0.0.3+3
2846432477@qq.com 4 years ago
parent
commit
1ae0cc7a6b
2 changed files with 15 additions and 6 deletions
  1. +1
    -1
      .dart_tool/package_config.json
  2. +14
    -5
      lib/pages/webview/base_webview.dart

+ 1
- 1
.dart_tool/package_config.json View File

@@ -686,7 +686,7 @@
"languageVersion": "2.8"
}
],
"generated": "2020-12-28T11:23:12.646985Z",
"generated": "2021-01-04T03:01:23.058958Z",
"generator": "pub",
"generatorVersion": "2.8.2"
}

+ 14
- 5
lib/pages/webview/base_webview.dart View File

@@ -7,6 +7,8 @@ import 'package:zhiying_comm/util/log/let_log.dart';
import 'package:zhiying_comm/util/empty_util.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:zhiying_comm/util/shared_prefe_util.dart';
import 'package:zhiying_comm/util/global_config.dart';

class BaseWebview extends StatefulWidget {
final Map<String, dynamic> model;
@@ -21,13 +23,23 @@ class _BaseWebviewState extends State<BaseWebview> {
String _url;
String _title;
WebViewController _webViewController;
bool _isiOSReview = false;

@override
void initState() {
_url = widget.model['url'] ?? '';
_settingIosReview();
super.initState();
}

void _settingIosReview() async {
String is_ios_review = await SharedPreferencesUtil.getStringValue(GlobalConfig.IS_IOS_REVIEW, defaultVal: '0');
setState(() {
if (is_ios_review == '1') {
_isiOSReview = true;
print(_isiOSReview);
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -103,10 +115,7 @@ class _BaseWebviewState extends State<BaseWebview> {
),
),
trailing: GestureDetector(
child: Icon(
Icons.refresh,
size: 20,
),
child: _isiOSReview ? Container() : Icon(Icons.refresh, size: 20,),
onTap: () {
_webViewController.reload();
},


Loading…
Cancel
Save