我可以创建 iOS 或 Android 视图作为组件吗?我想在 Flame 中使用 Native VideoPlayer。
如:NativeView -> Flutter Widget -> Flame 组件 或 NativeView -> Flame 组件
我已成功尝试将 NativeView 桥接到 Flutter Widget,但我不知道如何将其桥接为 Flame 组件。
我认为没有直接的方法可以做到这一点,但您可以使用 Flutter Widget 作为中介。比如:
import 'package:flame/components.dart';
class WidgetComponent extends WidgetComponent {
WidgetComponent()
: super(
widget: FlutterWidget(), // Replace this with your Flutter Widget
priority: 1,
);
}