import 'dart:ui_web' as ui;

import 'package:flutter/material.dart';
import 'package:universal_html/html.dart';

class OrderPayPage extends StatelessWidget {
  const OrderPayPage({super.key});

  @override
  Widget build(BuildContext context) {
    registerHtmlElementView();
    return const HtmlElementView(
      viewType: 'payment-html',
    );
  }

  void registerHtmlElementView() {
    ui.platformViewRegistry.registerViewFactory(
        'payment-html',
        (int viewId) => IFrameElement()
          ..src = 'payment.html'
          ..style.width = '100%'
          ..style.height = '500px'
          ..style.border = 'none');
  }
}
