close method
Close the message port and free any resources associated with it.
Implementation
@override
Future<void> close() async {
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('index', () => params.index);
await _webMessageChannel.internalChannel?.invokeMethod('close', args);
}