diff --git a/lib/providers/public_provider.dart b/lib/providers/public_provider.dart new file mode 100644 index 0000000..801fe63 --- /dev/null +++ b/lib/providers/public_provider.dart @@ -0,0 +1,19 @@ +import 'package:chat/utils/network/http.dart'; +import 'package:chat/utils/ui_tools.dart'; + +class PublicProvider { + /// 检测更新 + static Future checkUpgrade() async { + try { + return await Http.get( + 'version/check', + params: { + 'version': '', + }, + ); + } catch (e) { + UiTools.toast(e.toString()); + } + return null; + } +} diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index d2e0378..d314d77 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -73,7 +73,21 @@ class UserProvider { return null; } - static Future updateMobile(String mobile) async {} + static Future updateMobile(String mobile) async { + try { + return await Http.post('user/mobile'); + } catch (e) { + UiTools.toast(e.toString()); + } + return null; + } - static Future updateEmail(String email) async {} + static Future updateEmail(String email) async { + try { + return await Http.post('user/email'); + } catch (e) { + UiTools.toast(e.toString()); + } + return null; + } } diff --git a/lib/views/user/setting/index_page.dart b/lib/views/user/setting/index_page.dart index bae6108..a0eb7c4 100644 --- a/lib/views/user/setting/index_page.dart +++ b/lib/views/user/setting/index_page.dart @@ -63,6 +63,7 @@ class _UserSettingPageState extends State { const SizedBox(height: 8), ActionItem( '版本更新', + extend: '1.0.0', isFirst: true, isLast: true, onTap: () {}, diff --git a/lib/views/user/setting/safe/index_page.dart b/lib/views/user/setting/safe/index_page.dart index d92cf26..53a54a5 100644 --- a/lib/views/user/setting/safe/index_page.dart +++ b/lib/views/user/setting/safe/index_page.dart @@ -49,7 +49,7 @@ class _UserSettingSafePageState extends State { ), const SizedBox(height: 8), ActionItem( - '开启两部验证', + '开启两步验证', extend: (_.userInfo.value.google2fa ?? false) ? '已开启' : '未开启', isFirst: true, isLast: true, diff --git a/lib/views/user/setting/safe/mobile_page.dart b/lib/views/user/setting/safe/mobile_page.dart index 08c7190..4eb2418 100644 --- a/lib/views/user/setting/safe/mobile_page.dart +++ b/lib/views/user/setting/safe/mobile_page.dart @@ -9,7 +9,9 @@ class UserSettingSafeMobilePage extends StatelessWidget { appBar: AppBar( title: const Text('绑定手机'), ), - body: Container(), + body: Column( + children: const [], + ), ); } } diff --git a/pubspec.lock b/pubspec.lock index 0fa1648..60fc5a2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,7 +28,7 @@ packages: name: asn1lib url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.2.2" async: dependency: transitive description: @@ -128,7 +128,7 @@ packages: name: camera_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.2" + version: "2.3.0" camera_web: dependency: transitive description: @@ -213,13 +213,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" - device_info_plus: - dependency: "direct main" - description: - name: device_info_plus - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.0.1" dio: dependency: "direct main" description: @@ -444,21 +437,21 @@ packages: name: image_cropper url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.0" + version: "3.0.1" image_cropper_for_web: dependency: transitive description: name: image_cropper_for_web url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.2" + version: "1.0.3" image_cropper_platform_interface: dependency: transitive description: name: image_cropper_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.2" + version: "3.0.3" intersperse: dependency: transitive description: @@ -564,13 +557,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" - package_info_plus: - dependency: "direct main" - description: - name: package_info_plus - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.0.1" path: dependency: transitive description: @@ -591,7 +577,7 @@ packages: name: path_provider_android url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.20" + version: "2.0.21" path_provider_ios: dependency: transitive description: @@ -813,7 +799,7 @@ packages: name: sqflite_common url: "https://pub.flutter-io.cn" source: hosted - version: "2.3.0" + version: "2.4.0" stack_trace: dependency: transitive description: @@ -855,14 +841,14 @@ packages: name: tencent_im_sdk_plugin url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.9" + version: "4.2.0" tencent_im_sdk_plugin_platform_interface: dependency: transitive description: name: tencent_im_sdk_plugin_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.5" + version: "0.3.6" term_glyph: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index adbccb2..e30c780 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,8 +16,6 @@ dependencies: lpinyin: ^2.0.3 vibration: ^1.7.6 scan: ^1.6.0 - package_info_plus: ^0.0.1 - device_info_plus: ^0.0.1 flutter_easyrefresh: ^2.2.2 cached_network_image: ^3.2.0 flutter_spinkit: ^5.1.0