createSurface method

  1. @override
Future<int> createSurface(
  1. int width,
  2. int height
)
override

Implementation

@override
Future<int> createSurface(int width, int height) async {
  int? textureId;
  try {
    textureId = await methodChannel.invokeMethod<int>('createSurface', {
      'width': width,
      'height': height,
    });
  } on PlatformException catch (e) {
    debugPrint(e.toString());
    return -1;
  }
  return textureId ?? -1;
}