You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7 KiB

3 years ago
import 'dart:io';
import 'dart:ui';
3 years ago
import 'package:flutter/material.dart';
3 years ago
import 'package:flutter/rendering.dart';
3 years ago
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:webview_flutter/webview_flutter.dart';
3 years ago
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();
3 years ago
3 years ago
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
}
3 years ago
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
action: Container(
margin: EdgeInsets.only(right: 10),
child: GestureDetector(
onTap: () {
3 years ago
// share();
3 years ago
},
child: Icon(
Icons.share,
size: 24,
color: Colors.black,
),
),
),
3 years ago
title: "",
3 years ago
background: Color(0xFFFFFFFFF),
leadingColor: Colors.black,
),
body: Container(
3 years ago
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
3 years ago
alignment: Alignment.center,
child:
WebView(
initialUrl: "http://192.168.10.90:5500/lottery.html",
javascriptMode: JavascriptMode.unrestricted,
)),
3 years ago
);
}
3 years ago
}