From 67e206846ef5cf22161330afc2b5e7f5caa887da Mon Sep 17 00:00:00 2001 From: kfj001 Date: Wed, 29 Apr 2026 06:43:38 +0000 Subject: [PATCH] Adds KRYZ webview\ Co-authored-by: Copilot --- lib/main.dart | 9 +++++++++ macos/Flutter/GeneratedPluginRegistrant.swift | 2 ++ pubspec.yaml | 1 + 3 files changed, 12 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 85cdbde..198524d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:just_audio_background/just_audio_background.dart'; +import 'package:webview_flutter/webview_flutter.dart'; import 'streaming_audio_business_object.dart'; @@ -54,10 +55,14 @@ class MainPage extends StatefulWidget { class _MainPageState extends State { StreamingAudioBusinessObject get _audio => widget.audio; + late final WebViewController _webViewController; @override void initState() { super.initState(); + _webViewController = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..loadRequest(Uri.parse('https://kryzradio.org')); _audio.addListener(_handleAudioStateChanged); } @@ -102,6 +107,10 @@ class _MainPageState extends State { borderRadius: BorderRadius.circular(8), color: Colors.white, ), + child: ClipRRect( + borderRadius: BorderRadius.circular(6), + child: WebViewWidget(controller: _webViewController), + ), ), ), ), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index a5d0213..302bb93 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,10 +9,12 @@ import audio_service import audio_session import just_audio import sqflite_darwin +import webview_flutter_wkwebview func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioServicePlugin.register(with: registry.registrar(forPlugin: "AudioServicePlugin")) AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin")) } diff --git a/pubspec.yaml b/pubspec.yaml index 91ad2a4..5375986 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: just_audio: ^0.10.5 just_audio_background: ^0.0.1-beta.17 audio_session: ^0.2.2 + webview_flutter: ^4.13.0 dev_dependencies: flutter_test: