feat(prescription): expand canvas to fill bottom space and add cursor-aware newline on bullet insertion

This commit is contained in:
=
2026-09-22 14:15:44 -04:00
parent 654a7f402d
commit 6b3b606fec
2 changed files with 376 additions and 306 deletions
+13 -1
View File
@@ -79,7 +79,7 @@ void main() {
expect(find.text('ESC para salir'), findsOneWidget);
});
testWidgets('inserts bullet when clicking viñeta button', (tester) async {
testWidgets('inserts bullet when clicking viñeta button and jumps to new line if text has content', (tester) async {
final configStore = ConfigStore();
await tester.pumpWidget(
MaterialApp(
@@ -100,6 +100,18 @@ void main() {
await tester.pump();
expect(find.text('• '), findsOneWidget);
// Now enter text at end of line and test auto-newline
final prescriptionField = find.byWidgetPredicate(
(w) => w is TextField && (w.decoration?.hintText?.contains('Ciprofloxacina') ?? false),
);
await tester.enterText(prescriptionField, '1. Ciprofloxacina 500mg');
await tester.pump();
await tester.tap(bulletBtn);
await tester.pump();
expect(find.text('1. Ciprofloxacina 500mg\n• '), findsOneWidget);
});
testWidgets('inserts sequential numbers and sub-indication dosis', (tester) async {