todo-app/lib/ui/note_editor_raw_field.dart
Krzysztof kuhy Rudnicki 3a747c2e51
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
Report errors and slow waits to the board
crdt_sync_flutter 0.9.0's installAppErrors in main(): uncaught errors and
every spinner shown over 1 s (WaitWatch: sync.run, mirror.test) upload to
RTDB /todo/errors/<device> with the versionCode, where the PC app-errors
ingest files board tickets (kuhyx/utils DOCS-app-errors.md).

The app moves to material_ui first: sync_settings_ui 0.8.x and
design_system 0.4.x sit on it, and Flutter 3.50 deprecates
flutter/material. Pins: crdt_sync 0.14.1, csf 0.9.0, ssui 0.8.3,
gda 0.5.1, design_system 0.4.1, image 4.13.1, mcp_dart 2.4.4.
file_picker stays 13.3.3, held by data_transfer_flutter 0.2.2
(allowlisted, self-clearing).

appRoute takes a route name so each report names its screen; the
release build passes APP_BUILD/APP_VERSION. Nothing new on screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 23:07:58 +01:00

55 lines
1.8 KiB
Dart

/// The raw-mode editing field: the assembled note text, verbatim.
///
/// Split out of `note_editor.dart` for file size. Stateless; the controller
/// stays owned by `_NoteEditorState`.
library;
import 'package:design_system/design_system.dart';
import 'package:material_ui/material_ui.dart';
/// A full-height plain-text field for the note's assembled Markdown.
class NoteEditorRawField extends StatelessWidget {
/// Creates the raw field over [controller].
const NoteEditorRawField({
required this.controller,
required this.autofocus,
required this.onChanged,
super.key,
});
/// Controller holding the raw body text.
final TextEditingController controller;
/// Whether the field takes focus on first build.
final bool autofocus;
/// Called on every keystroke.
final VoidCallback onChanged;
@override
Widget build(BuildContext context) {
// Caps the editing column at ~70 chars (rule 21) on the desktop's
// arbitrarily wide Chrome `--app` window. Center/ConstrainedBox only,
// no extra Column — nesting a second Column here previously broke the
// expands:true constraint chain in release builds (see
// NoteEditorStepPage, which documents the same hazard).
return Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: kProseMaxWidth),
child: TextField(
controller: controller,
autofocus: autofocus,
maxLines: null,
expands: true,
textAlignVertical: TextAlignVertical.top,
keyboardType: TextInputType.multiline,
style: Theme.of(context).textTheme.bodyLarge,
// No hint: the cursor in an empty full-height box says "type".
decoration: const InputDecoration(border: InputBorder.none),
onChanged: (_) => onChanged(),
),
),
);
}
}