refactor: share handler

This commit is contained in:
cogwheel0
2025-08-28 14:45:46 +05:30
parent 4a524d404e
commit 5c72537932
5 changed files with 51 additions and 8 deletions

View File

@@ -342,6 +342,16 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
orElse: () => false,
);
// React to external focus requests (e.g., from share prefill)
final focusTick = ref.watch(inputFocusTriggerProvider);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
if (focusTick > 0) {
_ensureFocusedIfEnabled();
if (!_isExpanded) _setExpanded(true);
}
});
return Container(
// Transparent wrapper so rounded corners are visible against page background
color: Colors.transparent,