Showing
31 changed files
with
651 additions
and
205 deletions
| @@ -43,8 +43,8 @@ android { | @@ -43,8 +43,8 @@ android { | ||
| 43 | applicationId "com.naji.one_key" | 43 | applicationId "com.naji.one_key" |
| 44 | minSdkVersion 21 | 44 | minSdkVersion 21 |
| 45 | targetSdkVersion 28 | 45 | targetSdkVersion 28 |
| 46 | - versionCode flutterVersionCode.toInteger() | ||
| 47 | - versionName flutterVersionName | 46 | + versionCode 7 |
| 47 | + versionName "1.0.7" | ||
| 48 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 48 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 49 | 49 | ||
| 50 | ndk { | 50 | ndk { |
| @@ -6,6 +6,10 @@ | @@ -6,6 +6,10 @@ | ||
| 6 | In most cases you can leave this as-is, but you if you want to provide | 6 | In most cases you can leave this as-is, but you if you want to provide |
| 7 | additional functionality it is fine to subclass or reimplement | 7 | additional functionality it is fine to subclass or reimplement |
| 8 | FlutterApplication and put your custom class here. --> | 8 | FlutterApplication and put your custom class here. --> |
| 9 | + | ||
| 10 | + <uses-permission android:name="android.permission.READ_CONTACTS" /> | ||
| 11 | + <uses-permission android:name="android.permission.WRITE_CONTACTS" /> | ||
| 12 | + | ||
| 9 | <application | 13 | <application |
| 10 | android:name="io.flutter.app.FlutterApplication" | 14 | android:name="io.flutter.app.FlutterApplication" |
| 11 | android:label="一键订" | 15 | android:label="一键订" |
| @@ -40,5 +44,6 @@ | @@ -40,5 +44,6 @@ | ||
| 40 | <meta-data | 44 | <meta-data |
| 41 | android:name="flutterEmbedding" | 45 | android:name="flutterEmbedding" |
| 42 | android:value="2" /> | 46 | android:value="2" /> |
| 47 | + | ||
| 43 | </application> | 48 | </application> |
| 44 | </manifest> | 49 | </manifest> |
android/settings_aar.gradle
0 → 100644
| 1 | +include ':app' |
| @@ -6,6 +6,10 @@ PODS: | @@ -6,6 +6,10 @@ PODS: | ||
| 6 | - Reachability | 6 | - Reachability |
| 7 | - connectivity_macos (0.0.1): | 7 | - connectivity_macos (0.0.1): |
| 8 | - Flutter | 8 | - Flutter |
| 9 | + - contacts_service (0.2.2): | ||
| 10 | + - Flutter | ||
| 11 | + - device_info (0.0.1): | ||
| 12 | + - Flutter | ||
| 9 | - Flutter (1.0.0) | 13 | - Flutter (1.0.0) |
| 10 | - flutter_statusbarcolor (0.0.1): | 14 | - flutter_statusbarcolor (0.0.1): |
| 11 | - Flutter | 15 | - Flutter |
| @@ -47,12 +51,20 @@ PODS: | @@ -47,12 +51,20 @@ PODS: | ||
| 47 | - Flutter | 51 | - Flutter |
| 48 | - url_launcher_web (0.0.1): | 52 | - url_launcher_web (0.0.1): |
| 49 | - Flutter | 53 | - Flutter |
| 54 | +<<<<<<< HEAD | ||
| 50 | - WechatOpenSDK (1.8.6.2) | 55 | - WechatOpenSDK (1.8.6.2) |
| 56 | +======= | ||
| 57 | + - webview_flutter (0.0.1): | ||
| 58 | + - Flutter | ||
| 59 | + - WechatOpenSDK (1.8.7.1) | ||
| 60 | +>>>>>>> dev | ||
| 51 | 61 | ||
| 52 | DEPENDENCIES: | 62 | DEPENDENCIES: |
| 53 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | 63 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) |
| 54 | - connectivity (from `.symlinks/plugins/connectivity/ios`) | 64 | - connectivity (from `.symlinks/plugins/connectivity/ios`) |
| 55 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) | 65 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) |
| 66 | + - contacts_service (from `.symlinks/plugins/contacts_service/ios`) | ||
| 67 | + - device_info (from `.symlinks/plugins/device_info/ios`) | ||
| 56 | - Flutter (from `Flutter`) | 68 | - Flutter (from `Flutter`) |
| 57 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 69 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| 58 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) | 70 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) |
| @@ -69,6 +81,7 @@ DEPENDENCIES: | @@ -69,6 +81,7 @@ DEPENDENCIES: | ||
| 69 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) | 81 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) |
| 70 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) | 82 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) |
| 71 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) | 83 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) |
| 84 | + - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) | ||
| 72 | 85 | ||
| 73 | SPEC REPOS: | 86 | SPEC REPOS: |
| 74 | https://github.com/CocoaPods/Specs.git: | 87 | https://github.com/CocoaPods/Specs.git: |
| @@ -85,6 +98,10 @@ EXTERNAL SOURCES: | @@ -85,6 +98,10 @@ EXTERNAL SOURCES: | ||
| 85 | :path: ".symlinks/plugins/connectivity/ios" | 98 | :path: ".symlinks/plugins/connectivity/ios" |
| 86 | connectivity_macos: | 99 | connectivity_macos: |
| 87 | :path: ".symlinks/plugins/connectivity_macos/ios" | 100 | :path: ".symlinks/plugins/connectivity_macos/ios" |
| 101 | + contacts_service: | ||
| 102 | + :path: ".symlinks/plugins/contacts_service/ios" | ||
| 103 | + device_info: | ||
| 104 | + :path: ".symlinks/plugins/device_info/ios" | ||
| 88 | Flutter: | 105 | Flutter: |
| 89 | :path: Flutter | 106 | :path: Flutter |
| 90 | flutter_statusbarcolor: | 107 | flutter_statusbarcolor: |
| @@ -117,11 +134,15 @@ EXTERNAL SOURCES: | @@ -117,11 +134,15 @@ EXTERNAL SOURCES: | ||
| 117 | :path: ".symlinks/plugins/url_launcher_macos/ios" | 134 | :path: ".symlinks/plugins/url_launcher_macos/ios" |
| 118 | url_launcher_web: | 135 | url_launcher_web: |
| 119 | :path: ".symlinks/plugins/url_launcher_web/ios" | 136 | :path: ".symlinks/plugins/url_launcher_web/ios" |
| 137 | + webview_flutter: | ||
| 138 | + :path: ".symlinks/plugins/webview_flutter/ios" | ||
| 120 | 139 | ||
| 121 | SPEC CHECKSUMS: | 140 | SPEC CHECKSUMS: |
| 122 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c | 141 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c |
| 123 | connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 | 142 | connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 |
| 124 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 | 143 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 |
| 144 | + contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca | ||
| 145 | + device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | ||
| 125 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | 146 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec |
| 126 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 147 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| 127 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b | 148 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b |
| @@ -142,7 +163,12 @@ SPEC CHECKSUMS: | @@ -142,7 +163,12 @@ SPEC CHECKSUMS: | ||
| 142 | url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 | 163 | url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 |
| 143 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 | 164 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 |
| 144 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c | 165 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c |
| 166 | +<<<<<<< HEAD | ||
| 145 | WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a | 167 | WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a |
| 168 | +======= | ||
| 169 | + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 | ||
| 170 | + WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | ||
| 171 | +>>>>>>> dev | ||
| 146 | 172 | ||
| 147 | PODFILE CHECKSUM: a5c9f5cbedb217afa5108d75ed888500ab689803 | 173 | PODFILE CHECKSUM: a5c9f5cbedb217afa5108d75ed888500ab689803 |
| 148 | 174 |
| @@ -383,7 +383,7 @@ | @@ -383,7 +383,7 @@ | ||
| 383 | CLANG_ENABLE_MODULES = YES; | 383 | CLANG_ENABLE_MODULES = YES; |
| 384 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 384 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 385 | CODE_SIGN_STYLE = Manual; | 385 | CODE_SIGN_STYLE = Manual; |
| 386 | - CURRENT_PROJECT_VERSION = 3; | 386 | + CURRENT_PROJECT_VERSION = 8; |
| 387 | DEVELOPMENT_TEAM = 8J59HM8B82; | 387 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 388 | ENABLE_BITCODE = NO; | 388 | ENABLE_BITCODE = NO; |
| 389 | FRAMEWORK_SEARCH_PATHS = ( | 389 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -396,7 +396,7 @@ | @@ -396,7 +396,7 @@ | ||
| 396 | "$(inherited)", | 396 | "$(inherited)", |
| 397 | "$(PROJECT_DIR)/Flutter", | 397 | "$(PROJECT_DIR)/Flutter", |
| 398 | ); | 398 | ); |
| 399 | - MARKETING_VERSION = 1.0.3; | 399 | + MARKETING_VERSION = 1.0.8; |
| 400 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 400 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 401 | PRODUCT_NAME = "一键订"; | 401 | PRODUCT_NAME = "一键订"; |
| 402 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; | 402 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; |
| @@ -526,7 +526,7 @@ | @@ -526,7 +526,7 @@ | ||
| 526 | CLANG_ENABLE_MODULES = YES; | 526 | CLANG_ENABLE_MODULES = YES; |
| 527 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 527 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 528 | CODE_SIGN_STYLE = Manual; | 528 | CODE_SIGN_STYLE = Manual; |
| 529 | - CURRENT_PROJECT_VERSION = 3; | 529 | + CURRENT_PROJECT_VERSION = 8; |
| 530 | DEVELOPMENT_TEAM = 8J59HM8B82; | 530 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 531 | ENABLE_BITCODE = NO; | 531 | ENABLE_BITCODE = NO; |
| 532 | FRAMEWORK_SEARCH_PATHS = ( | 532 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -539,7 +539,7 @@ | @@ -539,7 +539,7 @@ | ||
| 539 | "$(inherited)", | 539 | "$(inherited)", |
| 540 | "$(PROJECT_DIR)/Flutter", | 540 | "$(PROJECT_DIR)/Flutter", |
| 541 | ); | 541 | ); |
| 542 | - MARKETING_VERSION = 1.0.3; | 542 | + MARKETING_VERSION = 1.0.8; |
| 543 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 543 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 544 | PRODUCT_NAME = "一键订"; | 544 | PRODUCT_NAME = "一键订"; |
| 545 | PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile"; | 545 | PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile"; |
| @@ -558,7 +558,7 @@ | @@ -558,7 +558,7 @@ | ||
| 558 | CLANG_ENABLE_MODULES = YES; | 558 | CLANG_ENABLE_MODULES = YES; |
| 559 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 559 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 560 | CODE_SIGN_STYLE = Manual; | 560 | CODE_SIGN_STYLE = Manual; |
| 561 | - CURRENT_PROJECT_VERSION = 3; | 561 | + CURRENT_PROJECT_VERSION = 8; |
| 562 | DEVELOPMENT_TEAM = 8J59HM8B82; | 562 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 563 | ENABLE_BITCODE = NO; | 563 | ENABLE_BITCODE = NO; |
| 564 | FRAMEWORK_SEARCH_PATHS = ( | 564 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -571,7 +571,7 @@ | @@ -571,7 +571,7 @@ | ||
| 571 | "$(inherited)", | 571 | "$(inherited)", |
| 572 | "$(PROJECT_DIR)/Flutter", | 572 | "$(PROJECT_DIR)/Flutter", |
| 573 | ); | 573 | ); |
| 574 | - MARKETING_VERSION = 1.0.3; | 574 | + MARKETING_VERSION = 1.0.8; |
| 575 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 575 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 576 | PRODUCT_NAME = "一键订"; | 576 | PRODUCT_NAME = "一键订"; |
| 577 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; | 577 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; |
| @@ -2,8 +2,6 @@ | @@ -2,8 +2,6 @@ | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | <plist version="1.0"> | 3 | <plist version="1.0"> |
| 4 | <dict> | 4 | <dict> |
| 5 | - <key></key> | ||
| 6 | - <string></string> | ||
| 7 | <key>CFBundleDevelopmentRegion</key> | 5 | <key>CFBundleDevelopmentRegion</key> |
| 8 | <string>$(DEVELOPMENT_LANGUAGE)</string> | 6 | <string>$(DEVELOPMENT_LANGUAGE)</string> |
| 9 | <key>CFBundleDisplayName</key> | 7 | <key>CFBundleDisplayName</key> |
| @@ -84,5 +82,7 @@ | @@ -84,5 +82,7 @@ | ||
| 84 | </array> | 82 | </array> |
| 85 | <key>UIViewControllerBasedStatusBarAppearance</key> | 83 | <key>UIViewControllerBasedStatusBarAppearance</key> |
| 86 | <false/> | 84 | <false/> |
| 85 | + <key>io.flutter.embedded_views_preview</key> | ||
| 86 | + <true/> | ||
| 87 | </dict> | 87 | </dict> |
| 88 | </plist> | 88 | </plist> |
| @@ -74,7 +74,7 @@ class MyAppState extends State<MyApp>{ | @@ -74,7 +74,7 @@ class MyAppState extends State<MyApp>{ | ||
| 74 | appId: "wx85aa3cdd0f791e65", | 74 | appId: "wx85aa3cdd0f791e65", |
| 75 | doOnAndroid: true, | 75 | doOnAndroid: true, |
| 76 | doOnIOS: true, | 76 | doOnIOS: true, |
| 77 | - universalLink: "https://xt04.colorcun.com/link/"); | 77 | + universalLink: "https://xt04.colorcun.com/link/OneKey/"); |
| 78 | var result = await isWeChatInstalled; | 78 | var result = await isWeChatInstalled; |
| 79 | LogUtil.v("is installed $result"); | 79 | LogUtil.v("is installed $result"); |
| 80 | } | 80 | } |
| @@ -2,13 +2,14 @@ | @@ -2,13 +2,14 @@ | ||
| 2 | * 更新版本 | 2 | * 更新版本 |
| 3 | */ | 3 | */ |
| 4 | class Version{ | 4 | class Version{ |
| 5 | - String version;//更新版本号 | 5 | + String name;//更新版本号 |
| 6 | + String version;//构建版本号 | ||
| 6 | String file_url;//安装包下载地址 | 7 | String file_url;//安装包下载地址 |
| 7 | String content;//更新内容 | 8 | String content;//更新内容 |
| 8 | 9 | ||
| 9 | Version(); | 10 | Version(); |
| 10 | 11 | ||
| 11 | - factory Version.fromJson(Map<String,dynamic> json)=>Version()..version=json["version"]..file_url=json["file_url"]..content=json["content"]; | 12 | + factory Version.fromJson(Map<String,dynamic> json)=>Version()..name=json["name"]..version=json["version"]..file_url=json["file_url"]..content=json["content"]; |
| 12 | 13 | ||
| 13 | - Map<String,dynamic> toJson()=><String,dynamic>{"version":version,"file_url":file_url,"content":content}; | 14 | + Map<String,dynamic> toJson()=><String,dynamic>{name:"name","version":version,"file_url":file_url,"content":content}; |
| 14 | } | 15 | } |
| @@ -170,60 +170,70 @@ class DioUtil { | @@ -170,60 +170,70 @@ class DioUtil { | ||
| 170 | Future<BaseResp<T>> request<T>(BuildContext context,String method, String path, | 170 | Future<BaseResp<T>> request<T>(BuildContext context,String method, String path, |
| 171 | {data, Options options, CancelToken cancelToken,bool showLoading=true}) async { | 171 | {data, Options options, CancelToken cancelToken,bool showLoading=true}) async { |
| 172 | bool connectivity=await Utils.checkConnectiviy(); | 172 | bool connectivity=await Utils.checkConnectiviy(); |
| 173 | - if(!connectivity){ | ||
| 174 | - Utils.showToast("网络错误,请稍后重试"); | ||
| 175 | - return new Future.error("网络错误,请稍后重试"); | ||
| 176 | - } | 173 | +// if(!connectivity){ |
| 174 | +// Utils.showToast("网络错误,请稍后重试"); | ||
| 175 | +// return new Future.error("网络错误,请稍后重试"); | ||
| 176 | +// } | ||
| 177 | if(showLoading)Loading.showLoading(context); | 177 | if(showLoading)Loading.showLoading(context); |
| 178 | - Response response = await _dio.request(path, | ||
| 179 | - data: data, | ||
| 180 | - options: _checkOptions(method, options), | ||
| 181 | - cancelToken: cancelToken); | ||
| 182 | - _printHttpLog(response); | ||
| 183 | - String _status; | ||
| 184 | - int _code; | ||
| 185 | - String _msg; | ||
| 186 | - T _data; | ||
| 187 | - if (response.statusCode == HttpStatus.ok || | ||
| 188 | - response.statusCode == HttpStatus.created) { | ||
| 189 | - try { | ||
| 190 | - if (response.data is Map) { | ||
| 191 | - _status = (response.data[_statusKey] is int) | ||
| 192 | - ? response.data[_statusKey].toString() | ||
| 193 | - : response.data[_statusKey]; | ||
| 194 | - _code = (response.data[_codeKey] is String) | ||
| 195 | - ? int.tryParse(response.data[_codeKey]) | ||
| 196 | - : response.data[_codeKey]; | ||
| 197 | - _msg = response.data[_msgKey]; | ||
| 198 | - _data = response.data[_dataKey]; | ||
| 199 | - } else { | ||
| 200 | - Map<String, dynamic> _dataMap = _decodeData(response); | ||
| 201 | - _status = (_dataMap[_statusKey] is int) | ||
| 202 | - ? _dataMap[_statusKey].toString() | ||
| 203 | - : _dataMap[_statusKey]; | ||
| 204 | - _code = (_dataMap[_codeKey] is String) | ||
| 205 | - ? int.tryParse(_dataMap[_codeKey]) | ||
| 206 | - : _dataMap[_codeKey]; | ||
| 207 | - _msg = _dataMap[_msgKey]; | ||
| 208 | - _data = _dataMap[_dataKey]; | 178 | + try{ |
| 179 | + Response response = await _dio.request(path, | ||
| 180 | + data: data, | ||
| 181 | + options: _checkOptions(method, options), | ||
| 182 | + cancelToken: cancelToken); | ||
| 183 | + _printHttpLog(response); | ||
| 184 | + String _status; | ||
| 185 | + int _code; | ||
| 186 | + String _msg; | ||
| 187 | + T _data; | ||
| 188 | + if (response.statusCode == HttpStatus.ok || | ||
| 189 | + response.statusCode == HttpStatus.created) { | ||
| 190 | + try { | ||
| 191 | + if (response.data is Map) { | ||
| 192 | + _status = (response.data[_statusKey] is int) | ||
| 193 | + ? response.data[_statusKey].toString() | ||
| 194 | + : response.data[_statusKey]; | ||
| 195 | + _code = (response.data[_codeKey] is String) | ||
| 196 | + ? int.tryParse(response.data[_codeKey]) | ||
| 197 | + : response.data[_codeKey]; | ||
| 198 | + _msg = response.data[_msgKey]; | ||
| 199 | + _data = response.data[_dataKey]; | ||
| 200 | + } else { | ||
| 201 | + Map<String, dynamic> _dataMap = _decodeData(response); | ||
| 202 | + _status = (_dataMap[_statusKey] is int) | ||
| 203 | + ? _dataMap[_statusKey].toString() | ||
| 204 | + : _dataMap[_statusKey]; | ||
| 205 | + _code = (_dataMap[_codeKey] is String) | ||
| 206 | + ? int.tryParse(_dataMap[_codeKey]) | ||
| 207 | + : _dataMap[_codeKey]; | ||
| 208 | + _msg = _dataMap[_msgKey]; | ||
| 209 | + _data = _dataMap[_dataKey]; | ||
| 210 | + } | ||
| 211 | + Loading.hideLoading(context); | ||
| 212 | + return new BaseResp(_status, _code, _msg, _data); | ||
| 213 | + } catch (e) { | ||
| 214 | + Loading.hideLoading(context); | ||
| 215 | + return new Future.error(new DioError( | ||
| 216 | + response: response, | ||
| 217 | + message: "data parsing exception...", | ||
| 218 | + type: DioErrorType.RESPONSE, | ||
| 219 | + )); | ||
| 209 | } | 220 | } |
| 221 | + } | ||
| 222 | + Loading.hideLoading(context); | ||
| 223 | + return new Future.error(new DioError( | ||
| 224 | + response: response, | ||
| 225 | + message: "statusCode: $response.statusCode, service error", | ||
| 226 | + type: DioErrorType.RESPONSE, | ||
| 227 | + )); | ||
| 228 | + }on DioError catch(error){ | ||
| 229 | + if(showLoading){ | ||
| 210 | Loading.hideLoading(context); | 230 | Loading.hideLoading(context); |
| 211 | - return new BaseResp(_status, _code, _msg, _data); | ||
| 212 | - } catch (e) { | ||
| 213 | - Loading.hideLoading(context); | ||
| 214 | - return new Future.error(new DioError( | ||
| 215 | - response: response, | ||
| 216 | - message: "data parsing exception...", | ||
| 217 | - type: DioErrorType.RESPONSE, | ||
| 218 | - )); | ||
| 219 | } | 231 | } |
| 232 | + if(error is DioError &&error.type==DioErrorType.CONNECT_TIMEOUT){ | ||
| 233 | + Utils.showToast("网络链接超时,请稍后重试"); | ||
| 234 | + } | ||
| 235 | + throw error; | ||
| 220 | } | 236 | } |
| 221 | - Loading.hideLoading(context); | ||
| 222 | - return new Future.error(new DioError( | ||
| 223 | - response: response, | ||
| 224 | - message: "statusCode: $response.statusCode, service error", | ||
| 225 | - type: DioErrorType.RESPONSE, | ||
| 226 | - )); | ||
| 227 | } | 237 | } |
| 228 | 238 | ||
| 229 | /// Make http request with options. | 239 | /// Make http request with options. |
| @@ -14,4 +14,6 @@ class HttpUrl{ | @@ -14,4 +14,6 @@ class HttpUrl{ | ||
| 14 | static const String set_message_status="?service=Android.Advance.SetMessageStatus";//设置消息状态 | 14 | static const String set_message_status="?service=Android.Advance.SetMessageStatus";//设置消息状态 |
| 15 | static const String get_sms_content="?service=App.SendSMS.GetSmsContent";//获取短信内容 | 15 | static const String get_sms_content="?service=App.SendSMS.GetSmsContent";//获取短信内容 |
| 16 | static const String send_sms="?service=App.SendSMS.NewMessage";//发送短信 | 16 | static const String send_sms="?service=App.SendSMS.NewMessage";//发送短信 |
| 17 | + static const String check_update="http://xt03.colorcun.com/admin/api/compareversion?flat=3"; | ||
| 18 | + static const String upload_contact="?service=App.Seller.SaveCallRecord";//上传通讯录 | ||
| 17 | } | 19 | } |
| @@ -10,6 +10,7 @@ import 'package:one_key/models/message.dart'; | @@ -10,6 +10,7 @@ import 'package:one_key/models/message.dart'; | ||
| 10 | import 'package:one_key/pages/message/message_page.dart'; | 10 | import 'package:one_key/pages/message/message_page.dart'; |
| 11 | import 'package:one_key/pages/my/my_page.dart'; | 11 | import 'package:one_key/pages/my/my_page.dart'; |
| 12 | import 'package:one_key/pages/notebook/notebook_page.dart'; | 12 | import 'package:one_key/pages/notebook/notebook_page.dart'; |
| 13 | +import 'package:one_key/provider/contact_model.dart'; | ||
| 13 | import 'package:one_key/provider/message_dialog_model.dart'; | 14 | import 'package:one_key/provider/message_dialog_model.dart'; |
| 14 | import 'package:one_key/provider/message_model.dart'; | 15 | import 'package:one_key/provider/message_model.dart'; |
| 15 | import 'package:one_key/provider/my_model.dart'; | 16 | import 'package:one_key/provider/my_model.dart'; |
| @@ -78,7 +79,8 @@ class HomePageState extends State<HomePage>{ | @@ -78,7 +79,8 @@ class HomePageState extends State<HomePage>{ | ||
| 78 | // initXinge(); | 79 | // initXinge(); |
| 79 | WidgetsBinding.instance.addPostFrameCallback((_){ | 80 | WidgetsBinding.instance.addPostFrameCallback((_){ |
| 80 | if(widget.initialIndex==0)return; | 81 | if(widget.initialIndex==0)return; |
| 81 | - getUntreatedMessage(); | 82 | + ContactModel.getInstance().uploadLocalContact(context); |
| 83 | +// getUntreatedMessage(); | ||
| 82 | // UpdateModel updateModel=new UpdateModel(); | 84 | // UpdateModel updateModel=new UpdateModel(); |
| 83 | // updateModel.checkUpdate(context); | 85 | // updateModel.checkUpdate(context); |
| 84 | }); | 86 | }); |
| @@ -4,6 +4,7 @@ import 'package:one_key/pages/message/messsage_item.dart'; | @@ -4,6 +4,7 @@ import 'package:one_key/pages/message/messsage_item.dart'; | ||
| 4 | import 'package:one_key/provider/message_dialog_model.dart'; | 4 | import 'package:one_key/provider/message_dialog_model.dart'; |
| 5 | import 'package:one_key/provider/message_model.dart'; | 5 | import 'package:one_key/provider/message_model.dart'; |
| 6 | import 'package:one_key/provider/user_model.dart'; | 6 | import 'package:one_key/provider/user_model.dart'; |
| 7 | +import 'package:one_key/widgets/page_error.dart'; | ||
| 7 | import 'package:provider/provider.dart'; | 8 | import 'package:provider/provider.dart'; |
| 8 | import 'package:one_key/utils/event_bus.dart'; | 9 | import 'package:one_key/utils/event_bus.dart'; |
| 9 | 10 | ||
| @@ -52,21 +53,28 @@ class MessageLeftPageState extends State<MessageLeftPage> { | @@ -52,21 +53,28 @@ class MessageLeftPageState extends State<MessageLeftPage> { | ||
| 52 | @override | 53 | @override |
| 53 | Widget build(BuildContext context) { | 54 | Widget build(BuildContext context) { |
| 54 | // TODO: implement build | 55 | // TODO: implement build |
| 55 | - return Selector<MessageModel,List>( | ||
| 56 | - selector: (context,model)=>model.untreatedMsgs, | ||
| 57 | - builder: (context,messages,child){ | ||
| 58 | - return EasyRefresh.custom( | ||
| 59 | - controller: _controller, | ||
| 60 | - slivers: [ | ||
| 61 | - SliverList( | ||
| 62 | - delegate: | ||
| 63 | - SliverChildBuilderDelegate((BuildContext context, int index) { | ||
| 64 | - return MessageItem(messages[index]); | ||
| 65 | - },childCount: messages.length), | ||
| 66 | - ) | ||
| 67 | - ],onRefresh: () async { | ||
| 68 | - getUntreatedMessage(); | ||
| 69 | - },); | 56 | + return Consumer<MessageModel>( |
| 57 | + builder: (context,model,_){ | ||
| 58 | + if(!model.connect_timeout){ | ||
| 59 | + return Center( | ||
| 60 | + child: ErrorPage(callback: (){ | ||
| 61 | + getUntreatedMessage(); | ||
| 62 | + },), | ||
| 63 | + ); | ||
| 64 | + }else{ | ||
| 65 | + return EasyRefresh.custom( | ||
| 66 | + controller: _controller, | ||
| 67 | + slivers: [ | ||
| 68 | + SliverList( | ||
| 69 | + delegate: | ||
| 70 | + SliverChildBuilderDelegate((BuildContext context, int index) { | ||
| 71 | + return MessageItem(model.untreatedMsgs[index]); | ||
| 72 | + },childCount: model.untreatedMsgs.length), | ||
| 73 | + ) | ||
| 74 | + ],onRefresh: () async { | ||
| 75 | + getUntreatedMessage(); | ||
| 76 | + },); | ||
| 77 | + } | ||
| 70 | }, | 78 | }, |
| 71 | ); | 79 | ); |
| 72 | } | 80 | } |
| @@ -3,6 +3,7 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; | @@ -3,6 +3,7 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; | ||
| 3 | import 'package:one_key/pages/message/messsage_item.dart'; | 3 | import 'package:one_key/pages/message/messsage_item.dart'; |
| 4 | import 'package:one_key/provider/message_model.dart'; | 4 | import 'package:one_key/provider/message_model.dart'; |
| 5 | import 'package:one_key/provider/user_model.dart'; | 5 | import 'package:one_key/provider/user_model.dart'; |
| 6 | +import 'package:one_key/widgets/page_error.dart'; | ||
| 6 | import 'package:provider/provider.dart'; | 7 | import 'package:provider/provider.dart'; |
| 7 | 8 | ||
| 8 | class MessageRightPage extends StatefulWidget{ | 9 | class MessageRightPage extends StatefulWidget{ |
| @@ -47,26 +48,28 @@ class MessageRightPageState extends State<MessageRightPage>{ | @@ -47,26 +48,28 @@ class MessageRightPageState extends State<MessageRightPage>{ | ||
| 47 | @override | 48 | @override |
| 48 | Widget build(BuildContext context) { | 49 | Widget build(BuildContext context) { |
| 49 | // TODO: implement build | 50 | // TODO: implement build |
| 50 | - return Selector<MessageModel,List>( | ||
| 51 | - selector: (context,model)=>model.treatedMsgs, | ||
| 52 | - shouldRebuild: (pre,next)=>true, | ||
| 53 | - builder: (context,messages,child){ | ||
| 54 | - return EasyRefresh.custom( | ||
| 55 | - controller: _controller, | ||
| 56 | - slivers: [ | ||
| 57 | - SliverList( | ||
| 58 | - delegate: | ||
| 59 | - SliverChildBuilderDelegate((BuildContext context, int index) { | ||
| 60 | - return MessageItem(messages[index],isTreated: true,); | ||
| 61 | - },childCount: messages.length), | ||
| 62 | - ) | ||
| 63 | - ],onRefresh: () async { | ||
| 64 | - offset=1; | ||
| 65 | - getTreatedMessage(); | ||
| 66 | - },onLoad: () async { | ||
| 67 | - offset++; | ||
| 68 | - getTreatedMessage(); | ||
| 69 | - },); | 51 | + return Consumer<MessageModel>( |
| 52 | + builder: (context,model,_){ | ||
| 53 | + if(!model.connect_timeout){ | ||
| 54 | + return Center( | ||
| 55 | + child: ErrorPage(callback: (){ | ||
| 56 | + getTreatedMessage(); | ||
| 57 | + },), | ||
| 58 | + ); | ||
| 59 | + }else{ | ||
| 60 | + return EasyRefresh.custom( | ||
| 61 | + controller: _controller, | ||
| 62 | + slivers: [ | ||
| 63 | + SliverList( | ||
| 64 | + delegate: | ||
| 65 | + SliverChildBuilderDelegate((BuildContext context, int index) { | ||
| 66 | + return MessageItem(model.treatedMsgs[index],isTreated: true,); | ||
| 67 | + },childCount: model.treatedMsgs.length), | ||
| 68 | + ) | ||
| 69 | + ],onRefresh: () async { | ||
| 70 | + getTreatedMessage(); | ||
| 71 | + },); | ||
| 72 | + } | ||
| 70 | }, | 73 | }, |
| 71 | ); | 74 | ); |
| 72 | } | 75 | } |
| @@ -75,7 +75,7 @@ class MyPageState extends State<MyPage>{ | @@ -75,7 +75,7 @@ class MyPageState extends State<MyPage>{ | ||
| 75 | },), | 75 | },), |
| 76 | MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3,), | 76 | MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3,), |
| 77 | MyItem(title:"帮助与反馈",content:"",callback: (){ | 77 | MyItem(title:"帮助与反馈",content:"",callback: (){ |
| 78 | - Utils.goHelp(); | 78 | + Utils.goHelp(context); |
| 79 | },), | 79 | },), |
| 80 | MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3), | 80 | MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3), |
| 81 | GestureDetector( | 81 | GestureDetector( |
| 1 | +import 'package:dio/dio.dart'; | ||
| 1 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_easyrefresh/easy_refresh.dart'; | 3 | import 'package:flutter_easyrefresh/easy_refresh.dart'; |
| 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| @@ -11,6 +12,7 @@ import 'package:one_key/utils/utils.dart'; | @@ -11,6 +12,7 @@ import 'package:one_key/utils/utils.dart'; | ||
| 11 | import 'package:one_key/widgets/MyDivider.dart'; | 12 | import 'package:one_key/widgets/MyDivider.dart'; |
| 12 | import 'package:one_key/widgets/app_bar.dart'; | 13 | import 'package:one_key/widgets/app_bar.dart'; |
| 13 | import 'package:one_key/widgets/common_button.dart'; | 14 | import 'package:one_key/widgets/common_button.dart'; |
| 15 | +import 'package:one_key/widgets/page_error.dart'; | ||
| 14 | import 'package:provider/provider.dart'; | 16 | import 'package:provider/provider.dart'; |
| 15 | 17 | ||
| 16 | class NoteBookPage extends StatefulWidget { | 18 | class NoteBookPage extends StatefulWidget { |
| @@ -391,26 +393,33 @@ class NoteBookPageState extends State<NoteBookPage> { | @@ -391,26 +393,33 @@ class NoteBookPageState extends State<NoteBookPage> { | ||
| 391 | ), | 393 | ), |
| 392 | _buildListTitle(), | 394 | _buildListTitle(), |
| 393 | Expanded( | 395 | Expanded( |
| 394 | - child: Selector<NoteBookModel, List>( | ||
| 395 | - selector: (context, model) => model.notebooks, | ||
| 396 | - builder: (context, notebooks, child) { | ||
| 397 | - return EasyRefresh.custom( | ||
| 398 | - controller: _controller, | ||
| 399 | - slivers: [ | ||
| 400 | - SliverFixedExtentList( | ||
| 401 | - delegate: SliverChildBuilderDelegate( | ||
| 402 | - (BuildContext context, int index) { | ||
| 403 | - return NoteBookItem(notebooks[index], index); | ||
| 404 | - }, childCount: notebooks.length), | ||
| 405 | - itemExtent: ScreenUtil().setHeight(112), | ||
| 406 | - ) | ||
| 407 | - ], | ||
| 408 | - onRefresh: () async { | ||
| 409 | - _getReserveList(); | 396 | + child: Consumer<NoteBookModel>( |
| 397 | + builder: (context,model,_){ | ||
| 398 | + if(model.connect_timeout){ | ||
| 399 | + return Center( | ||
| 400 | + child: ErrorPage(callback: (){ | ||
| 401 | + _getReserveList(); | ||
| 402 | + },), | ||
| 403 | + ); | ||
| 404 | + }else{ | ||
| 405 | + return EasyRefresh.custom( | ||
| 406 | + controller: _controller, | ||
| 407 | + slivers: [ | ||
| 408 | + SliverFixedExtentList( | ||
| 409 | + delegate: SliverChildBuilderDelegate( | ||
| 410 | + (BuildContext context, int index) { | ||
| 411 | + return NoteBookItem(model.notebooks[index], index); | ||
| 412 | + }, childCount: model.notebooks.length), | ||
| 413 | + itemExtent: ScreenUtil().setHeight(112), | ||
| 414 | + ) | ||
| 415 | + ], | ||
| 416 | + onRefresh: () async { | ||
| 417 | + _getReserveList(); | ||
| 418 | + }, | ||
| 419 | + ); | ||
| 420 | + } | ||
| 410 | }, | 421 | }, |
| 411 | - ); | ||
| 412 | - }, | ||
| 413 | - )) | 422 | + )) |
| 414 | ], | 423 | ], |
| 415 | ), | 424 | ), |
| 416 | ); | 425 | ); |
lib/pages/webview/webview_page.dart
0 → 100644
| 1 | +import 'dart:async'; | ||
| 2 | +import 'dart:convert'; | ||
| 3 | + | ||
| 4 | +import 'package:flutter/material.dart'; | ||
| 5 | +import 'package:one_key/widgets/app_bar.dart'; | ||
| 6 | +import 'package:webview_flutter/webview_flutter.dart'; | ||
| 7 | + | ||
| 8 | +class WebViewPage extends StatefulWidget { | ||
| 9 | + | ||
| 10 | + @override | ||
| 11 | + _WebViewPageState createState() => _WebViewPageState(); | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +class _WebViewPageState extends State<WebViewPage> { | ||
| 15 | + final Completer<WebViewController> _controller = | ||
| 16 | + Completer<WebViewController>(); | ||
| 17 | + | ||
| 18 | + @override | ||
| 19 | + Widget build(BuildContext context) { | ||
| 20 | + return Scaffold( | ||
| 21 | + // We're using a Builder here so we have a context that is below the Scaffold | ||
| 22 | + // to allow calling Scaffold.of(context) so we can show a snackbar. | ||
| 23 | + appBar: AppBar( | ||
| 24 | + title: const Text('一键订'), | ||
| 25 | + // This drop down menu demonstrates that Flutter widgets can be shown over the web view. | ||
| 26 | + ), | ||
| 27 | + body: Builder(builder: (BuildContext context) { | ||
| 28 | + return WebView( | ||
| 29 | + initialUrl: "https://support.qq.com/product/152856", | ||
| 30 | + javascriptMode: JavascriptMode.unrestricted, | ||
| 31 | + onWebViewCreated: (WebViewController webViewController) { | ||
| 32 | + _controller.complete(webViewController); | ||
| 33 | + }, | ||
| 34 | + // TODO(iskakaushik): Remove this when collection literals makes it to stable. | ||
| 35 | + // ignore: prefer_collection_literals | ||
| 36 | + javascriptChannels: <JavascriptChannel>[ | ||
| 37 | + _toasterJavascriptChannel(context), | ||
| 38 | + ].toSet(), | ||
| 39 | + navigationDelegate: (NavigationRequest request) { | ||
| 40 | + if (request.url.startsWith('https://www.youtube.com/')) { | ||
| 41 | + print('blocking navigation to $request}'); | ||
| 42 | + return NavigationDecision.prevent; | ||
| 43 | + } | ||
| 44 | + print('allowing navigation to $request'); | ||
| 45 | + return NavigationDecision.navigate; | ||
| 46 | + }, | ||
| 47 | + onPageStarted: (String url) { | ||
| 48 | + print('Page started loading: $url'); | ||
| 49 | + }, | ||
| 50 | + onPageFinished: (String url) { | ||
| 51 | + print('Page finished loading: $url'); | ||
| 52 | + }, | ||
| 53 | + gestureNavigationEnabled: true, | ||
| 54 | + ); | ||
| 55 | + }), | ||
| 56 | + ); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + JavascriptChannel _toasterJavascriptChannel(BuildContext context) { | ||
| 60 | + return JavascriptChannel( | ||
| 61 | + name: 'Toaster', | ||
| 62 | + onMessageReceived: (JavascriptMessage message) { | ||
| 63 | + Scaffold.of(context).showSnackBar( | ||
| 64 | + SnackBar(content: Text(message.message)), | ||
| 65 | + ); | ||
| 66 | + }); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | +} |
lib/provider/contact_model.dart
0 → 100644
| 1 | +import 'dart:convert'; | ||
| 2 | +import 'dart:io'; | ||
| 3 | + | ||
| 4 | +import 'package:contacts_service/contacts_service.dart'; | ||
| 5 | +import 'package:dio/dio.dart'; | ||
| 6 | +import 'package:flutter/cupertino.dart'; | ||
| 7 | +import 'package:one_key/constant/constant.dart'; | ||
| 8 | +import 'package:one_key/net/base_resp.dart'; | ||
| 9 | +import 'package:one_key/net/dio_util.dart'; | ||
| 10 | +import 'package:one_key/net/http_url.dart'; | ||
| 11 | +import 'package:one_key/utils/log_util.dart'; | ||
| 12 | +import 'package:one_key/utils/misc.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 上传联系人 | ||
| 16 | + */ | ||
| 17 | +class ContactModel{ | ||
| 18 | + | ||
| 19 | + ContactModel._(); | ||
| 20 | + | ||
| 21 | + static ContactModel _instance; | ||
| 22 | + | ||
| 23 | + static ContactModel getInstance(){ | ||
| 24 | + if(_instance==null){ | ||
| 25 | + _instance=ContactModel._(); | ||
| 26 | + } | ||
| 27 | + return _instance; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + uploadLocalContact(BuildContext context) async { | ||
| 31 | + bool authority=await requestContactPermission(); | ||
| 32 | + if(authority){ | ||
| 33 | + Iterable<Contact> contacts=await ContactsService.getContacts(withThumbnails: false); | ||
| 34 | + List<Map<String,String>> callLogs=[]; | ||
| 35 | + LogUtil.v("length:${contacts.length}"); | ||
| 36 | + | ||
| 37 | + contacts.forEach((contact){ | ||
| 38 | + String phoneNum=""; | ||
| 39 | + if(contact.phones.isNotEmpty){ | ||
| 40 | + phoneNum=contact.phones.first.value.trim(); | ||
| 41 | + } | ||
| 42 | + Map<String,String> callLog={ | ||
| 43 | + "phoneNum":"$phoneNum", | ||
| 44 | + "sid":"154", | ||
| 45 | + "deviceId":"dhgajkhdgahghsdghdkgahd", | ||
| 46 | + "phoneDate":"${DateTime.now().millisecondsSinceEpoch}", | ||
| 47 | + "callType":"2", | ||
| 48 | + "callUser":"${contact.displayName}" | ||
| 49 | + }; | ||
| 50 | + callLogs.add(callLog); | ||
| 51 | + }); | ||
| 52 | + Map<String,String> params={ | ||
| 53 | + "data":jsonEncode(callLogs) | ||
| 54 | + }; | ||
| 55 | + BaseResp<String> baseResp = await DioUtil() | ||
| 56 | + .request<String>(context, Method.get, HttpUrl.upload_contact, | ||
| 57 | + data: params,options: Options(method: Method.post,contentType: ContentType.parse("application/x-www-form-urlencoded"))) | ||
| 58 | + .catchError((error) { | ||
| 59 | + print(error.toString()); | ||
| 60 | + }); | ||
| 61 | + if(baseResp!=null&&baseResp.code == Constant.status_success){ | ||
| 62 | + LogUtil.v("联系人上传成功:${contacts.length}条"); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | +} |
| @@ -52,7 +52,7 @@ class MessageDialogModel extends ChangeNotifier{ | @@ -52,7 +52,7 @@ class MessageDialogModel extends ChangeNotifier{ | ||
| 52 | .catchError((error) { | 52 | .catchError((error) { |
| 53 | print(error.toString()); | 53 | print(error.toString()); |
| 54 | }); | 54 | }); |
| 55 | - if (baseResp.code == Constant.status_success) { | 55 | + if (baseResp!=null&&baseResp.code == Constant.status_success) { |
| 56 | messages=baseResp.data.map<Message>((value){ | 56 | messages=baseResp.data.map<Message>((value){ |
| 57 | return Message.fromJson(value); | 57 | return Message.fromJson(value); |
| 58 | }).toList(); | 58 | }).toList(); |
| @@ -12,15 +12,21 @@ class MessageModel extends ChangeNotifier{ | @@ -12,15 +12,21 @@ class MessageModel extends ChangeNotifier{ | ||
| 12 | List<Message> untreatedMsgs=[];//未处理在线预订消息 | 12 | List<Message> untreatedMsgs=[];//未处理在线预订消息 |
| 13 | List<Message> treatedMsgs=[];//已处理在线预订消息 | 13 | List<Message> treatedMsgs=[];//已处理在线预订消息 |
| 14 | 14 | ||
| 15 | + bool connect_timeout=true; | ||
| 16 | + | ||
| 15 | //获取未处理在线预订消息 | 17 | //获取未处理在线预订消息 |
| 16 | getUntreatedMsg(BuildContext context,Map<String,String> params) async { | 18 | getUntreatedMsg(BuildContext context,Map<String,String> params) async { |
| 19 | + connect_timeout=true; | ||
| 20 | + notifyListeners(); | ||
| 17 | BaseResp<List> baseResp = await DioUtil() | 21 | BaseResp<List> baseResp = await DioUtil() |
| 18 | .request<List>(context, Method.get, HttpUrl.get_message_list, | 22 | .request<List>(context, Method.get, HttpUrl.get_message_list, |
| 19 | data: params) | 23 | data: params) |
| 20 | .catchError((error) { | 24 | .catchError((error) { |
| 21 | print(error.toString()); | 25 | print(error.toString()); |
| 26 | + connect_timeout=false; | ||
| 27 | + notifyListeners(); | ||
| 22 | }); | 28 | }); |
| 23 | - if (baseResp.code == Constant.status_success) { | 29 | + if (baseResp!=null&&baseResp.code == Constant.status_success) { |
| 24 | untreatedMsgs=baseResp.data.map<Message>((value){ | 30 | untreatedMsgs=baseResp.data.map<Message>((value){ |
| 25 | return Message.fromJson(value); | 31 | return Message.fromJson(value); |
| 26 | }).toList(); | 32 | }).toList(); |
| @@ -31,13 +37,17 @@ class MessageModel extends ChangeNotifier{ | @@ -31,13 +37,17 @@ class MessageModel extends ChangeNotifier{ | ||
| 31 | 37 | ||
| 32 | //获取未处理在线预订消息 | 38 | //获取未处理在线预订消息 |
| 33 | getTreatedMsg(BuildContext context,Map<String,String> params) async { | 39 | getTreatedMsg(BuildContext context,Map<String,String> params) async { |
| 40 | + connect_timeout=true; | ||
| 41 | + notifyListeners(); | ||
| 34 | BaseResp<List> baseResp = await DioUtil() | 42 | BaseResp<List> baseResp = await DioUtil() |
| 35 | .request<List>(context, Method.get, HttpUrl.get_message_list, | 43 | .request<List>(context, Method.get, HttpUrl.get_message_list, |
| 36 | data: params) | 44 | data: params) |
| 37 | .catchError((error) { | 45 | .catchError((error) { |
| 38 | print(error.toString()); | 46 | print(error.toString()); |
| 47 | + connect_timeout=false; | ||
| 48 | + notifyListeners(); | ||
| 39 | }); | 49 | }); |
| 40 | - if (baseResp.code == Constant.status_success) { | 50 | + if (baseResp!=null&&baseResp.code == Constant.status_success) { |
| 41 | if(params["offset"]=="0"){//第一页 | 51 | if(params["offset"]=="0"){//第一页 |
| 42 | treatedMsgs=baseResp.data.map<Message>((value){ | 52 | treatedMsgs=baseResp.data.map<Message>((value){ |
| 43 | return Message.fromJson(value); | 53 | return Message.fromJson(value); |
| @@ -14,14 +14,21 @@ class NoteBookModel extends ChangeNotifier{ | @@ -14,14 +14,21 @@ class NoteBookModel extends ChangeNotifier{ | ||
| 14 | 14 | ||
| 15 | String total="";//一天统计 | 15 | String total="";//一天统计 |
| 16 | 16 | ||
| 17 | + bool connect_timeout=false; | ||
| 18 | + | ||
| 17 | //获取已预订订单 | 19 | //获取已预订订单 |
| 18 | Future<List<Notebook>> getReserveList(BuildContext context,Map<String,String> params) async { | 20 | Future<List<Notebook>> getReserveList(BuildContext context,Map<String,String> params) async { |
| 21 | + connect_timeout=false; | ||
| 22 | + notifyListeners(); | ||
| 19 | BaseResp<List> baseResp = await DioUtil() | 23 | BaseResp<List> baseResp = await DioUtil() |
| 20 | .request<List>(context, Method.get, HttpUrl.get_reserve_list, | 24 | .request<List>(context, Method.get, HttpUrl.get_reserve_list, |
| 21 | data: params,showLoading: true) | 25 | data: params,showLoading: true) |
| 22 | .catchError((error) { | 26 | .catchError((error) { |
| 23 | print(error.toString()); | 27 | print(error.toString()); |
| 28 | + connect_timeout=true; | ||
| 29 | + notifyListeners(); | ||
| 24 | }); | 30 | }); |
| 31 | + if(baseResp==null)return null; | ||
| 25 | notebooks=[]; | 32 | notebooks=[]; |
| 26 | if (baseResp.code == Constant.status_success) { | 33 | if (baseResp.code == Constant.status_success) { |
| 27 | notebooks=baseResp.data.map<Notebook>((value){ | 34 | notebooks=baseResp.data.map<Notebook>((value){ |
| @@ -42,7 +49,7 @@ class NoteBookModel extends ChangeNotifier{ | @@ -42,7 +49,7 @@ class NoteBookModel extends ChangeNotifier{ | ||
| 42 | .catchError((error) { | 49 | .catchError((error) { |
| 43 | print(error.toString()); | 50 | print(error.toString()); |
| 44 | }); | 51 | }); |
| 45 | - if (baseResp.code == Constant.status_success) { | 52 | + if (baseResp!=null&&baseResp.code == Constant.status_success) { |
| 46 | int morning=int.parse(baseResp.data["morning"].toString()); | 53 | int morning=int.parse(baseResp.data["morning"].toString()); |
| 47 | int noon=int.parse(baseResp.data["noon"].toString()); | 54 | int noon=int.parse(baseResp.data["noon"].toString()); |
| 48 | int night=int.parse(baseResp.data["night"].toString()); | 55 | int night=int.parse(baseResp.data["night"].toString()); |
| 1 | +import 'dart:convert'; | ||
| 1 | import 'dart:io'; | 2 | import 'dart:io'; |
| 2 | import 'dart:math'; | 3 | import 'dart:math'; |
| 3 | 4 | ||
| 5 | +import 'package:dio/dio.dart'; | ||
| 4 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 6 | import 'package:install_plugin/install_plugin.dart'; | 8 | import 'package:install_plugin/install_plugin.dart'; |
| 9 | +import 'package:one_key/constant/constant.dart'; | ||
| 7 | import 'package:one_key/models/version.dart'; | 10 | import 'package:one_key/models/version.dart'; |
| 11 | +import 'package:one_key/net/base_resp.dart'; | ||
| 8 | import 'package:one_key/net/dio_util.dart'; | 12 | import 'package:one_key/net/dio_util.dart'; |
| 13 | +import 'package:one_key/net/http_url.dart'; | ||
| 14 | +import 'package:one_key/provider/user_model.dart'; | ||
| 9 | import 'package:one_key/res/colors.dart'; | 15 | import 'package:one_key/res/colors.dart'; |
| 16 | +import 'package:one_key/utils/log_util.dart'; | ||
| 17 | +import 'package:one_key/utils/utils.dart'; | ||
| 10 | import 'package:one_key/widgets/MyDivider.dart'; | 18 | import 'package:one_key/widgets/MyDivider.dart'; |
| 11 | import 'package:one_key/widgets/v_empty_view.dart'; | 19 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 12 | import 'package:path_provider/path_provider.dart'; | 20 | import 'package:path_provider/path_provider.dart'; |
| 13 | import 'package:permission_handler/permission_handler.dart'; | 21 | import 'package:permission_handler/permission_handler.dart'; |
| 22 | +import 'package:provider/provider.dart'; | ||
| 14 | 23 | ||
| 15 | class UpdateModel { | 24 | class UpdateModel { |
| 16 | int _progress; //下载进度 | 25 | int _progress; //下载进度 |
| 17 | Function _setState; | 26 | Function _setState; |
| 18 | //检查更新 | 27 | //检查更新 |
| 19 | - checkUpdate(BuildContext context) { | ||
| 20 | - Future.delayed(new Duration(milliseconds: 1000), () { | ||
| 21 | - if (Random().nextInt(10) > 0) { | 28 | + checkUpdate(BuildContext context) async { |
| 29 | + String deviceId = await Utils.getUUID(); | ||
| 30 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 31 | + int versionCode = await Utils.getCurrBuildNum(); | ||
| 32 | + String make="3"; | ||
| 33 | + if(Platform.isIOS)make="4"; | ||
| 34 | + Map<String, String> params = { | ||
| 35 | + "deviceId": deviceId, | ||
| 36 | + "sid": userModel.user.sellerid, | ||
| 37 | + "versionCode": versionCode.toString(), | ||
| 38 | + "flag":"4", | ||
| 39 | + "make":make,//3 android 4 ios | ||
| 40 | + }; | ||
| 41 | + BaseResp<List> baseResp = await DioUtil() | ||
| 42 | + .request<List>(context, Method.get, HttpUrl.check_update, data: params) | ||
| 43 | + .catchError((error) { | ||
| 44 | + print(error.toString()); | ||
| 45 | + Utils.showToast("当前已是最新版本"); | ||
| 46 | + }); | ||
| 47 | + if (baseResp.code == Constant.status_success) { | ||
| 48 | + LogUtil.v(baseResp.data); | ||
| 49 | + Map<String, dynamic> dataMap = baseResp.data[0]; | ||
| 50 | + if (int.parse(dataMap["version"].toString()) > versionCode) { | ||
| 22 | Version version = Version.fromJson({ | 51 | Version version = Version.fromJson({ |
| 23 | - "version": "v1.0.3", | ||
| 24 | - "file_url": | ||
| 25 | - "http://xt03.colorcun.com/uploads/20191105/67e38355c41528b24a97e9ac71a221ea.apk", | ||
| 26 | - "content": "1.bug修复;\n2.功能更新;" | 52 | + "name":dataMap["name"].toString(), |
| 53 | + "version": dataMap["version"].toString(), | ||
| 54 | + "file_url":dataMap["file_url"].toString(), | ||
| 55 | + "content": dataMap["content"].toString() | ||
| 27 | }); | 56 | }); |
| 28 | showUpdateDialog(context, version); | 57 | showUpdateDialog(context, version); |
| 58 | + }else{ | ||
| 59 | + Utils.showToast(baseResp.msg??"当前已是最新版本"); | ||
| 29 | } | 60 | } |
| 30 | - }); | 61 | + }else{ |
| 62 | + Utils.showToast(baseResp.msg??"当前已是最新版本"); | ||
| 63 | + } | ||
| 64 | +// if(Platform.isAndroid){ | ||
| 65 | +// | ||
| 66 | +// }else{ | ||
| 67 | +//// Response response=await DioUtil().getDio().get("http://itunes.apple.com/lookup?id=1510697490"); | ||
| 68 | +//// Map<String,dynamic> dataMap=jsonDecode(response.data); | ||
| 69 | +//// String version=((dataMap["results"] as List)[0] as Map)["version"] as String; | ||
| 70 | +//// String currVersion=await Utils.getCurrVersion(); | ||
| 71 | +//// if(version.compareTo(currVersion)>0){ | ||
| 72 | +//// Version version = Version.fromJson({ | ||
| 73 | +//// "version": "version", | ||
| 74 | +//// "file_url":dataMap["file_url"], | ||
| 75 | +//// "content": dataMap["content"] | ||
| 76 | +//// }); | ||
| 77 | +//// showUpdateDialog(context, version); | ||
| 78 | +//// } | ||
| 79 | +// } | ||
| 31 | } | 80 | } |
| 32 | 81 | ||
| 33 | //版本更新弹框 | 82 | //版本更新弹框 |
| @@ -54,7 +103,7 @@ class UpdateModel { | @@ -54,7 +103,7 @@ class UpdateModel { | ||
| 54 | children: <Widget>[ | 103 | children: <Widget>[ |
| 55 | Center( | 104 | Center( |
| 56 | child: Text( | 105 | child: Text( |
| 57 | - "${version.version}版本更新啦", | 106 | + "${version.name}版本更新啦", |
| 58 | style: TextStyle( | 107 | style: TextStyle( |
| 59 | fontSize: ScreenUtil().setSp(36), | 108 | fontSize: ScreenUtil().setSp(36), |
| 60 | color: MyColours.color_353535), | 109 | color: MyColours.color_353535), |
| @@ -90,7 +139,8 @@ class UpdateModel { | @@ -90,7 +139,8 @@ class UpdateModel { | ||
| 90 | ), | 139 | ), |
| 91 | ), | 140 | ), |
| 92 | ), | 141 | ), |
| 93 | - MyDivider(ScreenUtil().setWidth(1),ScreenUtil().setWidth(94)), | 142 | + MyDivider( |
| 143 | + ScreenUtil().setWidth(1), ScreenUtil().setWidth(94)), | ||
| 94 | Expanded( | 144 | Expanded( |
| 95 | child: GestureDetector( | 145 | child: GestureDetector( |
| 96 | onTap: () { | 146 | onTap: () { |
| @@ -117,16 +167,18 @@ class UpdateModel { | @@ -117,16 +167,18 @@ class UpdateModel { | ||
| 117 | ], | 167 | ], |
| 118 | ), | 168 | ), |
| 119 | ); | 169 | ); |
| 120 | - return Center(child: UnconstrainedBox( | ||
| 121 | - constrainedAxis: Axis.vertical, | ||
| 122 | - child: ConstrainedBox( | ||
| 123 | - constraints: BoxConstraints(maxWidth: ScreenUtil().setWidth(560)), | ||
| 124 | - child: DefaultTextStyle( | ||
| 125 | - style: TextStyle(decoration: TextDecoration.none), | ||
| 126 | - child: widget, | ||
| 127 | - ) | 170 | + return Center( |
| 171 | + child: UnconstrainedBox( | ||
| 172 | + constrainedAxis: Axis.vertical, | ||
| 173 | + child: ConstrainedBox( | ||
| 174 | + constraints: | ||
| 175 | + BoxConstraints(maxWidth: ScreenUtil().setWidth(560)), | ||
| 176 | + child: DefaultTextStyle( | ||
| 177 | + style: TextStyle(decoration: TextDecoration.none), | ||
| 178 | + child: widget, | ||
| 179 | + )), | ||
| 128 | ), | 180 | ), |
| 129 | - ),); | 181 | + ); |
| 130 | return AlertDialog( | 182 | return AlertDialog( |
| 131 | content: widget, | 183 | content: widget, |
| 132 | contentPadding: EdgeInsets.zero, | 184 | contentPadding: EdgeInsets.zero, |
| @@ -141,16 +193,17 @@ class UpdateModel { | @@ -141,16 +193,17 @@ class UpdateModel { | ||
| 141 | if (permissions[PermissionGroup.storage] == PermissionStatus.granted) { | 193 | if (permissions[PermissionGroup.storage] == PermissionStatus.granted) { |
| 142 | final dir = await getExternalStorageDirectory(); | 194 | final dir = await getExternalStorageDirectory(); |
| 143 | String savePath = dir.path + "/one_key"; | 195 | String savePath = dir.path + "/one_key"; |
| 144 | - Directory directory=new Directory(savePath); | ||
| 145 | - if(directory.existsSync()){//删除历史apk | ||
| 146 | - final List<FileSystemEntity> files=directory.listSync(); | ||
| 147 | - for(FileSystemEntity file in files){ | 196 | + Directory directory = new Directory(savePath); |
| 197 | + if (directory.existsSync()) { | ||
| 198 | + //删除历史apk | ||
| 199 | + final List<FileSystemEntity> files = directory.listSync(); | ||
| 200 | + for (FileSystemEntity file in files) { | ||
| 148 | file.deleteSync(); | 201 | file.deleteSync(); |
| 149 | } | 202 | } |
| 150 | } | 203 | } |
| 151 | showDownloadProgress(context); | 204 | showDownloadProgress(context); |
| 152 | DioUtil().download(file_url, savePath, onProgress: (received, total) { | 205 | DioUtil().download(file_url, savePath, onProgress: (received, total) { |
| 153 | - if(_progress!=100){ | 206 | + if (_progress != 100) { |
| 154 | int progress = ((received / total) * 100).round(); | 207 | int progress = ((received / total) * 100).round(); |
| 155 | _progress = progress; | 208 | _progress = progress; |
| 156 | _setState(() {}); | 209 | _setState(() {}); |
| @@ -171,7 +224,7 @@ class UpdateModel { | @@ -171,7 +224,7 @@ class UpdateModel { | ||
| 171 | builder: (ct) { | 224 | builder: (ct) { |
| 172 | return AlertDialog( | 225 | return AlertDialog( |
| 173 | content: StatefulBuilder(builder: (context, setState) { | 226 | content: StatefulBuilder(builder: (context, setState) { |
| 174 | - if (_progress==100) { | 227 | + if (_progress == 100) { |
| 175 | Navigator.of(ct).pop(); | 228 | Navigator.of(ct).pop(); |
| 176 | } | 229 | } |
| 177 | _setState = setState; | 230 | _setState = setState; |
| @@ -9,7 +9,6 @@ import 'package:one_key/net/base_resp.dart'; | @@ -9,7 +9,6 @@ import 'package:one_key/net/base_resp.dart'; | ||
| 9 | import 'package:one_key/net/dio_util.dart'; | 9 | import 'package:one_key/net/dio_util.dart'; |
| 10 | import 'package:one_key/net/http_url.dart'; | 10 | import 'package:one_key/net/http_url.dart'; |
| 11 | import 'package:one_key/res/colors.dart'; | 11 | import 'package:one_key/res/colors.dart'; |
| 12 | -import 'package:one_key/utils/log_util.dart'; | ||
| 13 | import 'package:one_key/utils/navigator_util.dart'; | 12 | import 'package:one_key/utils/navigator_util.dart'; |
| 14 | import 'package:one_key/utils/utils.dart'; | 13 | import 'package:one_key/utils/utils.dart'; |
| 15 | import 'package:one_key/widgets/MyDivider.dart'; | 14 | import 'package:one_key/widgets/MyDivider.dart'; |
| @@ -118,7 +117,7 @@ class UserModel with ChangeNotifier { | @@ -118,7 +117,7 @@ class UserModel with ChangeNotifier { | ||
| 118 | .catchError((error) { | 117 | .catchError((error) { |
| 119 | print(error.toString()); | 118 | print(error.toString()); |
| 120 | }); | 119 | }); |
| 121 | - if (baseResp.code == Constant.status_success) { | 120 | + if (baseResp!=null&&baseResp.code == Constant.status_success) { |
| 122 | } | 121 | } |
| 123 | } | 122 | } |
| 124 | 123 |
| @@ -8,6 +8,7 @@ import 'package:one_key/pages/detail/handle_online_page.dart'; | @@ -8,6 +8,7 @@ import 'package:one_key/pages/detail/handle_online_page.dart'; | ||
| 8 | import 'package:one_key/pages/detail/notebook_detail_page.dart'; | 8 | import 'package:one_key/pages/detail/notebook_detail_page.dart'; |
| 9 | import 'package:one_key/pages/sms/sms_page.dart'; | 9 | import 'package:one_key/pages/sms/sms_page.dart'; |
| 10 | import 'package:one_key/pages/table/select_table_page.dart'; | 10 | import 'package:one_key/pages/table/select_table_page.dart'; |
| 11 | +import 'package:one_key/pages/webview/webview_page.dart'; | ||
| 11 | import 'package:one_key/utils/fluro_convert_utils.dart'; | 12 | import 'package:one_key/utils/fluro_convert_utils.dart'; |
| 12 | import 'package:one_key/utils/log_util.dart'; | 13 | import 'package:one_key/utils/log_util.dart'; |
| 13 | 14 | ||
| @@ -66,3 +67,9 @@ var handleSmsHandler = new Handler( | @@ -66,3 +67,9 @@ var handleSmsHandler = new Handler( | ||
| 66 | return SmsPage(rid); | 67 | return SmsPage(rid); |
| 67 | }); | 68 | }); |
| 68 | 69 | ||
| 70 | +// 浏览网页 | ||
| 71 | +var handleWebviewHandler = new Handler( | ||
| 72 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 73 | + return WebViewPage(); | ||
| 74 | + }); | ||
| 75 | + |
| 1 | import 'package:fluro/fluro.dart'; | 1 | import 'package:fluro/fluro.dart'; |
| 2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 3 | import 'package:one_key/pages/login/login_page.dart'; | 3 | import 'package:one_key/pages/login/login_page.dart'; |
| 4 | +import 'package:one_key/utils/log_util.dart'; | ||
| 4 | 5 | ||
| 5 | import 'route_handles.dart'; | 6 | import 'route_handles.dart'; |
| 6 | 7 | ||
| @@ -12,6 +13,7 @@ class Routes { | @@ -12,6 +13,7 @@ class Routes { | ||
| 12 | static String select_table="/select_table";//选择桌位 | 13 | static String select_table="/select_table";//选择桌位 |
| 13 | static String invication="/invication";//邀请函 | 14 | static String invication="/invication";//邀请函 |
| 14 | static String sms="/sms";//发短信 | 15 | static String sms="/sms";//发短信 |
| 16 | + static String webview="/webview";//网页 | ||
| 15 | 17 | ||
| 16 | 18 | ||
| 17 | static void configureRoutes(Router router) { | 19 | static void configureRoutes(Router router) { |
| @@ -27,5 +29,6 @@ class Routes { | @@ -27,5 +29,6 @@ class Routes { | ||
| 27 | router.define(select_table, handler: handleSelectTableHandler); | 29 | router.define(select_table, handler: handleSelectTableHandler); |
| 28 | router.define(invication, handler: handleInvicationHandler); | 30 | router.define(invication, handler: handleInvicationHandler); |
| 29 | router.define(sms, handler: handleSmsHandler); | 31 | router.define(sms, handler: handleSmsHandler); |
| 32 | + router.define(webview, handler: handleWebviewHandler); | ||
| 30 | } | 33 | } |
| 31 | } | 34 | } |
| @@ -174,7 +174,7 @@ class DialogUtil { | @@ -174,7 +174,7 @@ class DialogUtil { | ||
| 174 | color: MyColours.color_2bb5b7), | 174 | color: MyColours.color_2bb5b7), |
| 175 | headerPadding: EdgeInsets.zero, | 175 | headerPadding: EdgeInsets.zero, |
| 176 | formatButtonVisible: false, | 176 | formatButtonVisible: false, |
| 177 | - centerHeaderTitle: true, | 177 | + centerHeaderTitle: false, |
| 178 | titleTextBuilder: (dateTime, _) { | 178 | titleTextBuilder: (dateTime, _) { |
| 179 | return dateTime.year.toString() + | 179 | return dateTime.year.toString() + |
| 180 | "年-" + | 180 | "年-" + |
| @@ -183,7 +183,7 @@ class DialogUtil { | @@ -183,7 +183,7 @@ class DialogUtil { | ||
| 183 | }, | 183 | }, |
| 184 | titleTextStyle: TextStyle( | 184 | titleTextStyle: TextStyle( |
| 185 | color: MyColours.color_ffffff, | 185 | color: MyColours.color_ffffff, |
| 186 | - fontSize: ScreenUtil().setSp(32)), | 186 | + fontSize: ScreenUtil().setSp(30)), |
| 187 | leftChevronIcon: | 187 | leftChevronIcon: |
| 188 | const Icon(Icons.chevron_left, color: Colors.white), | 188 | const Icon(Icons.chevron_left, color: Colors.white), |
| 189 | rightChevronIcon: | 189 | rightChevronIcon: |
lib/utils/misc.dart
0 → 100644
| 1 | +import 'package:flutter/services.dart'; | ||
| 2 | +import 'package:permission_handler/permission_handler.dart'; | ||
| 3 | + | ||
| 4 | + Future<bool> checkContactPermission() async { | ||
| 5 | + PermissionStatus permissionStatus = | ||
| 6 | + await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); | ||
| 7 | + if (permissionStatus == PermissionStatus.granted) { | ||
| 8 | + return true; | ||
| 9 | + } else { | ||
| 10 | + return false; | ||
| 11 | + } | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +Future<bool> requestContactPermission() async { | ||
| 15 | + final permissions = | ||
| 16 | + await PermissionHandler().requestPermissions([PermissionGroup.contacts]); | ||
| 17 | + | ||
| 18 | + if (permissions[PermissionGroup.contacts] == PermissionStatus.granted) { | ||
| 19 | + return true; | ||
| 20 | + } else { | ||
| 21 | + return false; | ||
| 22 | + } | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | + | ||
| 26 | +Future<bool> openSetting() { | ||
| 27 | + return PermissionHandler().openAppSettings(); | ||
| 28 | +} |
| @@ -58,4 +58,9 @@ class NavigatorUtil { | @@ -58,4 +58,9 @@ class NavigatorUtil { | ||
| 58 | static void goSmsPage(BuildContext context,String rid) { | 58 | static void goSmsPage(BuildContext context,String rid) { |
| 59 | _navigateTo(context,"${Routes.sms}?rid=$rid"); | 59 | _navigateTo(context,"${Routes.sms}?rid=$rid"); |
| 60 | } | 60 | } |
| 61 | + | ||
| 62 | + /// 浏览器 | ||
| 63 | + static void goWebviewPage(BuildContext context) { | ||
| 64 | + _navigateTo(context,"${Routes.webview}"); | ||
| 65 | + } | ||
| 61 | } | 66 | } |
| 1 | +import 'dart:io'; | ||
| 2 | + | ||
| 1 | import 'package:connectivity/connectivity.dart'; | 3 | import 'package:connectivity/connectivity.dart'; |
| 4 | +import 'package:device_info/device_info.dart'; | ||
| 2 | import 'package:extended_image/extended_image.dart'; | 5 | import 'package:extended_image/extended_image.dart'; |
| 3 | import 'package:flutter/cupertino.dart'; | 6 | import 'package:flutter/cupertino.dart'; |
| 4 | import 'package:flutter/material.dart'; | 7 | import 'package:flutter/material.dart'; |
| @@ -7,8 +10,10 @@ import 'package:fluttertoast/fluttertoast.dart'; | @@ -7,8 +10,10 @@ import 'package:fluttertoast/fluttertoast.dart'; | ||
| 7 | import 'package:flutter/services.dart'; | 10 | import 'package:flutter/services.dart'; |
| 8 | import 'package:fluwx/fluwx.dart'; | 11 | import 'package:fluwx/fluwx.dart'; |
| 9 | import 'package:one_key/utils/log_util.dart'; | 12 | import 'package:one_key/utils/log_util.dart'; |
| 13 | +import 'package:one_key/utils/navigator_util.dart'; | ||
| 10 | import 'package:package_info/package_info.dart'; | 14 | import 'package:package_info/package_info.dart'; |
| 11 | import 'package:url_launcher/url_launcher.dart'; | 15 | import 'package:url_launcher/url_launcher.dart'; |
| 16 | +import 'package:webview_flutter/webview_flutter.dart'; | ||
| 12 | 17 | ||
| 13 | class Utils { | 18 | class Utils { |
| 14 | static void showToast(String msg) { | 19 | static void showToast(String msg) { |
| @@ -78,13 +83,8 @@ class Utils { | @@ -78,13 +83,8 @@ class Utils { | ||
| 78 | } | 83 | } |
| 79 | 84 | ||
| 80 | //跳转拨打电话页面 | 85 | //跳转拨打电话页面 |
| 81 | - static goHelp() async { | ||
| 82 | - String url="https://support.qq.com/product/152856"; | ||
| 83 | - if(await canLaunch(url)){ | ||
| 84 | - await launch(url); | ||
| 85 | - }else{ | ||
| 86 | - LogUtil.e("Could not launch $url"); | ||
| 87 | - } | 86 | + static goHelp(BuildContext context) async { |
| 87 | + NavigatorUtil.goWebviewPage(context); | ||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | //获取应用版本昊 | 90 | //获取应用版本昊 |
| @@ -94,6 +94,24 @@ class Utils { | @@ -94,6 +94,24 @@ class Utils { | ||
| 94 | return version; | 94 | return version; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | + //获取当前构建版本号 | ||
| 98 | + static Future<int> getCurrBuildNum() async { | ||
| 99 | + PackageInfo packageInfo=await PackageInfo.fromPlatform(); | ||
| 100 | + return int.parse(packageInfo.buildNumber); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + //获取唯一标识 | ||
| 104 | + static Future<String> getUUID() async { | ||
| 105 | + DeviceInfoPlugin deviceInfoPlugin=DeviceInfoPlugin(); | ||
| 106 | + if(Platform.isAndroid){ | ||
| 107 | + AndroidDeviceInfo androidDeviceInfo=await deviceInfoPlugin.androidInfo; | ||
| 108 | + return androidDeviceInfo.androidId; | ||
| 109 | + }else{ | ||
| 110 | + IosDeviceInfo iosDeviceInfo=await deviceInfoPlugin.iosInfo; | ||
| 111 | + return iosDeviceInfo.identifierForVendor; | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + | ||
| 97 | //比较两个日期是否同一天 | 115 | //比较两个日期是否同一天 |
| 98 | static isOneDay(DateTime one,DateTime two){ | 116 | static isOneDay(DateTime one,DateTime two){ |
| 99 | if(one.year==two.year&&one.month==two.month&&one.day==two.day)return true; | 117 | if(one.year==two.year&&one.month==two.month&&one.day==two.day)return true; |
| @@ -26,8 +26,9 @@ class ErrorPageState extends State<ErrorPage>{ | @@ -26,8 +26,9 @@ class ErrorPageState extends State<ErrorPage>{ | ||
| 26 | height: double.infinity, | 26 | height: double.infinity, |
| 27 | child: Center( | 27 | child: Center( |
| 28 | child: Column( | 28 | child: Column( |
| 29 | + mainAxisSize: MainAxisSize.min, | ||
| 29 | children: <Widget>[ | 30 | children: <Widget>[ |
| 30 | - Image.asset("assets/bg_error",width: ScreenUtil().setWidth(311),height: ScreenUtil().setWidth(215),), | 31 | + Image.asset("assets/bg_error.png",width: ScreenUtil().setWidth(311),height: ScreenUtil().setWidth(215),), |
| 31 | VEmptyView(40), | 32 | VEmptyView(40), |
| 32 | Text("哎呀~网络好像走失了呢",style: TextStyle(fontSize: ScreenUtil().setSp(32),color: MyColours.color_353535),), | 33 | Text("哎呀~网络好像走失了呢",style: TextStyle(fontSize: ScreenUtil().setSp(32),color: MyColours.color_353535),), |
| 33 | VEmptyView(20), | 34 | VEmptyView(20), |
| @@ -63,7 +63,7 @@ packages: | @@ -63,7 +63,7 @@ packages: | ||
| 63 | name: build_daemon | 63 | name: build_daemon |
| 64 | url: "https://pub.flutter-io.cn" | 64 | url: "https://pub.flutter-io.cn" |
| 65 | source: hosted | 65 | source: hosted |
| 66 | - version: "2.1.3" | 66 | + version: "2.1.4" |
| 67 | build_resolvers: | 67 | build_resolvers: |
| 68 | dependency: transitive | 68 | dependency: transitive |
| 69 | description: | 69 | description: |
| @@ -98,14 +98,14 @@ packages: | @@ -98,14 +98,14 @@ packages: | ||
| 98 | name: built_value | 98 | name: built_value |
| 99 | url: "https://pub.flutter-io.cn" | 99 | url: "https://pub.flutter-io.cn" |
| 100 | source: hosted | 100 | source: hosted |
| 101 | - version: "7.0.9" | 101 | + version: "7.1.0" |
| 102 | cached_network_image: | 102 | cached_network_image: |
| 103 | dependency: "direct main" | 103 | dependency: "direct main" |
| 104 | description: | 104 | description: |
| 105 | name: cached_network_image | 105 | name: cached_network_image |
| 106 | url: "https://pub.flutter-io.cn" | 106 | url: "https://pub.flutter-io.cn" |
| 107 | source: hosted | 107 | source: hosted |
| 108 | - version: "2.0.0" | 108 | + version: "2.2.0+1" |
| 109 | charcode: | 109 | charcode: |
| 110 | dependency: transitive | 110 | dependency: transitive |
| 111 | description: | 111 | description: |
| @@ -120,13 +120,20 @@ packages: | @@ -120,13 +120,20 @@ packages: | ||
| 120 | url: "https://pub.flutter-io.cn" | 120 | url: "https://pub.flutter-io.cn" |
| 121 | source: hosted | 121 | source: hosted |
| 122 | version: "1.0.2" | 122 | version: "1.0.2" |
| 123 | + clock: | ||
| 124 | + dependency: transitive | ||
| 125 | + description: | ||
| 126 | + name: clock | ||
| 127 | + url: "https://pub.flutter-io.cn" | ||
| 128 | + source: hosted | ||
| 129 | + version: "1.0.1" | ||
| 123 | code_builder: | 130 | code_builder: |
| 124 | dependency: transitive | 131 | dependency: transitive |
| 125 | description: | 132 | description: |
| 126 | name: code_builder | 133 | name: code_builder |
| 127 | url: "https://pub.flutter-io.cn" | 134 | url: "https://pub.flutter-io.cn" |
| 128 | source: hosted | 135 | source: hosted |
| 129 | - version: "3.2.1" | 136 | + version: "3.4.1" |
| 130 | collection: | 137 | collection: |
| 131 | dependency: transitive | 138 | dependency: transitive |
| 132 | description: | 139 | description: |
| @@ -140,21 +147,35 @@ packages: | @@ -140,21 +147,35 @@ packages: | ||
| 140 | name: connectivity | 147 | name: connectivity |
| 141 | url: "https://pub.flutter-io.cn" | 148 | url: "https://pub.flutter-io.cn" |
| 142 | source: hosted | 149 | source: hosted |
| 143 | - version: "0.4.8+2" | 150 | + version: "0.4.9+2" |
| 151 | + connectivity_for_web: | ||
| 152 | + dependency: transitive | ||
| 153 | + description: | ||
| 154 | + name: connectivity_for_web | ||
| 155 | + url: "https://pub.flutter-io.cn" | ||
| 156 | + source: hosted | ||
| 157 | + version: "0.3.1+2" | ||
| 144 | connectivity_macos: | 158 | connectivity_macos: |
| 145 | dependency: transitive | 159 | dependency: transitive |
| 146 | description: | 160 | description: |
| 147 | name: connectivity_macos | 161 | name: connectivity_macos |
| 148 | url: "https://pub.flutter-io.cn" | 162 | url: "https://pub.flutter-io.cn" |
| 149 | source: hosted | 163 | source: hosted |
| 150 | - version: "0.1.0+2" | 164 | + version: "0.1.0+4" |
| 151 | connectivity_platform_interface: | 165 | connectivity_platform_interface: |
| 152 | dependency: transitive | 166 | dependency: transitive |
| 153 | description: | 167 | description: |
| 154 | name: connectivity_platform_interface | 168 | name: connectivity_platform_interface |
| 155 | url: "https://pub.flutter-io.cn" | 169 | url: "https://pub.flutter-io.cn" |
| 156 | source: hosted | 170 | source: hosted |
| 157 | - version: "1.0.3" | 171 | + version: "1.0.6" |
| 172 | + contacts_service: | ||
| 173 | + dependency: "direct main" | ||
| 174 | + description: | ||
| 175 | + name: contacts_service | ||
| 176 | + url: "https://pub.flutter-io.cn" | ||
| 177 | + source: hosted | ||
| 178 | + version: "0.4.6" | ||
| 158 | convert: | 179 | convert: |
| 159 | dependency: transitive | 180 | dependency: transitive |
| 160 | description: | 181 | description: |
| @@ -182,7 +203,7 @@ packages: | @@ -182,7 +203,7 @@ packages: | ||
| 182 | name: csslib | 203 | name: csslib |
| 183 | url: "https://pub.flutter-io.cn" | 204 | url: "https://pub.flutter-io.cn" |
| 184 | source: hosted | 205 | source: hosted |
| 185 | - version: "0.16.1" | 206 | + version: "0.16.2" |
| 186 | cupertino_icons: | 207 | cupertino_icons: |
| 187 | dependency: "direct main" | 208 | dependency: "direct main" |
| 188 | description: | 209 | description: |
| @@ -197,6 +218,20 @@ packages: | @@ -197,6 +218,20 @@ packages: | ||
| 197 | url: "https://pub.flutter-io.cn" | 218 | url: "https://pub.flutter-io.cn" |
| 198 | source: hosted | 219 | source: hosted |
| 199 | version: "1.2.9" | 220 | version: "1.2.9" |
| 221 | + device_info: | ||
| 222 | + dependency: "direct main" | ||
| 223 | + description: | ||
| 224 | + name: device_info | ||
| 225 | + url: "https://pub.flutter-io.cn" | ||
| 226 | + source: hosted | ||
| 227 | + version: "0.4.2+7" | ||
| 228 | + device_info_platform_interface: | ||
| 229 | + dependency: transitive | ||
| 230 | + description: | ||
| 231 | + name: device_info_platform_interface | ||
| 232 | + url: "https://pub.flutter-io.cn" | ||
| 233 | + source: hosted | ||
| 234 | + version: "1.0.0" | ||
| 200 | dio: | 235 | dio: |
| 201 | dependency: "direct main" | 236 | dependency: "direct main" |
| 202 | description: | 237 | description: |
| @@ -210,14 +245,21 @@ packages: | @@ -210,14 +245,21 @@ packages: | ||
| 210 | name: extended_image | 245 | name: extended_image |
| 211 | url: "https://pub.flutter-io.cn" | 246 | url: "https://pub.flutter-io.cn" |
| 212 | source: hosted | 247 | source: hosted |
| 213 | - version: "0.7.1" | 248 | + version: "0.7.4" |
| 214 | extended_image_library: | 249 | extended_image_library: |
| 215 | dependency: transitive | 250 | dependency: transitive |
| 216 | description: | 251 | description: |
| 217 | name: extended_image_library | 252 | name: extended_image_library |
| 218 | url: "https://pub.flutter-io.cn" | 253 | url: "https://pub.flutter-io.cn" |
| 219 | source: hosted | 254 | source: hosted |
| 220 | - version: "0.2.0" | 255 | + version: "0.2.3" |
| 256 | + file: | ||
| 257 | + dependency: transitive | ||
| 258 | + description: | ||
| 259 | + name: file | ||
| 260 | + url: "https://pub.flutter-io.cn" | ||
| 261 | + source: hosted | ||
| 262 | + version: "5.2.1" | ||
| 221 | fixnum: | 263 | fixnum: |
| 222 | dependency: transitive | 264 | dependency: transitive |
| 223 | description: | 265 | description: |
| @@ -231,7 +273,7 @@ packages: | @@ -231,7 +273,7 @@ packages: | ||
| 231 | name: fluro | 273 | name: fluro |
| 232 | url: "https://pub.flutter-io.cn" | 274 | url: "https://pub.flutter-io.cn" |
| 233 | source: hosted | 275 | source: hosted |
| 234 | - version: "1.6.1" | 276 | + version: "1.6.3" |
| 235 | flutter: | 277 | flutter: |
| 236 | dependency: "direct main" | 278 | dependency: "direct main" |
| 237 | description: flutter | 279 | description: flutter |
| @@ -250,28 +292,28 @@ packages: | @@ -250,28 +292,28 @@ packages: | ||
| 250 | name: flutter_cache_manager | 292 | name: flutter_cache_manager |
| 251 | url: "https://pub.flutter-io.cn" | 293 | url: "https://pub.flutter-io.cn" |
| 252 | source: hosted | 294 | source: hosted |
| 253 | - version: "1.1.3" | 295 | + version: "1.4.1" |
| 254 | flutter_easyrefresh: | 296 | flutter_easyrefresh: |
| 255 | dependency: "direct main" | 297 | dependency: "direct main" |
| 256 | description: | 298 | description: |
| 257 | name: flutter_easyrefresh | 299 | name: flutter_easyrefresh |
| 258 | url: "https://pub.flutter-io.cn" | 300 | url: "https://pub.flutter-io.cn" |
| 259 | source: hosted | 301 | source: hosted |
| 260 | - version: "2.1.0" | 302 | + version: "2.1.5" |
| 261 | flutter_picker: | 303 | flutter_picker: |
| 262 | dependency: "direct main" | 304 | dependency: "direct main" |
| 263 | description: | 305 | description: |
| 264 | name: flutter_picker | 306 | name: flutter_picker |
| 265 | url: "https://pub.flutter-io.cn" | 307 | url: "https://pub.flutter-io.cn" |
| 266 | source: hosted | 308 | source: hosted |
| 267 | - version: "1.1.3" | 309 | + version: "1.1.5" |
| 268 | flutter_screenutil: | 310 | flutter_screenutil: |
| 269 | dependency: "direct main" | 311 | dependency: "direct main" |
| 270 | description: | 312 | description: |
| 271 | name: flutter_screenutil | 313 | name: flutter_screenutil |
| 272 | url: "https://pub.flutter-io.cn" | 314 | url: "https://pub.flutter-io.cn" |
| 273 | source: hosted | 315 | source: hosted |
| 274 | - version: "1.0.2" | 316 | + version: "1.1.0" |
| 275 | flutter_statusbarcolor: | 317 | flutter_statusbarcolor: |
| 276 | dependency: "direct main" | 318 | dependency: "direct main" |
| 277 | description: | 319 | description: |
| @@ -302,7 +344,7 @@ packages: | @@ -302,7 +344,7 @@ packages: | ||
| 302 | name: fluwx | 344 | name: fluwx |
| 303 | url: "https://pub.flutter-io.cn" | 345 | url: "https://pub.flutter-io.cn" |
| 304 | source: hosted | 346 | source: hosted |
| 305 | - version: "2.0.9" | 347 | + version: "2.3.0" |
| 306 | front_end: | 348 | front_end: |
| 307 | dependency: transitive | 349 | dependency: transitive |
| 308 | description: | 350 | description: |
| @@ -344,7 +386,7 @@ packages: | @@ -344,7 +386,7 @@ packages: | ||
| 344 | name: http | 386 | name: http |
| 345 | url: "https://pub.flutter-io.cn" | 387 | url: "https://pub.flutter-io.cn" |
| 346 | source: hosted | 388 | source: hosted |
| 347 | - version: "0.12.0+4" | 389 | + version: "0.12.2" |
| 348 | http_client_helper: | 390 | http_client_helper: |
| 349 | dependency: transitive | 391 | dependency: transitive |
| 350 | description: | 392 | description: |
| @@ -365,7 +407,7 @@ packages: | @@ -365,7 +407,7 @@ packages: | ||
| 365 | name: http_parser | 407 | name: http_parser |
| 366 | url: "https://pub.flutter-io.cn" | 408 | url: "https://pub.flutter-io.cn" |
| 367 | source: hosted | 409 | source: hosted |
| 368 | - version: "3.1.3" | 410 | + version: "3.1.4" |
| 369 | image: | 411 | image: |
| 370 | dependency: transitive | 412 | dependency: transitive |
| 371 | description: | 413 | description: |
| @@ -393,7 +435,7 @@ packages: | @@ -393,7 +435,7 @@ packages: | ||
| 393 | name: io | 435 | name: io |
| 394 | url: "https://pub.flutter-io.cn" | 436 | url: "https://pub.flutter-io.cn" |
| 395 | source: hosted | 437 | source: hosted |
| 396 | - version: "0.3.3" | 438 | + version: "0.3.4" |
| 397 | jpush_flutter: | 439 | jpush_flutter: |
| 398 | dependency: "direct main" | 440 | dependency: "direct main" |
| 399 | description: | 441 | description: |
| @@ -407,7 +449,7 @@ packages: | @@ -407,7 +449,7 @@ packages: | ||
| 407 | name: js | 449 | name: js |
| 408 | url: "https://pub.flutter-io.cn" | 450 | url: "https://pub.flutter-io.cn" |
| 409 | source: hosted | 451 | source: hosted |
| 410 | - version: "0.6.1+1" | 452 | + version: "0.6.2" |
| 411 | json_annotation: | 453 | json_annotation: |
| 412 | dependency: "direct main" | 454 | dependency: "direct main" |
| 413 | description: | 455 | description: |
| @@ -463,7 +505,7 @@ packages: | @@ -463,7 +505,7 @@ packages: | ||
| 463 | name: mime | 505 | name: mime |
| 464 | url: "https://pub.flutter-io.cn" | 506 | url: "https://pub.flutter-io.cn" |
| 465 | source: hosted | 507 | source: hosted |
| 466 | - version: "0.9.6+3" | 508 | + version: "0.9.7" |
| 467 | nested: | 509 | nested: |
| 468 | dependency: transitive | 510 | dependency: transitive |
| 469 | description: | 511 | description: |
| @@ -477,28 +519,28 @@ packages: | @@ -477,28 +519,28 @@ packages: | ||
| 477 | name: node_interop | 519 | name: node_interop |
| 478 | url: "https://pub.flutter-io.cn" | 520 | url: "https://pub.flutter-io.cn" |
| 479 | source: hosted | 521 | source: hosted |
| 480 | - version: "1.0.3" | 522 | + version: "1.1.1" |
| 481 | node_io: | 523 | node_io: |
| 482 | dependency: transitive | 524 | dependency: transitive |
| 483 | description: | 525 | description: |
| 484 | name: node_io | 526 | name: node_io |
| 485 | url: "https://pub.flutter-io.cn" | 527 | url: "https://pub.flutter-io.cn" |
| 486 | source: hosted | 528 | source: hosted |
| 487 | - version: "1.0.1+2" | 529 | + version: "1.1.1" |
| 488 | package_config: | 530 | package_config: |
| 489 | dependency: transitive | 531 | dependency: transitive |
| 490 | description: | 532 | description: |
| 491 | name: package_config | 533 | name: package_config |
| 492 | url: "https://pub.flutter-io.cn" | 534 | url: "https://pub.flutter-io.cn" |
| 493 | source: hosted | 535 | source: hosted |
| 494 | - version: "1.9.2" | 536 | + version: "1.9.3" |
| 495 | package_info: | 537 | package_info: |
| 496 | dependency: "direct main" | 538 | dependency: "direct main" |
| 497 | description: | 539 | description: |
| 498 | name: package_info | 540 | name: package_info |
| 499 | url: "https://pub.flutter-io.cn" | 541 | url: "https://pub.flutter-io.cn" |
| 500 | source: hosted | 542 | source: hosted |
| 501 | - version: "0.4.0+18" | 543 | + version: "0.4.3" |
| 502 | package_resolver: | 544 | package_resolver: |
| 503 | dependency: transitive | 545 | dependency: transitive |
| 504 | description: | 546 | description: |
| @@ -519,21 +561,28 @@ packages: | @@ -519,21 +561,28 @@ packages: | ||
| 519 | name: path_provider | 561 | name: path_provider |
| 520 | url: "https://pub.flutter-io.cn" | 562 | url: "https://pub.flutter-io.cn" |
| 521 | source: hosted | 563 | source: hosted |
| 522 | - version: "1.6.5" | 564 | + version: "1.6.14" |
| 565 | + path_provider_linux: | ||
| 566 | + dependency: transitive | ||
| 567 | + description: | ||
| 568 | + name: path_provider_linux | ||
| 569 | + url: "https://pub.flutter-io.cn" | ||
| 570 | + source: hosted | ||
| 571 | + version: "0.0.1+2" | ||
| 523 | path_provider_macos: | 572 | path_provider_macos: |
| 524 | dependency: transitive | 573 | dependency: transitive |
| 525 | description: | 574 | description: |
| 526 | name: path_provider_macos | 575 | name: path_provider_macos |
| 527 | url: "https://pub.flutter-io.cn" | 576 | url: "https://pub.flutter-io.cn" |
| 528 | source: hosted | 577 | source: hosted |
| 529 | - version: "0.0.4" | 578 | + version: "0.0.4+3" |
| 530 | path_provider_platform_interface: | 579 | path_provider_platform_interface: |
| 531 | dependency: transitive | 580 | dependency: transitive |
| 532 | description: | 581 | description: |
| 533 | name: path_provider_platform_interface | 582 | name: path_provider_platform_interface |
| 534 | url: "https://pub.flutter-io.cn" | 583 | url: "https://pub.flutter-io.cn" |
| 535 | source: hosted | 584 | source: hosted |
| 536 | - version: "1.0.1" | 585 | + version: "1.0.3" |
| 537 | pedantic: | 586 | pedantic: |
| 538 | dependency: transitive | 587 | dependency: transitive |
| 539 | description: | 588 | description: |
| @@ -547,7 +596,7 @@ packages: | @@ -547,7 +596,7 @@ packages: | ||
| 547 | name: permission_handler | 596 | name: permission_handler |
| 548 | url: "https://pub.flutter-io.cn" | 597 | url: "https://pub.flutter-io.cn" |
| 549 | source: hosted | 598 | source: hosted |
| 550 | - version: "4.4.0" | 599 | + version: "4.4.0+hotfix.4" |
| 551 | permission_handler_platform_interface: | 600 | permission_handler_platform_interface: |
| 552 | dependency: transitive | 601 | dependency: transitive |
| 553 | description: | 602 | description: |
| @@ -569,6 +618,13 @@ packages: | @@ -569,6 +618,13 @@ packages: | ||
| 569 | url: "https://pub.flutter-io.cn" | 618 | url: "https://pub.flutter-io.cn" |
| 570 | source: hosted | 619 | source: hosted |
| 571 | version: "2.2.1" | 620 | version: "2.2.1" |
| 621 | + platform_detect: | ||
| 622 | + dependency: transitive | ||
| 623 | + description: | ||
| 624 | + name: platform_detect | ||
| 625 | + url: "https://pub.flutter-io.cn" | ||
| 626 | + source: hosted | ||
| 627 | + version: "1.4.0" | ||
| 572 | plugin_platform_interface: | 628 | plugin_platform_interface: |
| 573 | dependency: transitive | 629 | dependency: transitive |
| 574 | description: | 630 | description: |
| @@ -583,13 +639,20 @@ packages: | @@ -583,13 +639,20 @@ packages: | ||
| 583 | url: "https://pub.flutter-io.cn" | 639 | url: "https://pub.flutter-io.cn" |
| 584 | source: hosted | 640 | source: hosted |
| 585 | version: "1.4.0" | 641 | version: "1.4.0" |
| 642 | + process: | ||
| 643 | + dependency: transitive | ||
| 644 | + description: | ||
| 645 | + name: process | ||
| 646 | + url: "https://pub.flutter-io.cn" | ||
| 647 | + source: hosted | ||
| 648 | + version: "3.0.13" | ||
| 586 | provider: | 649 | provider: |
| 587 | dependency: "direct main" | 650 | dependency: "direct main" |
| 588 | description: | 651 | description: |
| 589 | name: provider | 652 | name: provider |
| 590 | url: "https://pub.flutter-io.cn" | 653 | url: "https://pub.flutter-io.cn" |
| 591 | source: hosted | 654 | source: hosted |
| 592 | - version: "4.0.4" | 655 | + version: "4.0.5+1" |
| 593 | pub_semver: | 656 | pub_semver: |
| 594 | dependency: transitive | 657 | dependency: transitive |
| 595 | description: | 658 | description: |
| @@ -611,41 +674,55 @@ packages: | @@ -611,41 +674,55 @@ packages: | ||
| 611 | url: "https://pub.flutter-io.cn" | 674 | url: "https://pub.flutter-io.cn" |
| 612 | source: hosted | 675 | source: hosted |
| 613 | version: "2.0.5" | 676 | version: "2.0.5" |
| 677 | + rxdart: | ||
| 678 | + dependency: transitive | ||
| 679 | + description: | ||
| 680 | + name: rxdart | ||
| 681 | + url: "https://pub.flutter-io.cn" | ||
| 682 | + source: hosted | ||
| 683 | + version: "0.24.1" | ||
| 614 | shared_preferences: | 684 | shared_preferences: |
| 615 | dependency: "direct main" | 685 | dependency: "direct main" |
| 616 | description: | 686 | description: |
| 617 | name: shared_preferences | 687 | name: shared_preferences |
| 618 | url: "https://pub.flutter-io.cn" | 688 | url: "https://pub.flutter-io.cn" |
| 619 | source: hosted | 689 | source: hosted |
| 620 | - version: "0.5.6+3" | 690 | + version: "0.5.10" |
| 691 | + shared_preferences_linux: | ||
| 692 | + dependency: transitive | ||
| 693 | + description: | ||
| 694 | + name: shared_preferences_linux | ||
| 695 | + url: "https://pub.flutter-io.cn" | ||
| 696 | + source: hosted | ||
| 697 | + version: "0.0.2+2" | ||
| 621 | shared_preferences_macos: | 698 | shared_preferences_macos: |
| 622 | dependency: transitive | 699 | dependency: transitive |
| 623 | description: | 700 | description: |
| 624 | name: shared_preferences_macos | 701 | name: shared_preferences_macos |
| 625 | url: "https://pub.flutter-io.cn" | 702 | url: "https://pub.flutter-io.cn" |
| 626 | source: hosted | 703 | source: hosted |
| 627 | - version: "0.0.1+6" | 704 | + version: "0.0.1+10" |
| 628 | shared_preferences_platform_interface: | 705 | shared_preferences_platform_interface: |
| 629 | dependency: transitive | 706 | dependency: transitive |
| 630 | description: | 707 | description: |
| 631 | name: shared_preferences_platform_interface | 708 | name: shared_preferences_platform_interface |
| 632 | url: "https://pub.flutter-io.cn" | 709 | url: "https://pub.flutter-io.cn" |
| 633 | source: hosted | 710 | source: hosted |
| 634 | - version: "1.0.3" | 711 | + version: "1.0.4" |
| 635 | shared_preferences_web: | 712 | shared_preferences_web: |
| 636 | dependency: transitive | 713 | dependency: transitive |
| 637 | description: | 714 | description: |
| 638 | name: shared_preferences_web | 715 | name: shared_preferences_web |
| 639 | url: "https://pub.flutter-io.cn" | 716 | url: "https://pub.flutter-io.cn" |
| 640 | source: hosted | 717 | source: hosted |
| 641 | - version: "0.1.2+4" | 718 | + version: "0.1.2+7" |
| 642 | shelf: | 719 | shelf: |
| 643 | dependency: transitive | 720 | dependency: transitive |
| 644 | description: | 721 | description: |
| 645 | name: shelf | 722 | name: shelf |
| 646 | url: "https://pub.flutter-io.cn" | 723 | url: "https://pub.flutter-io.cn" |
| 647 | source: hosted | 724 | source: hosted |
| 648 | - version: "0.7.5" | 725 | + version: "0.7.9" |
| 649 | shelf_web_socket: | 726 | shelf_web_socket: |
| 650 | dependency: transitive | 727 | dependency: transitive |
| 651 | description: | 728 | description: |
| @@ -685,7 +762,14 @@ packages: | @@ -685,7 +762,14 @@ packages: | ||
| 685 | name: sqflite | 762 | name: sqflite |
| 686 | url: "https://pub.flutter-io.cn" | 763 | url: "https://pub.flutter-io.cn" |
| 687 | source: hosted | 764 | source: hosted |
| 688 | - version: "1.2.2+1" | 765 | + version: "1.3.1+1" |
| 766 | + sqflite_common: | ||
| 767 | + dependency: transitive | ||
| 768 | + description: | ||
| 769 | + name: sqflite_common | ||
| 770 | + url: "https://pub.flutter-io.cn" | ||
| 771 | + source: hosted | ||
| 772 | + version: "1.0.2+1" | ||
| 689 | stack_trace: | 773 | stack_trace: |
| 690 | dependency: transitive | 774 | dependency: transitive |
| 691 | description: | 775 | description: |
| @@ -762,35 +846,42 @@ packages: | @@ -762,35 +846,42 @@ packages: | ||
| 762 | name: url_launcher | 846 | name: url_launcher |
| 763 | url: "https://pub.flutter-io.cn" | 847 | url: "https://pub.flutter-io.cn" |
| 764 | source: hosted | 848 | source: hosted |
| 765 | - version: "5.4.2" | 849 | + version: "5.5.2" |
| 850 | + url_launcher_linux: | ||
| 851 | + dependency: transitive | ||
| 852 | + description: | ||
| 853 | + name: url_launcher_linux | ||
| 854 | + url: "https://pub.flutter-io.cn" | ||
| 855 | + source: hosted | ||
| 856 | + version: "0.0.1+1" | ||
| 766 | url_launcher_macos: | 857 | url_launcher_macos: |
| 767 | dependency: transitive | 858 | dependency: transitive |
| 768 | description: | 859 | description: |
| 769 | name: url_launcher_macos | 860 | name: url_launcher_macos |
| 770 | url: "https://pub.flutter-io.cn" | 861 | url: "https://pub.flutter-io.cn" |
| 771 | source: hosted | 862 | source: hosted |
| 772 | - version: "0.0.1+4" | 863 | + version: "0.0.1+7" |
| 773 | url_launcher_platform_interface: | 864 | url_launcher_platform_interface: |
| 774 | dependency: transitive | 865 | dependency: transitive |
| 775 | description: | 866 | description: |
| 776 | name: url_launcher_platform_interface | 867 | name: url_launcher_platform_interface |
| 777 | url: "https://pub.flutter-io.cn" | 868 | url: "https://pub.flutter-io.cn" |
| 778 | source: hosted | 869 | source: hosted |
| 779 | - version: "1.0.6" | 870 | + version: "1.0.8" |
| 780 | url_launcher_web: | 871 | url_launcher_web: |
| 781 | dependency: transitive | 872 | dependency: transitive |
| 782 | description: | 873 | description: |
| 783 | name: url_launcher_web | 874 | name: url_launcher_web |
| 784 | url: "https://pub.flutter-io.cn" | 875 | url: "https://pub.flutter-io.cn" |
| 785 | source: hosted | 876 | source: hosted |
| 786 | - version: "0.1.1+1" | 877 | + version: "0.1.3+1" |
| 787 | uuid: | 878 | uuid: |
| 788 | dependency: transitive | 879 | dependency: transitive |
| 789 | description: | 880 | description: |
| 790 | name: uuid | 881 | name: uuid |
| 791 | url: "https://pub.flutter-io.cn" | 882 | url: "https://pub.flutter-io.cn" |
| 792 | source: hosted | 883 | source: hosted |
| 793 | - version: "2.0.4" | 884 | + version: "2.2.2" |
| 794 | vector_math: | 885 | vector_math: |
| 795 | dependency: transitive | 886 | dependency: transitive |
| 796 | description: | 887 | description: |
| @@ -804,7 +895,7 @@ packages: | @@ -804,7 +895,7 @@ packages: | ||
| 804 | name: watcher | 895 | name: watcher |
| 805 | url: "https://pub.flutter-io.cn" | 896 | url: "https://pub.flutter-io.cn" |
| 806 | source: hosted | 897 | source: hosted |
| 807 | - version: "0.9.7+14" | 898 | + version: "0.9.7+15" |
| 808 | web_socket_channel: | 899 | web_socket_channel: |
| 809 | dependency: "direct main" | 900 | dependency: "direct main" |
| 810 | description: | 901 | description: |
| @@ -812,6 +903,20 @@ packages: | @@ -812,6 +903,20 @@ packages: | ||
| 812 | url: "https://pub.flutter-io.cn" | 903 | url: "https://pub.flutter-io.cn" |
| 813 | source: hosted | 904 | source: hosted |
| 814 | version: "1.1.0" | 905 | version: "1.1.0" |
| 906 | + webview_flutter: | ||
| 907 | + dependency: "direct main" | ||
| 908 | + description: | ||
| 909 | + name: webview_flutter | ||
| 910 | + url: "https://pub.flutter-io.cn" | ||
| 911 | + source: hosted | ||
| 912 | + version: "0.3.22+1" | ||
| 913 | + xdg_directories: | ||
| 914 | + dependency: transitive | ||
| 915 | + description: | ||
| 916 | + name: xdg_directories | ||
| 917 | + url: "https://pub.flutter-io.cn" | ||
| 918 | + source: hosted | ||
| 919 | + version: "0.1.0" | ||
| 815 | xml: | 920 | xml: |
| 816 | dependency: transitive | 921 | dependency: transitive |
| 817 | description: | 922 | description: |
| @@ -825,7 +930,7 @@ packages: | @@ -825,7 +930,7 @@ packages: | ||
| 825 | name: yaml | 930 | name: yaml |
| 826 | url: "https://pub.flutter-io.cn" | 931 | url: "https://pub.flutter-io.cn" |
| 827 | source: hosted | 932 | source: hosted |
| 828 | - version: "2.2.0" | 933 | + version: "2.2.1" |
| 829 | sdks: | 934 | sdks: |
| 830 | dart: ">=2.7.0 <3.0.0" | 935 | dart: ">=2.7.0 <3.0.0" |
| 831 | - flutter: ">=1.12.13+hotfix.5 <1.16.0" | 936 | + flutter: ">=1.12.13+hotfix.5 <2.0.0" |
| @@ -64,7 +64,7 @@ dependencies: | @@ -64,7 +64,7 @@ dependencies: | ||
| 64 | # 日历 | 64 | # 日历 |
| 65 | table_calendar: ^2.2.1 | 65 | table_calendar: ^2.2.1 |
| 66 | # 微信SDK | 66 | # 微信SDK |
| 67 | - fluwx: ^2.0.9 | 67 | + fluwx: ^2.1.0 |
| 68 | #网页,短信,电话 | 68 | #网页,短信,电话 |
| 69 | url_launcher: ^5.4.2 | 69 | url_launcher: ^5.4.2 |
| 70 | # 滚轮选择器 | 70 | # 滚轮选择器 |
| @@ -77,12 +77,20 @@ dependencies: | @@ -77,12 +77,20 @@ dependencies: | ||
| 77 | install_plugin: ^2.0.1 | 77 | install_plugin: ^2.0.1 |
| 78 | # 获取应用版本信息 | 78 | # 获取应用版本信息 |
| 79 | package_info: ^0.4.0+18 | 79 | package_info: ^0.4.0+18 |
| 80 | +# 获取设备信息 | ||
| 81 | + device_info: ^0.4.2+4 | ||
| 82 | +# webview | ||
| 83 | + webview_flutter: ^0.3.22+1 | ||
| 84 | +# 获取通讯录 | ||
| 85 | + contacts_service: ^0.4.6 | ||
| 86 | + | ||
| 80 | 87 | ||
| 81 | dev_dependencies: | 88 | dev_dependencies: |
| 82 | flutter_test: | 89 | flutter_test: |
| 83 | sdk: flutter | 90 | sdk: flutter |
| 84 | 91 | ||
| 85 | json_model: ^0.0.2 | 92 | json_model: ^0.0.2 |
| 93 | + | ||
| 86 | build_runner: ^1.0.0 | 94 | build_runner: ^1.0.0 |
| 87 | json_serializable: ^2.0.0 | 95 | json_serializable: ^2.0.0 |
| 88 | 96 |
-
Please register or login to post a comment