import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class Informasi extends StatefulWidget {
  final String imageUrl;
  final String judul;
  final String Konten;
  const Informasi(
      {super.key,
      required this.imageUrl,
      required this.judul,
      required this.Konten});

  @override
  State<Informasi> createState() => _InformasiState();
}

class _InformasiState extends State<Informasi> {
  String initialUrl = '';
  String initialUrl2 = '';

  @override
  void initState() {
    super.initState();
    initialUrl = '${widget.Konten}';
    initialUrl2 = '${widget.imageUrl}';
  }

  @override
  Widget build(BuildContext context) {
    var JavascriptMode;
    return Scaffold(
        appBar: AppBar(
          title: Text(''),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              Container(
                height: 150,
                width: 150,
                child: WebView(
                  initialUrl: initialUrl2,
                  javascriptMode: JavascriptMode.unrestricted,
                ),
              ),
              Center(
                child: Text(
                  widget.judul,
                  style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                ),
              ),
              Container(
                padding: EdgeInsets.all(20),
                height: MediaQuery.of(context).size.height * 0.7,
                width: double.infinity,
                child: WebView(
                  initialUrl: initialUrl,
                  javascriptMode: JavascriptMode.unrestricted,
                ),
              )
            ],
          ),
        ));
  }

  WebView({required String initialUrl, required javascriptMode}) {}
}
