reloadSources method Null safety

  1. @override
Future<ReloadReport> reloadSources(
  1. String isolateId,
  2. {bool? force,
  3. bool? pause,
  4. String? rootLibUri,
  5. String? packagesUri}
)
override

The reloadSources RPC is used to perform a hot reload of an Isolate's sources.

if the force parameter is provided, it indicates that all of the Isolate's sources should be reloaded regardless of modification time.

if the pause parameter is provided, the isolate will pause immediately after the reload.

if the rootLibUri parameter is provided, it indicates the new uri to the Isolate's root library.

if the packagesUri parameter is provided, it indicates the new uri to the Isolate's package map (.packages) file.

If isolateId refers to an isolate which has exited, then the Collected Sentinel is returned.

This method will throw a SentinelException in the case a Sentinel is returned.

Implementation

@override
Future<ReloadReport> reloadSources(
  String isolateId, {
  bool? force,
  bool? pause,
  String? rootLibUri,
  String? packagesUri,
}) =>
    _call('reloadSources', {
      'isolateId': isolateId,
      if (force != null) 'force': force,
      if (pause != null) 'pause': pause,
      if (rootLibUri != null) 'rootLibUri': rootLibUri,
      if (packagesUri != null) 'packagesUri': packagesUri,
    });