Add master-detail layout for Notes and Chat on wide screens

On screens ≥600dp, Notes and Chat show a two-pane layout:
- Left pane (300dp): scrollable list with selection highlight
- Right pane: inline detail (NoteDetailScreen / ChatScreen)

Tapping a list item selects it in wide mode instead of pushing a route.
Creating a new conversation on wide screen auto-selects it in the pane.
Deleting a selected note/conversation clears the right pane.
NoteDetailScreen gains an optional onDeleted callback used by the
embedded pane to clear selection rather than call context.pop().
Tasks keep push-based navigation (edit form has save/pop semantics
that require a full-screen context).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 12:48:45 -05:00
parent 2d4c9a9f70
commit 45768e9bb8
3 changed files with 327 additions and 221 deletions
+6 -2
View File
@@ -8,7 +8,9 @@ import '../../providers/notes_provider.dart';
class NoteDetailScreen extends ConsumerWidget {
final int noteId;
const NoteDetailScreen({super.key, required this.noteId});
// Provided when embedded in master-detail: called instead of context.pop().
final VoidCallback? onDeleted;
const NoteDetailScreen({super.key, required this.noteId, this.onDeleted});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -51,7 +53,9 @@ class NoteDetailScreen extends ConsumerWidget {
);
if (confirm == true) {
await ref.read(notesProvider.notifier).delete(noteId);
if (context.mounted) context.pop();
if (context.mounted) {
onDeleted != null ? onDeleted!() : context.pop();
}
}
},
),