w-R
3 years ago
6 changed files with 65 additions and 12 deletions
@ -0,0 +1,49 @@
|
||||
import 'dart:io'; |
||||
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:webview_flutter/webview_flutter.dart'; |
||||
import 'package:webview_flutter/src/webview_cupertino.dart'; |
||||
|
||||
class UserServicePage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _UserServicePage(); |
||||
} |
||||
} |
||||
|
||||
class _UserServicePage extends State<UserServicePage> with WidgetsBindingObserver { |
||||
var controller = new ScrollController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
WidgetsBinding.instance.addObserver(this); |
||||
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); |
||||
if (Platform.isIOS) WebView.platform = CupertinoWebView(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
appBar: MyAppBar( |
||||
title:"用户协议", |
||||
titleColor: Colors.black, |
||||
background: Color(0xFFFFFFFF), |
||||
leadingColor: Colors.black, |
||||
), |
||||
body: Container( |
||||
width: MediaQuery.of(context).size.width, |
||||
height: MediaQuery.of(context).size.height, |
||||
alignment: Alignment.center, |
||||
child: |
||||
WebView( |
||||
initialUrl: "http://huixiang.lotus-wallet.com/user.html", |
||||
javascriptMode: JavascriptMode.unrestricted, |
||||
)), |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue