toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  return {
    "initialUrl": widget.initialUrl,
    "initialFile": widget.initialFile,
    "initialHeaders": widget.initialHeaders,
    "initialData": widget.initialData?.toMap(),
    "hasShouldOverrideUrlLoading": widget.shouldOverrideUrlLoading != null,
    "contentBlockers":
        (widget.contentBlockers ?? []).map((v) => v.toMap()).toList(),
    "gestureNavigationEnabled": widget.gestureNavigationEnabled,
    "debuggingEnabled": widget.debuggingEnabled,
    "userAgent": widget.userAgent,
  };
}