Showing
4 changed files
with
27 additions
and
1 deletions
| @@ -12,6 +12,8 @@ PODS: | @@ -12,6 +12,8 @@ PODS: | ||
| 12 | - PromisesSwift (~> 2.4) | 12 | - PromisesSwift (~> 2.4) |
| 13 | - RecaptchaInterop (~> 101.0) | 13 | - RecaptchaInterop (~> 101.0) |
| 14 | - Flutter (1.0.0) | 14 | - Flutter (1.0.0) |
| 15 | + - flutter_timezone (0.0.1): | ||
| 16 | + - Flutter | ||
| 15 | - fluttertoast (0.0.2): | 17 | - fluttertoast (0.0.2): |
| 16 | - Flutter | 18 | - Flutter |
| 17 | - GoogleSignIn (9.2.0): | 19 | - GoogleSignIn (9.2.0): |
| @@ -98,6 +100,7 @@ PODS: | @@ -98,6 +100,7 @@ PODS: | ||
| 98 | 100 | ||
| 99 | DEPENDENCIES: | 101 | DEPENDENCIES: |
| 100 | - Flutter (from `Flutter`) | 102 | - Flutter (from `Flutter`) |
| 103 | + - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`) | ||
| 101 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) | 104 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) |
| 102 | - GoogleSignIn | 105 | - GoogleSignIn |
| 103 | - image_cropper (from `.symlinks/plugins/image_cropper/ios`) | 106 | - image_cropper (from `.symlinks/plugins/image_cropper/ios`) |
| @@ -132,6 +135,8 @@ SPEC REPOS: | @@ -132,6 +135,8 @@ SPEC REPOS: | ||
| 132 | EXTERNAL SOURCES: | 135 | EXTERNAL SOURCES: |
| 133 | Flutter: | 136 | Flutter: |
| 134 | :path: Flutter | 137 | :path: Flutter |
| 138 | + flutter_timezone: | ||
| 139 | + :path: ".symlinks/plugins/flutter_timezone/ios" | ||
| 135 | fluttertoast: | 140 | fluttertoast: |
| 136 | :path: ".symlinks/plugins/fluttertoast/ios" | 141 | :path: ".symlinks/plugins/fluttertoast/ios" |
| 137 | image_cropper: | 142 | image_cropper: |
| @@ -161,6 +166,7 @@ SPEC CHECKSUMS: | @@ -161,6 +166,7 @@ SPEC CHECKSUMS: | ||
| 161 | AppAuth: ef4da5a3fc2e10b90c09a0a94a9baeaedc0341d5 | 166 | AppAuth: ef4da5a3fc2e10b90c09a0a94a9baeaedc0341d5 |
| 162 | AppCheckCore: e215d35177a9cf469927863e69c13e220df32a8b | 167 | AppCheckCore: e215d35177a9cf469927863e69c13e220df32a8b |
| 163 | Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 | 168 | Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 |
| 169 | + flutter_timezone: 7c838e17ffd4645d261e87037e5bebf6d38fe544 | ||
| 164 | fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 | 170 | fluttertoast: 2c67e14dce98bbdb200df9e1acf610d7a6264ea1 |
| 165 | GoogleSignIn: e449a40a92e9f2eea56e98b5214d13725dc5a00a | 171 | GoogleSignIn: e449a40a92e9f2eea56e98b5214d13725dc5a00a |
| 166 | GoogleUtilities: 766ace00c6b10d8148408f329d10c4f051931850 | 172 | GoogleUtilities: 766ace00c6b10d8148408f329d10c4f051931850 |
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | import 'dart:convert'; | 2 | import 'dart:convert'; |
| 3 | import 'package:crypto/crypto.dart'; | 3 | import 'package:crypto/crypto.dart'; |
| 4 | +import 'package:flutter_timezone/flutter_timezone.dart'; | ||
| 4 | import 'package:doublefeel_flutter/app/modules/login/views/email_login_new_password_view.dart'; | 5 | import 'package:doublefeel_flutter/app/modules/login/views/email_login_new_password_view.dart'; |
| 5 | import 'package:doublefeel_flutter/app/modules/login/views/email_login_view.dart'; | 6 | import 'package:doublefeel_flutter/app/modules/login/views/email_login_view.dart'; |
| 6 | import 'package:doublefeel_flutter/core/config/app_environment_config.dart'; | 7 | import 'package:doublefeel_flutter/core/config/app_environment_config.dart'; |
| @@ -474,7 +475,7 @@ class LoginController extends GetxController { | @@ -474,7 +475,7 @@ class LoginController extends GetxController { | ||
| 474 | String accessToken = loginData.accessToken; | 475 | String accessToken = loginData.accessToken; |
| 475 | 476 | ||
| 476 | if (isRegister) { | 477 | if (isRegister) { |
| 477 | - Object? registerData; | 478 | + Map<String, dynamic>? registerData; |
| 478 | if (isApple) { | 479 | if (isApple) { |
| 479 | registerData = { | 480 | registerData = { |
| 480 | 'login_type': 'apple', | 481 | 'login_type': 'apple', |
| @@ -500,6 +501,16 @@ class LoginController extends GetxController { | @@ -500,6 +501,16 @@ class LoginController extends GetxController { | ||
| 500 | 'verification_code': codeInput.value, | 501 | 'verification_code': codeInput.value, |
| 501 | }; | 502 | }; |
| 502 | } | 503 | } |
| 504 | + if (environmentConfig.region.value == AppRegion.global) { | ||
| 505 | + try { | ||
| 506 | + final timezoneInfo = await FlutterTimezone.getLocalTimezone(); | ||
| 507 | + registerData['tz_iana'] = timezoneInfo.identifier; | ||
| 508 | + } catch (e) { | ||
| 509 | + // AppLogger.w('Failed to get IANA timezone: $e'); | ||
| 510 | + // registerData['tz_iana'] = DateTime.now().timeZoneName; | ||
| 511 | + } | ||
| 512 | + } | ||
| 513 | + | ||
| 503 | final regRes = await _userApi.register(registerData); | 514 | final regRes = await _userApi.register(registerData); |
| 504 | if (regRes is AppSuccess<RegisterResponse>) { | 515 | if (regRes is AppSuccess<RegisterResponse>) { |
| 505 | accessToken = regRes.data.accessToken; | 516 | accessToken = regRes.data.accessToken; |
| @@ -352,6 +352,14 @@ packages: | @@ -352,6 +352,14 @@ packages: | ||
| 352 | description: flutter | 352 | description: flutter |
| 353 | source: sdk | 353 | source: sdk |
| 354 | version: "0.0.0" | 354 | version: "0.0.0" |
| 355 | + flutter_timezone: | ||
| 356 | + dependency: "direct main" | ||
| 357 | + description: | ||
| 358 | + name: flutter_timezone | ||
| 359 | + sha256: "869677426fde92dbe170fb7d2d4929f2a8343c2f5f62f08b0bb64f908630b073" | ||
| 360 | + url: "https://pub.dev" | ||
| 361 | + source: hosted | ||
| 362 | + version: "5.1.0" | ||
| 355 | flutter_web_plugins: | 363 | flutter_web_plugins: |
| 356 | dependency: transitive | 364 | dependency: transitive |
| 357 | description: flutter | 365 | description: flutter |
| @@ -63,6 +63,7 @@ dependencies: | @@ -63,6 +63,7 @@ dependencies: | ||
| 63 | ref: 2.4.2-ohos-1.0.0-beta.2 | 63 | ref: 2.4.2-ohos-1.0.0-beta.2 |
| 64 | path: sqflite | 64 | path: sqflite |
| 65 | crypto: ^3.0.7 | 65 | crypto: ^3.0.7 |
| 66 | + flutter_timezone: ^5.1.0 | ||
| 66 | 67 | ||
| 67 | 68 | ||
| 68 | # share_plus (git) 间接依赖 path_provider 的 git 版本, | 69 | # share_plus (git) 间接依赖 path_provider 的 git 版本, |
-
Please register or login to post a comment