From 2790d4c2267fabb01dfe77266da586f7954754b6 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 4 Mar 2026 04:21:34 -0800 Subject: [PATCH] =?UTF-8?q?fix(genex-mobile):=20Apple=20=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=BB=85=E5=9C=A8=20iOS=20=E4=B8=8A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apple Sign In 是 iOS/macOS 生态专属功能,Android 用户不存在 Apple ID 账号体系,不应在 Android 上展示该入口。 使用 defaultTargetPlatform == TargetPlatform.iOS 条件渲染: - Android: WeChat + Google(2个按钮) - iOS: WeChat + Google + Apple(3个按钮) Co-Authored-By: Claude Sonnet 4.6 --- .../auth/presentation/pages/welcome_page.dart | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/frontend/genex-mobile/lib/features/auth/presentation/pages/welcome_page.dart b/frontend/genex-mobile/lib/features/auth/presentation/pages/welcome_page.dart index bf3329c..e1a70ad 100644 --- a/frontend/genex-mobile/lib/features/auth/presentation/pages/welcome_page.dart +++ b/frontend/genex-mobile/lib/features/auth/presentation/pages/welcome_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/foundation.dart' show defaultTargetPlatform, TargetPlatform; import 'package:fluwx/fluwx.dart'; import '../../../../app/theme/app_colors.dart'; import '../../../../app/theme/app_typography.dart'; @@ -161,7 +162,9 @@ class _WelcomePageState extends State { ), const SizedBox(height: 16), - // Social Login Buttons — WeChat + Google + Apple + // Social Login Buttons + // Apple Sign In 仅在 iOS 上显示(Apple 账号体系限定 iOS/macOS 生态) + // Android 上只显示 WeChat + Google Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -180,14 +183,16 @@ class _WelcomePageState extends State { Navigator.pushReplacementNamed(context, '/main'); }, ), - const SizedBox(width: 24), - _SocialLoginButton( - icon: Icons.apple_rounded, - label: 'Apple', - onTap: () { - Navigator.pushReplacementNamed(context, '/main'); - }, - ), + if (defaultTargetPlatform == TargetPlatform.iOS) ...[ + const SizedBox(width: 24), + _SocialLoginButton( + icon: Icons.apple_rounded, + label: 'Apple', + onTap: () { + Navigator.pushReplacementNamed(context, '/main'); + }, + ), + ], ], ), const SizedBox(height: 32),