init method

  1. @override
Future<void> init()
override

Implementation

@override
Future<void> init() async {
  _channel.setMethodCallHandler((call) async {
    if ("orientationCallback" == call.method && orientationCallback != null) {
      int orientation = int.parse(call.arguments);
      if (_lastOrientation == orientation) {
        return;
      }
      _lastOrientation = orientation;
      orientationCallback!(orientation);
    }
  });
  _channel.invokeMethod("init");
}