handleMethodCall method

Future<void> handleMethodCall(
  1. MethodCall methodCall
)

Implementation

Future<void> handleMethodCall(MethodCall methodCall) {
  print('handleMethodCall, method:${methodCall.method}');
  IntegrationPageContainerState container = FlutterIntegration.container;

  if (methodCall.method == "openPage") {
    String routeName = methodCall.arguments['routeName'];
    String pageId = methodCall.arguments['pageId'];
    var params = methodCall.arguments['params'];

    IntegrationLogger.log('open routeName:{$routeName} pageId:{$pageId}');
    container.openPage(routeName, pageId, params);
  } else if (methodCall.method == 'removePage') {
    String pageId = methodCall.arguments['pageId'];

    IntegrationLogger.log('[route] remove pageId:{$pageId}');
    container.removePage(pageId);
  } else {
    throw MissingPluginException("method==${methodCall.method}");
  }

  return null;
}