setFlag method

Future<Response> setFlag(
  1. String name,
  2. String value
)

The setFlag RPC is used to set a VM flag at runtime. Returns an error if the named flag does not exist, the flag may not be set at runtime, or the value is of the wrong type for the flag.

The following flags may be set at runtime:

  • pause_isolates_on_start
  • pause_isolates_on_exit
  • pause_isolates_on_unhandled_exceptions
  • profile_period
  • profiler

Notes:

  • profile_period can be set to a minimum value of 50. Attempting to set profile_period to a lower value will result in a value of 50 being set.
  • Setting profiler will enable or disable the profiler depending on the provided value. If set to false when the profiler is already running, the profiler will be stopped but may not free its sample buffer depending on platform limitations.
  • Isolate pause settings will only be applied to newly spawned isolates.

See Success.

The return value can be one of Success or Error.

Implementation

Future<Response> setFlag(String name, String value) =>
    _call('setFlag', {'name': name, 'value': value});