import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tone_snap/components/base_appbar.dart';
import 'package:tone_snap/components/view_state_widget.dart';
import 'package:tone_snap/modules/web_page/web_page_controller.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(controller.title),
      body: Obx(() {
        return ViewStateWidget(
          viewState: controller.viewState.value,
          cpiBgColor: Colors.white,
          child: WebViewWidget(controller: controller.webViewController),
        );
      }),
    );
  }
}
