import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'embedder_texture_platform_interface.dart'; /// An implementation of [LinuxOpenglPlatform] that uses method channels. class MethodChannelEmbedderTexture extends EmbedderTexturePlatform { /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('embedder_texture'); @override Future> create(double width, double height) async { final data = await methodChannel.invokeMethod?>('create', { 'width': width.round(), 'height': height.round(), }); return data ?? {}; } @override Future remove(int textureId) async { return await methodChannel.invokeMethod('remove', { 'textureId': textureId, }) ?? false; } }