fix(flutter): voice OAuth sheet shows correct channel (Feishu vs DingTalk)

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 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-09 06:48:16 -07:00
parent 79d6e0b98a
commit 38bea33074
1 changed files with 9 additions and 5 deletions

View File

@ -309,6 +309,10 @@ class _AgentCallPageState extends ConsumerState<AgentCallPage>
/// 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<AgentCallPage>
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<AgentCallPage>
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<AgentCallPage>
height: 52,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF1677FF),
backgroundColor: buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),