Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/code_field/code_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ class _CodeFieldState extends State<CodeField> {
return GutterWidget(
codeController: widget.controller,
style: gutterStyle,
scrollController: _numberScroll,
);
}

Expand Down
25 changes: 16 additions & 9 deletions lib/src/gutter/gutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ class GutterWidget extends StatelessWidget {
const GutterWidget({
required this.codeController,
required this.style,
required this.scrollController,
});

final CodeController codeController;
final GutterStyle style;
final ScrollController? scrollController;

@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: codeController,
builder: _buildOnChange,
return Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: SingleChildScrollView(
controller: scrollController,
child: AnimatedBuilder(
animation: codeController,
builder: _buildOnChange,
),
),
);
}

Expand Down Expand Up @@ -66,13 +74,12 @@ class GutterWidget extends StatelessWidget {
}

return Container(
padding: EdgeInsets.only(top: 12, bottom: 12, right: style.margin),
width: style.showLineNumbers ? gutterWidth : null,
padding: EdgeInsets.only(right: style.margin),
child: Table(
columnWidths: {
_lineNumberColumn: const FlexColumnWidth(),
_issueColumn: FixedColumnWidth(issueColumnWidth),
_foldingColumn: FixedColumnWidth(foldingColumnWidth),
columnWidths: const {
_lineNumberColumn: IntrinsicColumnWidth(),
_issueColumn: IntrinsicColumnWidth(),
_foldingColumn: IntrinsicColumnWidth(),
},
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
children: tableRows,
Expand Down