import 'package:aitrainer_app/util/trans.dart';
import 'package:flutter/material.dart';
import 'package:web_browser/web_browser.dart';

// ignore: must_be_immutable
class DialogWebBrowser extends StatelessWidget with Trans {
  final String url;
  final bool javascriptEnabled;
  DialogWebBrowser({Key? key, required this.url, required this.javascriptEnabled}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    setContext(context);
    return Dialog(
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(31),
      ),
      elevation: 0,
      backgroundColor: Colors.transparent,
      child: SafeArea(
        child: WebBrowser(
          initialUrl: url,
          javascriptEnabled: javascriptEnabled,
        ),
      ),
    );
  }
}
