import 'package:flutter/material.dart';
import 'package:flutter_translate/common/components/base_appbar.dart';
import 'package:flutter_translate/common/components/view_state.dart';
import 'package:flutter_translate/pages/web/web_controller.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WebView extends GetView<WebController> {
  const WebView({super.key});

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