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.
 
 
 
 
 
 

58 lines
1.6 KiB

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:webview_flutter/webview_flutter.dart';
class ScanWeb extends StatefulWidget {
final Map<String, dynamic> arguments;
ScanWeb({this.arguments});
@override
State<StatefulWidget> createState() {
return _ScanWeb();
}
}
class _ScanWeb extends State<ScanWeb> {
var controller = new ScrollController();
WebViewController webViewController;
String result;
String title;
@override
void initState() {
super.initState();
result = widget.arguments["result"];
title = widget.arguments["title"];
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title:title ?? "",
titleColor: Colors.black,
background: Colors.transparent,
leadingColor: Colors.black,
),
body:
WebView(
initialUrl:result,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController controller){
webViewController =controller;
},
onProgress: (int progress) async {
if(widget.arguments["title"] != null)
return;
title = await webViewController?.getTitle();
setState((){});
EasyLoading.dismiss();
},
),
);
}
}