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;
  }
}
