diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 0eafb9d..5833252 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"agora_rtc_engine","dependencies":[]},{"name":"amap_location","dependencies":[]},{"name":"android_intent","dependencies":[]},{"name":"app_installer","dependencies":[]},{"name":"apple_sign_in","dependencies":[]},{"name":"audioplayer","dependencies":[]},{"name":"auto_orientation","dependencies":[]},{"name":"city_pickers","dependencies":[]},{"name":"connectivity","dependencies":[]},{"name":"easy_contact_picker","dependencies":[]},{"name":"file_picker","dependencies":[]},{"name":"flutter_app_badger","dependencies":[]},{"name":"flutter_audio_recorder","dependencies":[]},{"name":"flutter_bugly","dependencies":[]},{"name":"flutter_facebook_login","dependencies":[]},{"name":"flutter_ijkplayer","dependencies":[]},{"name":"flutter_inapp_purchase","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_native_image","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_qr_reader","dependencies":["image_picker"]},{"name":"flutter_webview_plugin","dependencies":[]},{"name":"fluwx_no_pay","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"google_maps_flutter","dependencies":[]},{"name":"image_cropper","dependencies":[]},{"name":"image_gallery_saver","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"jpush_flutter","dependencies":[]},{"name":"keyboard_utils","dependencies":[]},{"name":"location","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"multi_image_picker","dependencies":[]},{"name":"open_file","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"photo_manager","dependencies":[]},{"name":"receive_sharing_intent","dependencies":[]},{"name":"share","dependencies":[]},{"name":"share_extend","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":[]},{"name":"video_player","dependencies":[]},{"name":"video_thumbnail","dependencies":[]},{"name":"wifi_info_plugin","dependencies":[]}]} \ No newline at end of file +{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"agora_rtc_engine","dependencies":[]},{"name":"amap_location","dependencies":[]},{"name":"android_intent","dependencies":[]},{"name":"app_installer","dependencies":[]},{"name":"apple_sign_in","dependencies":[]},{"name":"audioplayer","dependencies":[]},{"name":"auto_orientation","dependencies":[]},{"name":"city_pickers","dependencies":[]},{"name":"connectivity","dependencies":[]},{"name":"device_info","dependencies":[]},{"name":"easy_contact_picker","dependencies":[]},{"name":"file_picker","dependencies":[]},{"name":"flutter_app_badger","dependencies":[]},{"name":"flutter_audio_recorder","dependencies":[]},{"name":"flutter_bugly","dependencies":[]},{"name":"flutter_facebook_login","dependencies":[]},{"name":"flutter_ijkplayer","dependencies":[]},{"name":"flutter_inapp_purchase","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_native_image","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_qr_reader","dependencies":["image_picker"]},{"name":"flutter_webview_plugin","dependencies":[]},{"name":"fluwx_no_pay","dependencies":[]},{"name":"geolocator","dependencies":["google_api_availability","location_permissions"]},{"name":"google_api_availability","dependencies":[]},{"name":"google_maps_flutter","dependencies":[]},{"name":"image_cropper","dependencies":[]},{"name":"image_gallery_saver","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"jpush_flutter","dependencies":[]},{"name":"keyboard_utils","dependencies":[]},{"name":"location","dependencies":[]},{"name":"location_permissions","dependencies":[]},{"name":"multi_image_picker","dependencies":[]},{"name":"open_file","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"photo_manager","dependencies":[]},{"name":"receive_sharing_intent","dependencies":[]},{"name":"share","dependencies":[]},{"name":"share_extend","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":[]},{"name":"video_player","dependencies":[]},{"name":"video_thumbnail","dependencies":[]},{"name":"wifi_info_plugin","dependencies":[]}]} \ No newline at end of file diff --git a/lib/chat/group_chat_view.dart b/lib/chat/group_chat_view.dart index 491faa9..8d6a1ff 100644 --- a/lib/chat/group_chat_view.dart +++ b/lib/chat/group_chat_view.dart @@ -495,7 +495,7 @@ class _GroupChatPageState extends State { itemPositionsListener: itemPositionListener, padding: EdgeInsets.all(8.0), reverse: true, -// hitCallback: hideKeyBoard, + hitCallback: hideKeyBoard, )), ); } diff --git a/lib/data/UserData.dart b/lib/data/UserData.dart index 21c800a..1d39edb 100644 --- a/lib/data/UserData.dart +++ b/lib/data/UserData.dart @@ -64,6 +64,8 @@ class UserData { int homemainIndex = 0; String currentCity = ''; + String deviceLanguageCode; + Map toJson() { Map json = new Map(); json['language'] = language; diff --git a/lib/home/homeMain.dart b/lib/home/homeMain.dart index 53da171..506ea8f 100644 --- a/lib/home/homeMain.dart +++ b/lib/home/homeMain.dart @@ -174,7 +174,7 @@ class _HomeMainState extends State { postContact(null); postLoaction(); locationSchedule(); - + HttpUtil().saveMobileInfo(); WidgetsBinding.instance.addPostFrameCallback((_) { VersionUtils.versionUpdate(context); ReceiveShareFile.start(); diff --git a/lib/main.dart b/lib/main.dart index 5b9ff40..98f3866 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -405,6 +405,7 @@ class _MyAppState extends State with WidgetsBindingObserver { final String lang = deviceLocale != null ? deviceLocale.toString() : ""; print('#### fl: $lang'); + UserData().deviceLanguageCode = deviceLocale.toString(); //设置设备语言 if (language.containsKey(deviceLocale.toString())) UserData().deviceLanguage = diff --git a/lib/utils/HttpUtil.dart b/lib/utils/HttpUtil.dart index 86d44dd..287e14d 100644 --- a/lib/utils/HttpUtil.dart +++ b/lib/utils/HttpUtil.dart @@ -24,6 +24,7 @@ import 'package:chat/utils/local_notification_util.dart'; import 'package:chat/utils/sp_utils.dart'; import 'package:chat/utils/sql_util.dart'; import 'package:chat/utils/user_info_table.dart'; +import 'package:device_info/device_info.dart'; import 'dart:core'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; @@ -1417,4 +1418,33 @@ class HttpUtil { FriendListMgr().checkFromServer(resData['data']); } } + + + + //保存设备名称和编码 + saveMobileInfo() async { +String mobileType = ''; + DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); + if (Platform.isAndroid) { + AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; + mobileType = androidInfo.model; + print('Running on ${androidInfo.model}'); // e.g. "Moto G (4)" + } else if (Platform.isIOS) { + IosDeviceInfo iosInfo = await deviceInfo.iosInfo; + mobileType = iosInfo.utsname.machine; + } + + Map data = { + "userId": UserData().basicInfo.userId, + }; + data['sign'] = TokenMgr().getSign(data); + data['model'] = mobileType; + data['coding'] = UserData().deviceLanguageCode; + + Response res = + await HttpUtil().post('user/save/modelAndCoding', data: data); + + Map resData = res.data; + print(resData); + } } diff --git a/pubspec.lock b/pubspec.lock index 1ef9686..40911db 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -259,6 +259,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.2.9" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.4.2+1" dio: dependency: "direct main" description: @@ -919,9 +926,11 @@ packages: scrollable_positioned_list: dependency: "direct main" description: - name: scrollable_positioned_list - url: "https://pub.flutter-io.cn" - source: hosted + path: "." + ref: HEAD + resolved-ref: "6ac696b0550694de0eac3f4c30956e21a6dad748" + url: "https://github.com/KerwinZheng/scrollable_positioned_list.git" + source: git version: "0.1.2" share: dependency: "direct main" diff --git a/pubspec.yaml b/pubspec.yaml index a0f7a8b..cb0f3d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -177,7 +177,10 @@ dependencies: share_extend: ^1.1.1 #多图片选择 multi_image_picker: ^4.6.4 - scrollable_positioned_list: ^0.1.2 + scrollable_positioned_list: + git: https://github.com/KerwinZheng/scrollable_positioned_list.git + #设备信息 + device_info: ^0.4.2+1 dev_dependencies: flutter_test: