Open
Description
This was originally raised at Dart-Code/Dart-Code#5394 by @markbeij.
Breakpoints in unnamed extensions don't seem to work on web, instead execution pauses on the parent frame and an error is printed:
FrameComputer: Error calculating sync frame: RangeError (end): Invalid value: Not in inclusive range 15..26: 10
The message appears to come from here:
Here I have a breakpoint on line 20 (return this
) but execution paused at the parent frame:
Example code:
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(body: Center(child: Text(''.myExtension()))),
);
}
}
extension on String {
String myExtension() {
return this; // Breakpoint on this line
}
}