getPossibleBreakpoints method

Future<List<WipBreakLocation>> getPossibleBreakpoints(
  1. WipLocation start, {
  2. WipLocation? end,
  3. bool? restrictToFunction,
})

Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.

  • start: Start of range to search possible breakpoint locations in
  • end: End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
  • restrictToFunction: Only consider locations which are in the same (non-nested) function as start.

Implementation

Future<List<WipBreakLocation>> getPossibleBreakpoints(
  WipLocation start, {
  WipLocation? end,
  bool? restrictToFunction,
}) async {
  Map<String, dynamic> params = {
    'start': start.toJsonMap(),
  };
  if (end != null) {
    params['end'] = end.toJsonMap();
  }
  if (restrictToFunction != null) {
    params['restrictToFunction'] = restrictToFunction;
  }

  final WipResponse response =
      await sendCommand('Debugger.getPossibleBreakpoints', params: params);

  if (response.result!.containsKey('exceptionDetails')) {
    throw ExceptionDetails(
        response.result!['exceptionDetails'] as Map<String, dynamic>);
  } else {
    List locations = response.result!['locations'];
    return List.from(locations.map((map) => WipBreakLocation(map)));
  }
}