import 'package:design/design.dart';
import 'package:guru_utils/router/router.dart';
import 'package:guru_widgets/pages/webview/guru_webview_page.dart';
import 'package:guru_widgets/theme/guru_theme.dart';
import 'package:guru_utils/router/router.dart';

import '../../route/router.dart';
import 'webview_controller.dart';

class WebviewPage extends GetWidget<WebviewController> {
  const WebviewPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final guruTheme = GuruTheme.of(context);
    final colorScheme = guruTheme.colorScheme;
    
    return GuruWebviewPage(
      url: Uri.parse("https://www.baidu.com"),
      actions: [
        IconButton(
          padding: EdgeInsets.symmetric(horizontal: controller.designModel.moreIconMarginEnd),
          splashRadius: controller.designModel.moreIconSize,
          icon: ImageIcon(
            const AssetImage("assets/images/more.png"),
            size: controller.designModel.moreIconSize,
            color: colorScheme.primaryContentColor ?? Colors.white,
          ),
          onPressed: () {
            RouteCenter.instance.openPath(Routes.privacySettings.path());
          },
        )
      ],);
  }
}