import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:trans_lark/page/web_page/web_page_controller.dart';
import 'package:trans_lark/widget/base_appbar.dart';
import 'package:trans_lark/widget/view_state_widget.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WebPageView extends StatelessWidget {
  WebPageView({super.key});

  final controller = Get.find<WebPageController>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: BaseAppBar(
        title: controller.title,
      ),
      body: Obx(() {
        return ViewStateWidget(
          viewState: controller.viewState.value,
          child: WebViewWidget(controller: controller.webViewController),
        );
      }),
    );
  }
}
