init method
Implementation
void init(int viewId) async {
value = value.copyWith(isInitialized: true, viewId: viewId);
_channel = MethodChannel('plugins.flutter.io/deep_ar_camera/$viewId');
print("init $viewId ${_channel.name}");
// _channel!.setMethodCallHandler((MethodCall call) async {
// print("receivedMessage ${call.method}");
// _eventHandler?.process(call.method, call.arguments);
// });
///
///start event listening after view is ready!
///
// _stream = _eventChannel.receiveBroadcastStream();
_subscription = _eventChannel.receiveBroadcastStream().listen((event) {
print("receiveBroadcastStream $event");
final eventMap = Map<dynamic, dynamic>.from(event);
final methodName = eventMap['methodName'] as String;
final data = eventMap['data'];
_eventHandler?.process(methodName, data);
});
String resp = await _channel.invokeMethod('isCameraReady');
print("Camera Status $resp");
}