Open svr2kos2 opened 4 weeks ago
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like I want to use line numbers to show assmble address witch it's not simply 1,2,3,4,5......
Describe alternatives you've considered I'm currently inheriting CodeLineNumberRenderObject and override paint method to do this.
CodeLineNumberRenderObject
paint
class AsmCodeLineNumberRenderObject extends CodeLineNumberRenderObject { //..... @override void paint(PaintingContext context, Offset offset) { //.... for (final CodeLineRenderParagraph paragraph in value.paragraphs) { //convert line number to address final addr = _lineIndex2AsmAddr[firstLineIndex] ?? -1; _textPainter.text = TextSpan( text: '0x${addr.toRadixString(16).toUpperCase().padLeft(4, '0')}', style: paragraph.index == value.focusedIndex ? _focusedTextStyle : _textStyle ); _textPainter.layout(); _textPainter.paint(canvas, Offset(offset.dx + size.width - _textPainter.width, offset.dy + paragraph.offset.dy)); firstLineIndex += _controller.codeLines[paragraph.index].lineCount; } //.... } }
If we can add a callback as a parameter to CodeLineNumberRenderObject, this feature can be easily achieved. I can create a PR if you accept this idea.
Additional context
Welcome!
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like I want to use line numbers to show assmble address witch it's not simply 1,2,3,4,5......
Describe alternatives you've considered I'm currently inheriting
CodeLineNumberRenderObject
and overridepaint
method to do this.If we can add a callback as a parameter to
CodeLineNumberRenderObject
, this feature can be easily achieved. I can create a PR if you accept this idea.Additional context