|
|
@ -1,9 +1,12 @@ |
|
|
|
import 'dart:io'; |
|
|
|
import 'dart:io'; |
|
|
|
import 'dart:ui'; |
|
|
|
import 'dart:ui'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import 'package:webview_flutter/webview_flutter.dart'; |
|
|
|
import 'package:webview_flutter/webview_flutter.dart'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
|
|
|
|
|
|
@ -21,11 +24,16 @@ class WebTurntableActivity extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
|
|
class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBindingObserver { |
|
|
|
class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBindingObserver { |
|
|
|
final ScrollController scrollController = ScrollController(); |
|
|
|
final ScrollController scrollController = ScrollController(); |
|
|
|
|
|
|
|
String token; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SharedPreferences.getInstance().then((value) => { |
|
|
|
|
|
|
|
token = value.getString('token'), |
|
|
|
|
|
|
|
}); |
|
|
|
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); |
|
|
|
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -57,7 +65,7 @@ class _WebTurntableActivity extends State<WebTurntableActivity> with WidgetsBind |
|
|
|
alignment: Alignment.center, |
|
|
|
alignment: Alignment.center, |
|
|
|
child: |
|
|
|
child: |
|
|
|
WebView( |
|
|
|
WebView( |
|
|
|
initialUrl: "http://192.168.10.90:5500/lottery.html", |
|
|
|
initialUrl: "http://192.168.10.90:5500/lottery.html?token=${token}", |
|
|
|
javascriptMode: JavascriptMode.unrestricted, |
|
|
|
javascriptMode: JavascriptMode.unrestricted, |
|
|
|
)), |
|
|
|
)), |
|
|
|
); |
|
|
|
); |
|
|
|