Browse Source

跳转更改

ff_new
w-R 3 years ago
parent
commit
933b0c3e60
  1. 40
      lib/web/web_turntable_activity.dart

40
lib/web/web_turntable_activity.dart

@ -1,8 +1,34 @@
import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter/cupertino.dart';
class WebTurntableActivity extends StatefulWidget {
final Map<String, dynamic> arguments;
///
WebTurntableActivity({this.arguments});
@override
State<StatefulWidget> createState() {
return _WebTurntableActivity();
}
}
class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBindingObserver {
final ScrollController scrollController = ScrollController();
class WebTurntableActivity extends StatelessWidget { @override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,10 +54,12 @@ class WebTurntableActivity extends StatelessWidget {
body: Container( body: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: alignment: Alignment.center,
WebView( child:
initialUrl: "http://192.168.10.90:5500/lottery.html", WebView(
)), initialUrl: "http://192.168.10.90:5500/lottery.html",
javascriptMode: JavascriptMode.unrestricted,
)),
); );
} }
} }

Loading…
Cancel
Save