Files
pipelines/app/lib/features/chat/conversation/chat_pane_picker.dart
T
alan 96de9f5bea Remove Cupertino chat conversation branches
Keep the Material-only conversation implementation while preserving public Cupertino parameters for callers. Narrow affected tests to Material hosts so the dead platform paths are no longer exercised.
2026-11-11 13:11:05 +00:00

31 lines
920 B
Dart

import 'package:flutter/material.dart';
/// Selects a retained pane when the window cannot show every chat at once.
Future<void> showChatPanePicker(
BuildContext context, {
required List<({String id, String title})> panes,
required String? activeId,
required ValueChanged<String> onSelected,
String title = 'Open chats',
}) async {
final selected = await showDialog<String>(
context: context,
builder: (context) => SimpleDialog(
title: Text(title),
children: [
for (final pane in panes)
SimpleDialogOption(
onPressed: () => Navigator.pop(context, pane.id),
child: Row(
children: [
Expanded(child: Text(pane.title)),
if (pane.id == activeId) const Icon(Icons.check),
],
),
),
],
),
);
if (selected != null && context.mounted) onSelected(selected);
}