From 38bea33074eb8e04da86d68fe0566be08fd32de4 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 9 Mar 2026 06:48:16 -0700 Subject: [PATCH] fix(flutter): voice OAuth sheet shows correct channel (Feishu vs DingTalk) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _showOAuthBottomSheet title/subtitle were hardcoded to 钉钉. Now detects channel from the URL (feishu.cn → 飞书, else → 钉钉) and shows correct text and button color (#3370FF for Feishu, #1677FF for DingTalk). Co-Authored-By: Claude Sonnet 4.6 --- .../presentation/pages/agent_call_page.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/it0_app/lib/features/agent_call/presentation/pages/agent_call_page.dart b/it0_app/lib/features/agent_call/presentation/pages/agent_call_page.dart index fdb60a1..5ae63c3 100644 --- a/it0_app/lib/features/agent_call/presentation/pages/agent_call_page.dart +++ b/it0_app/lib/features/agent_call/presentation/pages/agent_call_page.dart @@ -309,6 +309,10 @@ class _AgentCallPageState extends ConsumerState /// Show DingTalk OAuth authorization card pushed by iAgent. void _showOAuthBottomSheet(String url, String instanceName) { + final isFeishu = url.contains('feishu.cn') || url.contains('larksuite.com'); + final channelName = isFeishu ? '飞书' : '钉钉'; + final buttonColor = isFeishu ? const Color(0xFF3370FF) : const Color(0xFF1677FF); + showModalBottomSheet( context: context, backgroundColor: const Color(0xFF1A1D2E), @@ -331,7 +335,7 @@ class _AgentCallPageState extends ConsumerState const Text('🦞', style: TextStyle(fontSize: 48)), const SizedBox(height: 12), Text( - '授权「$instanceName」接入钉钉', + '授权「$instanceName」接入$channelName', style: const TextStyle( color: Colors.white, fontSize: 18, @@ -340,9 +344,9 @@ class _AgentCallPageState extends ConsumerState textAlign: TextAlign.center, ), const SizedBox(height: 8), - const Text( - '点击下方按钮,在钉钉中一键完成授权绑定', - style: TextStyle(color: Colors.white54, fontSize: 14), + Text( + '点击下方按钮,在$channelName中一键完成授权绑定', + style: const TextStyle(color: Colors.white54, fontSize: 14), textAlign: TextAlign.center, ), const SizedBox(height: 24), @@ -351,7 +355,7 @@ class _AgentCallPageState extends ConsumerState height: 52, child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF1677FF), + backgroundColor: buttonColor, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ),