Unify chat selector menus

Use the permission selector's shared popup and choice-row primitives for model and thinking controls while preserving catalog, search, and next-turn behavior. Remove the obsolete Cupertino model chooser parameter and cover current-model dismissal.
This commit is contained in:
2026-11-11 19:40:26 +00:00
parent 3da71c3053
commit 2d0e33dd67
7 changed files with 227 additions and 137 deletions
+25
View File
@@ -57,6 +57,31 @@ Future<T?> showAppChoiceMenu<T>(
);
}
/// A choice row shared by the app's anchored choice menus. Keeping the row
/// here makes checked state and tap affordances consistent across selectors.
class AppChoiceMenuItem extends StatelessWidget {
const AppChoiceMenuItem({
super.key,
required this.child,
required this.selected,
required this.onTap,
});
final Widget child;
final bool selected;
final VoidCallback? onTap;
@override
Widget build(BuildContext context) => ListTile(
enabled: onTap != null,
title: child,
trailing: selected
? Icon(Icons.check, color: Theme.of(context).colorScheme.primary)
: null,
onTap: onTap,
);
}
/// Shows richer content (a chat's details, a file's details) built by
/// [builder]: a dialog on a wide app, a bottom sheet on a phone, on the root
/// navigator either way. The content sizes itself (a `Column` with