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:
parent
79d6e0b98a
commit
38bea33074
|
|
@ -309,6 +309,10 @@ class _AgentCallPageState extends ConsumerState<AgentCallPage>
|
||||||
|
|
||||||
/// Show DingTalk OAuth authorization card pushed by iAgent.
|
/// Show DingTalk OAuth authorization card pushed by iAgent.
|
||||||
void _showOAuthBottomSheet(String url, String instanceName) {
|
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(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: const Color(0xFF1A1D2E),
|
backgroundColor: const Color(0xFF1A1D2E),
|
||||||
|
|
@ -331,7 +335,7 @@ class _AgentCallPageState extends ConsumerState<AgentCallPage>
|
||||||
const Text('🦞', style: TextStyle(fontSize: 48)),
|
const Text('🦞', style: TextStyle(fontSize: 48)),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
'授权「$instanceName」接入钉钉',
|
'授权「$instanceName」接入$channelName',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
|
|
@ -340,9 +344,9 @@ class _AgentCallPageState extends ConsumerState<AgentCallPage>
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
const Text(
|
Text(
|
||||||
'点击下方按钮,在钉钉中一键完成授权绑定',
|
'点击下方按钮,在$channelName中一键完成授权绑定',
|
||||||
style: TextStyle(color: Colors.white54, fontSize: 14),
|
style: const TextStyle(color: Colors.white54, fontSize: 14),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
@ -351,7 +355,7 @@ class _AgentCallPageState extends ConsumerState<AgentCallPage>
|
||||||
height: 52,
|
height: 52,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: const Color(0xFF1677FF),
|
backgroundColor: buttonColor,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue