getCopyBackForwardList method Null safety

Future<WebHistory?> getCopyBackForwardList()

Gets the WebHistory for this WebView. This contains the back/forward list for use in querying each item in the history stack. This contains only a snapshot of the current state. Multiple calls to this method may return different objects. The object returned from this method will not be updated to reflect any new state.

Official Android API: https://developer.android.com/reference/android/webkit/WebView#copyBackForwardList()

Official iOS API: https://developer.apple.com/documentation/webkit/wkwebview/1414977-backforwardlist

Implementation

Future<WebHistory?> getCopyBackForwardList() async {
  Map<String, dynamic> args = <String, dynamic>{};
  Map<String, dynamic>? result =
      (await _channel.invokeMethod('getCopyBackForwardList', args))
          ?.cast<String, dynamic>();
  return WebHistory.fromMap(result);
}