协议同意
This commit is contained in:
26
ln_jq_app/lib/pages/common/webview/controller.dart
Normal file
26
ln_jq_app/lib/pages/common/webview/controller.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class WebController extends GetxController {
|
||||
late String title;
|
||||
late String url;
|
||||
|
||||
final RxDouble progress = 0.0.obs;
|
||||
InAppWebViewController? webViewController;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
// 从参数中获取标题和URL
|
||||
title = Get.arguments['title'] ?? '详情';
|
||||
url = Get.arguments['url'] ?? '';
|
||||
}
|
||||
|
||||
void onWebViewCreated(InAppWebViewController controller) {
|
||||
webViewController = controller;
|
||||
}
|
||||
|
||||
void onProgressChanged(InAppWebViewController controller, int progressValue) {
|
||||
progress.value = progressValue / 100;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user