Этот репозиторий содержит Flutter плагины для платформы ОС Аврора.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
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<int?> create(double width, double height) async {
|
|
|
|
final version = await methodChannel.invokeMethod<int>('create', {
|
|
|
|
'width': width,
|
|
|
|
'height': height,
|
|
|
|
});
|
|
|
|
return version;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<bool> remove(int textureId) async {
|
|
|
|
return await methodChannel.invokeMethod<bool>('remove', {
|
|
|
|
'textureId': textureId,
|
|
|
|
}) ?? false;
|
|
|
|
}
|
|
|
|
}
|