setFlag method Null safety
override
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_periodcan be set to a minimum value of 50. Attempting to setprofile_periodto a lower value will result in a value of 50 being set.- Setting
profilerwill 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.
Implementation
@override
Future<Response> setFlag(String name, String value) =>
_call('setFlag', {'name': name, 'value': value});