mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 16:35:47 +08:00
Remove the embedded AVNC and import it as a Flutter plugin
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user