MethodChannelMillimeters constructor
MethodChannelMillimeters()
Implementation
MethodChannelMillimeters() {
methodChannel.setMethodCallHandler((call) {
switch ((call.method, call.arguments)) {
case (
"updateResolution",
{"Width": final num width, "Height": final num height}
):
resolutionController.add(Size(width.toDouble(), height.toDouble()));
return Future.value(null);
case (
"updateSize",
{"Width": final num width, "Height": final num height}
):
sizeController.add(Size(width.toDouble(), height.toDouble()));
return Future.value(null);
default:
return Future(
() => throw MissingPluginException(
"No implementation found for method ${call.method}"),
);
}
});
}