handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Handles method calls over the MethodChannel of this plugin. Note: Check the "federated" architecture for a new way of doing this: https://flutter.dev/go/federated-plugins

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'getPlatformVersion':
      return getPlatformVersion();
    case 'checkAvailability':
      Map<String, String> map = call.arguments("emoji");
      Map<String, String> filtered = <String, String>{};
      for (MapEntry<String, String> entry in map.entries ) {
        //if(PaintCompat.hasGlyph(paint, entry.getValue().toString())){
        //  filtered.put(entry.getKey().toString(), entry.getValue().toString());
        //}
        filtered.putIfAbsent(entry.key.toString(), () => entry.value.toString());
      }
      return filtered;
    default:
      throw PlatformException(
        code: 'Unimplemented',
        details: 'emoji_choose for web doesn\'t implement \'${call.method}\'',
      );
  }
}