Remove the embedded AVNC and import it as a Flutter plugin

This commit is contained in:
Caten
2025-08-04 14:40:57 +08:00
parent eeaccc3371
commit 7a6db4e4cf
168 changed files with 21 additions and 18086 deletions

View File

@@ -35,6 +35,8 @@ import 'package:tiny_computer/l10n/app_localizations.dart';
import 'package:tiny_computer/workflow.dart';
import 'package:avnc_flutter/avnc_flutter.dart';
void main() {
runApp(const MyApp());
}
@@ -339,10 +341,10 @@ class _SettingPageState extends State<SettingPage> {
const SizedBox.square(dimension: 16),
Wrap(alignment: WrapAlignment.center, spacing: 4.0, runSpacing: 4.0, children: [
OutlinedButton(style: D.commandButtonStyle, child: Text(AppLocalizations.of(context)!.avncSettings), onPressed: () async {
await D.androidChannel.invokeMethod("launchPrefsPage", {});
await AvncFlutter.launchPrefsPage();
}),
OutlinedButton(style: D.commandButtonStyle, child: Text(AppLocalizations.of(context)!.aboutAVNC), onPressed: () async {
await D.androidChannel.invokeMethod("launchAboutPage", {});
await AvncFlutter.launchAboutPage();
}),
OutlinedButton(style: D.commandButtonStyle, child: Text(AppLocalizations.of(context)!.avncResolution), onPressed: () async {
final s = WidgetsBinding.instance.platformDispatcher.views.first.physicalSize;

View File

@@ -41,6 +41,8 @@ import 'package:device_info_plus/device_info_plus.dart';
import 'package:tiny_computer/l10n/app_localizations.dart';
import 'package:avnc_flutter/avnc_flutter.dart';
class Util {
static Future<void> copyAsset(String src, String dst) async {
@@ -873,7 +875,7 @@ clear""");
}
static Future<void> launchAvnc() async {
await D.androidChannel.invokeMethod("launchUsingUri", {"vncUri": Util.getCurrentProp("vncUri") as String});
await AvncFlutter.launchUsingUri(Util.getCurrentProp("vncUri") as String);
}
static Future<void> launchXServer() async {