add preparation for windows platform view

This commit is contained in:
Nick Fisher
2022-01-30 15:59:39 +08:00
parent d723c772ec
commit 24d0973129
9 changed files with 19 additions and 156 deletions

View File

@@ -41,9 +41,9 @@ class PolyvoxFilamentController extends FilamentController {
@override
void onFilamentViewCreated(int id) async {
_id = id;
_channel = MethodChannel("holovox.app/filament_view_$id");
_channel = MethodChannel("app.polyvox.filament/filament_view_$id");
_channel.setMethodCallHandler((call) async {
await Future.delayed(Duration(
await Future.delayed(const Duration(
seconds:
1)); // todo - need a better way to know when the GL context is actually ready
await _initialize();
@@ -52,7 +52,7 @@ class PolyvoxFilamentController extends FilamentController {
});
}
@override
Future _initialize() async {
await _channel.invokeMethod("initialize", [
"packages/polyvox_filament/assets/lit_opaque.filamat",

View File

@@ -8,7 +8,7 @@ import '../../filament_controller.dart';
import 'filament_view_platform.dart';
class FilamentView extends FilamentViewPlatform {
static const FILAMENT_VIEW_ID = 'holovox.app/filament_view';
static const FILAMENT_VIEW_ID = 'app.polyvox.filament/filament_view';
@override
Widget buildView(
@@ -50,6 +50,9 @@ class FilamentView extends FilamentViewPlatform {
onFilamentViewCreated(id);
},
);
case TargetPlatform.windows:
return Text(
"Flutter doesn't support platform view on Windows yet.");
default:
return Text(
'$defaultTargetPlatform is not yet implemented by Filament plugin.');