import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:hello_wallpaper/common/components/navigation_bar/base_appbar.dart';
import 'package:hello_wallpaper/common/components/view_state_widget.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'web_page_controller.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,
          child: WebViewWidget(controller: controller.webViewController),
        );
      }),
    );
  }
}
