|
...
|
...
|
@@ -65,41 +65,33 @@ class LoginView extends GetView<LoginController> { |
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// Welcome texts
|
|
|
|
if (!isOhos() &&
|
|
|
|
!controller.environmentConfig.hideChooseRegion)
|
|
|
|
Positioned(
|
|
|
|
right: 20,
|
|
|
|
top: MediaQuery.paddingOf(context).top,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () => Get.bottomSheet(
|
|
|
|
const _ServiceRegionBottomSheet(),
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
barrierColor: Colors.black.withValues(alpha: 0.5),
|
|
|
|
enableDrag: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
'🌏',
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 23,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Positioned(
|
|
|
|
bottom: bottom(isOhos()
|
|
|
|
? 233
|
|
|
|
: (region == AppRegion.china ? 277 : 273)),
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
// Debug button for environment switching
|
|
|
|
controller.environmentConfig.isDebug
|
|
|
|
? Center(
|
|
|
|
child: TextButton(
|
|
|
|
onPressed: controller.onDebugPressed,
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
foregroundColor: Colors.red,
|
|
|
|
textStyle: const TextStyle(
|
|
|
|
fontSize: 18,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Obx(() {
|
|
|
|
final environmentConfig =
|
|
|
|
Get.find<AppEnvironmentConfig>();
|
|
|
|
return Text(environmentConfig
|
|
|
|
.environment.value.name
|
|
|
|
.toUpperCase());
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
Image.asset(
|
|
|
|
'assets/images/common/ic_double_feel_text.png',
|
|
|
|
width: 160,
|
|
|
|
height: 42,
|
|
...
|
...
|
@@ -124,16 +116,9 @@ class LoginView extends GetView<LoginController> { |
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
// Login buttons – add new methods here as Column children
|
|
|
|
Positioned(
|
|
|
|
bottom: bottom(85),
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
child: Center(
|
|
|
|
SizedBox(height: 12),
|
|
|
|
// buttons
|
|
|
|
Center(
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -146,8 +131,7 @@ class LoginView extends GetView<LoginController> { |
|
|
|
Get.find<LocalStorage>().lastLoginMethod ==
|
|
|
|
'phone',
|
|
|
|
lastUsedLabel: l10n.loginLastUsed,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
if (region == AppRegion.global && !isOhos()) ...[
|
|
|
|
_LoginMethodButton(
|
|
...
|
...
|
@@ -158,8 +142,7 @@ class LoginView extends GetView<LoginController> { |
|
|
|
Get.find<LocalStorage>().lastLoginMethod ==
|
|
|
|
'email',
|
|
|
|
lastUsedLabel: l10n.loginLastUsed,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
),
|
|
|
|
_LoginMethodButton(
|
|
|
|
width: buttonWidth,
|
|
|
|
label: l10n.continueWithGoogle,
|
|
...
|
...
|
@@ -193,23 +176,22 @@ class LoginView extends GetView<LoginController> { |
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 12)
|
|
|
|
),
|
|
|
|
],
|
|
|
|
if (isIOS()) ...[
|
|
|
|
|
|
|
|
if (region == AppRegion.china) ...[
|
|
|
|
_LoginMethodButton(
|
|
|
|
width: buttonWidth,
|
|
|
|
label: l10n.loginWithApple,
|
|
|
|
onPressed: controller.onAppleLoginPressed,
|
|
|
|
label: '通过微信登录',
|
|
|
|
onPressed: controller.onWechatLoginPressed,
|
|
|
|
isLastUsed:
|
|
|
|
Get.find<LocalStorage>().lastLoginMethod ==
|
|
|
|
'apple',
|
|
|
|
'wechat',
|
|
|
|
lastUsedLabel: l10n.loginLastUsed,
|
|
|
|
icon: Image.asset(
|
|
|
|
'assets/images/common/ic_apple.png',
|
|
|
|
'assets/images/common/ic_wechat.png',
|
|
|
|
width: 24,
|
|
|
|
height: 24,
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
height: 24,
|
|
|
|
),
|
|
|
|
buttonStyle: ElevatedButton.styleFrom(
|
|
|
|
backgroundColor: Colors.white,
|
|
...
|
...
|
@@ -233,20 +215,20 @@ class LoginView extends GetView<LoginController> { |
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
if (region == AppRegion.china) ...[
|
|
|
|
const SizedBox(height: 12),
|
|
|
|
if (isIOS()) ...[
|
|
|
|
_LoginMethodButton(
|
|
|
|
width: buttonWidth,
|
|
|
|
label: '通过微信登录',
|
|
|
|
onPressed: controller.onWechatLoginPressed,
|
|
|
|
label: l10n.loginWithApple,
|
|
|
|
onPressed: controller.onAppleLoginPressed,
|
|
|
|
isLastUsed:
|
|
|
|
Get.find<LocalStorage>().lastLoginMethod ==
|
|
|
|
'wechat',
|
|
|
|
'apple',
|
|
|
|
lastUsedLabel: l10n.loginLastUsed,
|
|
|
|
icon: Image.asset(
|
|
|
|
'assets/images/common/ic_wechat.png',
|
|
|
|
'assets/images/common/ic_apple.png',
|
|
|
|
width: 24,
|
|
|
|
height: 24,
|
|
|
|
color: context.colors.textPrimary,
|
|
|
|
),
|
|
|
|
buttonStyle: ElevatedButton.styleFrom(
|
|
|
|
backgroundColor: Colors.white,
|
|
...
|
...
|
@@ -269,44 +251,39 @@ class LoginView extends GetView<LoginController> { |
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// Terms agreement text + checkbox
|
|
|
|
Positioned(
|
|
|
|
bottom: bottom(0),
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
child: const AgreementText(),
|
|
|
|
),
|
|
|
|
// Terms agreement text + checkbox
|
|
|
|
AgreementText(),
|
|
|
|
SizedBox(height: bottomInset),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
if (controller.environmentConfig.isDebug)
|
|
|
|
// Welcome texts
|
|
|
|
if (!isOhos() &&
|
|
|
|
!controller.environmentConfig.hideChooseRegion)
|
|
|
|
Positioned(
|
|
|
|
left: 0,
|
|
|
|
right: 0,
|
|
|
|
bottom: bottom(0),
|
|
|
|
child: Center(
|
|
|
|
child: TextButton(
|
|
|
|
onPressed: controller.onDebugPressed,
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
foregroundColor: context.colors.textSecondary
|
|
|
|
.withValues(alpha: 0.55),
|
|
|
|
textStyle: const TextStyle(
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
right: 20,
|
|
|
|
top: MediaQuery.paddingOf(context).top,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () => Get.bottomSheet(
|
|
|
|
const _ServiceRegionBottomSheet(),
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
barrierColor: Colors.black.withValues(alpha: 0.5),
|
|
|
|
enableDrag: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
'🌏',
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.black,
|
|
|
|
fontSize: 23,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Obx(() {
|
|
|
|
final environmentConfig =
|
|
|
|
Get.find<AppEnvironmentConfig>();
|
|
|
|
return Text(
|
|
|
|
environmentConfig.environment.value.name);
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
});
|
|
...
|
...
|
@@ -593,11 +570,11 @@ class _LoginMethodButton extends StatelessWidget { |
|
|
|
onPressed: onPressed,
|
|
|
|
icon: icon,
|
|
|
|
buttonStyle: buttonStyle,
|
|
|
|
),
|
|
|
|
).marginOnly(top: 12),
|
|
|
|
if (isLastUsed)
|
|
|
|
Positioned(
|
|
|
|
right: -4,
|
|
|
|
top: -8,
|
|
|
|
top: 8,
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
|
|
|
decoration: ShapeDecoration(
|
...
|
...
|
|