# setFilter method Null safety

Future<int?> setFilter(

1. String assetUrl

)

Specify material filter effect

Parameters:

`assetUrl` can be an asset resource address defined in Flutter such as 'images/watermark_img.png' or an online image address

Note: PNG format must be used

## Implementation

    Future<int?> setFilter(String assetUrl // Resource address in `assets`
        ) async {
      String imageUrl = assetUrl;
      String type = 'network'; // Online image by default
      if (assetUrl.indexOf('http') != 0) {
        type = 'local';
      }
      return _channel
          .invokeMethod('setFilter', {"imageUrl": imageUrl, "type": type});
    }