import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:wallpaperx/common/components/navigation_bar/custom_appbar.dart';
import 'package:wallpaperx/common/components/view_state_widget.dart';
import 'package:webview_flutter/webview_flutter.dart';

import 'web_view_controller.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: CustomAppbar(
        controller.title,
        backgroundColor: Colors.black,
        titleStyle: TextStyle(
          color: Colors.white,
          fontSize: 24.sp,
          fontWeight: FontWeight.w600,
        ),
      ),
      body: Obx(() {
        return ViewStateWidget(
          viewState: controller.viewState.value,
          child: WebViewWidget(controller: controller.webViewController),
        );
      }),
    );
  }
}
