d407a72a06
Left/right and h/l step between files (or headers in the all-files view), up/down and j/k scroll, / opens find-in-diff (highlighted matches across every file, n/N or Enter/Shift+Enter to move, Escape to close), and a top-bar toggle switches between one file at a time and every file stacked with collapsible headers, like a pull request's Files changed tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.0 KiB
Dart
41 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// The recorded raw patch bytes, one recorded line per line, in a selectable
|
|
/// body.
|
|
///
|
|
/// The text keeps its intrinsic line width, so long lines scroll sideways
|
|
/// instead of wrapping a continuation under a new line.
|
|
class RawPatchView extends StatelessWidget {
|
|
const RawPatchView({
|
|
super.key,
|
|
required this.patch,
|
|
required this.style,
|
|
this.controller,
|
|
});
|
|
|
|
final String patch;
|
|
final TextStyle style;
|
|
final ScrollController? controller;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SingleChildScrollView(
|
|
controller: controller,
|
|
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: ExcludeSemantics(
|
|
child: SelectionArea(
|
|
child: Text(
|
|
patch,
|
|
style: style,
|
|
softWrap: false,
|
|
overflow: TextOverflow.visible,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|