Showing
31 changed files
with
687 additions
and
203 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' |
| 1 | PODS: | 1 | PODS: |
| 2 | - audioplayers (0.0.1): | 2 | - audioplayers (0.0.1): |
| 3 | - Flutter | 3 | - Flutter |
| 4 | +<<<<<<< HEAD | ||
| 4 | - Bugly (2.5.71) | 5 | - Bugly (2.5.71) |
| 6 | +======= | ||
| 7 | + - connectivity (0.0.1): | ||
| 8 | + - Flutter | ||
| 9 | + - Reachability | ||
| 10 | + - connectivity_macos (0.0.1): | ||
| 11 | + - Flutter | ||
| 12 | + - contacts_service (0.2.2): | ||
| 13 | + - Flutter | ||
| 14 | + - device_info (0.0.1): | ||
| 15 | + - Flutter | ||
| 16 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 5 | - Flutter (1.0.0) | 17 | - Flutter (1.0.0) |
| 6 | - flutter_bugly (0.0.1): | 18 | - flutter_bugly (0.0.1): |
| 7 | - Bugly | 19 | - Bugly |
| @@ -47,10 +59,27 @@ PODS: | @@ -47,10 +59,27 @@ PODS: | ||
| 47 | - Flutter | 59 | - Flutter |
| 48 | - url_launcher_web (0.0.1): | 60 | - url_launcher_web (0.0.1): |
| 49 | - Flutter | 61 | - Flutter |
| 62 | +<<<<<<< HEAD | ||
| 63 | + - WechatOpenSDK (1.8.7.1) | ||
| 64 | + | ||
| 65 | +DEPENDENCIES: | ||
| 66 | + - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | ||
| 67 | +======= | ||
| 68 | +<<<<<<< HEAD | ||
| 69 | + - WechatOpenSDK (1.8.6.2) | ||
| 70 | +======= | ||
| 71 | + - webview_flutter (0.0.1): | ||
| 72 | + - Flutter | ||
| 50 | - WechatOpenSDK (1.8.7.1) | 73 | - WechatOpenSDK (1.8.7.1) |
| 74 | +>>>>>>> dev | ||
| 51 | 75 | ||
| 52 | DEPENDENCIES: | 76 | DEPENDENCIES: |
| 53 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | 77 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) |
| 78 | + - connectivity (from `.symlinks/plugins/connectivity/ios`) | ||
| 79 | + - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) | ||
| 80 | + - contacts_service (from `.symlinks/plugins/contacts_service/ios`) | ||
| 81 | + - device_info (from `.symlinks/plugins/device_info/ios`) | ||
| 82 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 54 | - Flutter (from `Flutter`) | 83 | - Flutter (from `Flutter`) |
| 55 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | 84 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) |
| 56 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 85 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| @@ -69,6 +98,7 @@ DEPENDENCIES: | @@ -69,6 +98,7 @@ DEPENDENCIES: | ||
| 69 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) | 98 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) |
| 70 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) | 99 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) |
| 71 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) | 100 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) |
| 101 | + - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) | ||
| 72 | 102 | ||
| 73 | SPEC REPOS: | 103 | SPEC REPOS: |
| 74 | trunk: | 104 | trunk: |
| @@ -81,6 +111,17 @@ SPEC REPOS: | @@ -81,6 +111,17 @@ SPEC REPOS: | ||
| 81 | EXTERNAL SOURCES: | 111 | EXTERNAL SOURCES: |
| 82 | audioplayers: | 112 | audioplayers: |
| 83 | :path: ".symlinks/plugins/audioplayers/ios" | 113 | :path: ".symlinks/plugins/audioplayers/ios" |
| 114 | +<<<<<<< HEAD | ||
| 115 | +======= | ||
| 116 | + connectivity: | ||
| 117 | + :path: ".symlinks/plugins/connectivity/ios" | ||
| 118 | + connectivity_macos: | ||
| 119 | + :path: ".symlinks/plugins/connectivity_macos/ios" | ||
| 120 | + contacts_service: | ||
| 121 | + :path: ".symlinks/plugins/contacts_service/ios" | ||
| 122 | + device_info: | ||
| 123 | + :path: ".symlinks/plugins/device_info/ios" | ||
| 124 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 84 | Flutter: | 125 | Flutter: |
| 85 | :path: Flutter | 126 | :path: Flutter |
| 86 | flutter_bugly: | 127 | flutter_bugly: |
| @@ -117,10 +158,19 @@ EXTERNAL SOURCES: | @@ -117,10 +158,19 @@ EXTERNAL SOURCES: | ||
| 117 | :path: ".symlinks/plugins/url_launcher_macos/ios" | 158 | :path: ".symlinks/plugins/url_launcher_macos/ios" |
| 118 | url_launcher_web: | 159 | url_launcher_web: |
| 119 | :path: ".symlinks/plugins/url_launcher_web/ios" | 160 | :path: ".symlinks/plugins/url_launcher_web/ios" |
| 161 | + webview_flutter: | ||
| 162 | + :path: ".symlinks/plugins/webview_flutter/ios" | ||
| 120 | 163 | ||
| 121 | SPEC CHECKSUMS: | 164 | SPEC CHECKSUMS: |
| 122 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c | 165 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c |
| 166 | +<<<<<<< HEAD | ||
| 123 | Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac | 167 | Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac |
| 168 | +======= | ||
| 169 | + connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 | ||
| 170 | + connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 | ||
| 171 | + contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca | ||
| 172 | + device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | ||
| 173 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 124 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | 174 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec |
| 125 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | 175 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 |
| 126 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 176 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| @@ -142,7 +192,16 @@ SPEC CHECKSUMS: | @@ -142,7 +192,16 @@ SPEC CHECKSUMS: | ||
| 142 | url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 | 192 | url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 |
| 143 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 | 193 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 |
| 144 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c | 194 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c |
| 195 | +<<<<<<< HEAD | ||
| 196 | + WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | ||
| 197 | +======= | ||
| 198 | +<<<<<<< HEAD | ||
| 199 | + WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a | ||
| 200 | +======= | ||
| 201 | + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 | ||
| 145 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | 202 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 |
| 203 | +>>>>>>> dev | ||
| 204 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 146 | 205 | ||
| 147 | PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13 | 206 | PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13 |
| 148 | 207 |
| @@ -369,9 +369,14 @@ | @@ -369,9 +369,14 @@ | ||
| 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 370 | CLANG_ENABLE_MODULES = YES; | 370 | CLANG_ENABLE_MODULES = YES; |
| 371 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 371 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 372 | +<<<<<<< HEAD | ||
| 372 | CODE_SIGN_IDENTITY = "Apple Development"; | 373 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 373 | CODE_SIGN_STYLE = Automatic; | 374 | CODE_SIGN_STYLE = Automatic; |
| 374 | CURRENT_PROJECT_VERSION = 3; | 375 | CURRENT_PROJECT_VERSION = 3; |
| 376 | +======= | ||
| 377 | + CODE_SIGN_STYLE = Manual; | ||
| 378 | + CURRENT_PROJECT_VERSION = 8; | ||
| 379 | +>>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 375 | DEVELOPMENT_TEAM = 8J59HM8B82; | 380 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 376 | ENABLE_BITCODE = NO; | 381 | ENABLE_BITCODE = NO; |
| 377 | FRAMEWORK_SEARCH_PATHS = ( | 382 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -384,7 +389,7 @@ | @@ -384,7 +389,7 @@ | ||
| 384 | "$(inherited)", | 389 | "$(inherited)", |
| 385 | "$(PROJECT_DIR)/Flutter", | 390 | "$(PROJECT_DIR)/Flutter", |
| 386 | ); | 391 | ); |
| 387 | - MARKETING_VERSION = 1.0.3; | 392 | + MARKETING_VERSION = 1.0.8; |
| 388 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 393 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 389 | PRODUCT_NAME = "一键订"; | 394 | PRODUCT_NAME = "一键订"; |
| 390 | PROVISIONING_PROFILE_SPECIFIER = ""; | 395 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -512,7 +517,7 @@ | @@ -512,7 +517,7 @@ | ||
| 512 | CLANG_ENABLE_MODULES = YES; | 517 | CLANG_ENABLE_MODULES = YES; |
| 513 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 518 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 514 | CODE_SIGN_STYLE = Manual; | 519 | CODE_SIGN_STYLE = Manual; |
| 515 | - CURRENT_PROJECT_VERSION = 3; | 520 | + CURRENT_PROJECT_VERSION = 8; |
| 516 | DEVELOPMENT_TEAM = 8J59HM8B82; | 521 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 517 | ENABLE_BITCODE = NO; | 522 | ENABLE_BITCODE = NO; |
| 518 | FRAMEWORK_SEARCH_PATHS = ( | 523 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -525,7 +530,7 @@ | @@ -525,7 +530,7 @@ | ||
| 525 | "$(inherited)", | 530 | "$(inherited)", |
| 526 | "$(PROJECT_DIR)/Flutter", | 531 | "$(PROJECT_DIR)/Flutter", |
| 527 | ); | 532 | ); |
| 528 | - MARKETING_VERSION = 1.0.3; | 533 | + MARKETING_VERSION = 1.0.8; |
| 529 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 534 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 530 | PRODUCT_NAME = "一键订"; | 535 | PRODUCT_NAME = "一键订"; |
| 531 | PROVISIONING_PROFILE_SPECIFIER = wdn_yjd; | 536 | PROVISIONING_PROFILE_SPECIFIER = wdn_yjd; |
| @@ -544,7 +549,7 @@ | @@ -544,7 +549,7 @@ | ||
| 544 | CLANG_ENABLE_MODULES = YES; | 549 | CLANG_ENABLE_MODULES = YES; |
| 545 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 550 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 546 | CODE_SIGN_STYLE = Manual; | 551 | CODE_SIGN_STYLE = Manual; |
| 547 | - CURRENT_PROJECT_VERSION = 3; | 552 | + CURRENT_PROJECT_VERSION = 8; |
| 548 | DEVELOPMENT_TEAM = 8J59HM8B82; | 553 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 549 | ENABLE_BITCODE = NO; | 554 | ENABLE_BITCODE = NO; |
| 550 | FRAMEWORK_SEARCH_PATHS = ( | 555 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -557,7 +562,7 @@ | @@ -557,7 +562,7 @@ | ||
| 557 | "$(inherited)", | 562 | "$(inherited)", |
| 558 | "$(PROJECT_DIR)/Flutter", | 563 | "$(PROJECT_DIR)/Flutter", |
| 559 | ); | 564 | ); |
| 560 | - MARKETING_VERSION = 1.0.3; | 565 | + MARKETING_VERSION = 1.0.8; |
| 561 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 566 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 562 | PRODUCT_NAME = "一键订"; | 567 | PRODUCT_NAME = "一键订"; |
| 563 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; | 568 | 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) | 117 | if (one.year == two.year && one.month == two.month && one.day == two.day) |
| @@ -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), |
| @@ -14,7 +14,7 @@ packages: | @@ -14,7 +14,7 @@ packages: | ||
| 14 | name: args | 14 | name: args |
| 15 | url: "https://pub.flutter-io.cn" | 15 | url: "https://pub.flutter-io.cn" |
| 16 | source: hosted | 16 | source: hosted |
| 17 | - version: "1.5.2" | 17 | + version: "1.6.0" |
| 18 | async: | 18 | async: |
| 19 | dependency: transitive | 19 | dependency: transitive |
| 20 | description: | 20 | description: |
| @@ -56,7 +56,7 @@ packages: | @@ -56,7 +56,7 @@ packages: | ||
| 56 | name: build_daemon | 56 | name: build_daemon |
| 57 | url: "https://pub.flutter-io.cn" | 57 | url: "https://pub.flutter-io.cn" |
| 58 | source: hosted | 58 | source: hosted |
| 59 | - version: "2.1.3" | 59 | + version: "2.1.4" |
| 60 | build_resolvers: | 60 | build_resolvers: |
| 61 | dependency: transitive | 61 | dependency: transitive |
| 62 | description: | 62 | description: |
| @@ -91,14 +91,14 @@ packages: | @@ -91,14 +91,14 @@ packages: | ||
| 91 | name: built_value | 91 | name: built_value |
| 92 | url: "https://pub.flutter-io.cn" | 92 | url: "https://pub.flutter-io.cn" |
| 93 | source: hosted | 93 | source: hosted |
| 94 | - version: "7.0.9" | 94 | + version: "7.1.0" |
| 95 | cached_network_image: | 95 | cached_network_image: |
| 96 | dependency: "direct main" | 96 | dependency: "direct main" |
| 97 | description: | 97 | description: |
| 98 | name: cached_network_image | 98 | name: cached_network_image |
| 99 | url: "https://pub.flutter-io.cn" | 99 | url: "https://pub.flutter-io.cn" |
| 100 | source: hosted | 100 | source: hosted |
| 101 | - version: "2.0.0" | 101 | + version: "2.3.1" |
| 102 | characters: | 102 | characters: |
| 103 | dependency: transitive | 103 | dependency: transitive |
| 104 | description: | 104 | description: |
| @@ -133,7 +133,7 @@ packages: | @@ -133,7 +133,7 @@ packages: | ||
| 133 | name: code_builder | 133 | name: code_builder |
| 134 | url: "https://pub.flutter-io.cn" | 134 | url: "https://pub.flutter-io.cn" |
| 135 | source: hosted | 135 | source: hosted |
| 136 | - version: "3.2.1" | 136 | + version: "3.4.1" |
| 137 | collection: | 137 | collection: |
| 138 | dependency: transitive | 138 | dependency: transitive |
| 139 | description: | 139 | description: |
| @@ -169,6 +169,13 @@ packages: | @@ -169,6 +169,13 @@ packages: | ||
| 169 | url: "https://pub.flutter-io.cn" | 169 | url: "https://pub.flutter-io.cn" |
| 170 | source: hosted | 170 | source: hosted |
| 171 | version: "1.0.6" | 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" | ||
| 172 | convert: | 179 | convert: |
| 173 | dependency: transitive | 180 | dependency: transitive |
| 174 | description: | 181 | description: |
| @@ -189,14 +196,14 @@ packages: | @@ -189,14 +196,14 @@ packages: | ||
| 189 | name: crypto | 196 | name: crypto |
| 190 | url: "https://pub.flutter-io.cn" | 197 | url: "https://pub.flutter-io.cn" |
| 191 | source: hosted | 198 | source: hosted |
| 192 | - version: "2.1.3" | 199 | + version: "2.1.5" |
| 193 | csslib: | 200 | csslib: |
| 194 | dependency: transitive | 201 | dependency: transitive |
| 195 | description: | 202 | description: |
| 196 | name: csslib | 203 | name: csslib |
| 197 | url: "https://pub.flutter-io.cn" | 204 | url: "https://pub.flutter-io.cn" |
| 198 | source: hosted | 205 | source: hosted |
| 199 | - version: "0.16.1" | 206 | + version: "0.16.2" |
| 200 | cupertino_icons: | 207 | cupertino_icons: |
| 201 | dependency: "direct main" | 208 | dependency: "direct main" |
| 202 | description: | 209 | description: |
| @@ -211,6 +218,20 @@ packages: | @@ -211,6 +218,20 @@ packages: | ||
| 211 | url: "https://pub.flutter-io.cn" | 218 | url: "https://pub.flutter-io.cn" |
| 212 | source: hosted | 219 | source: hosted |
| 213 | 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" | ||
| 214 | dio: | 235 | dio: |
| 215 | dependency: "direct main" | 236 | dependency: "direct main" |
| 216 | description: | 237 | description: |
| @@ -239,6 +260,13 @@ packages: | @@ -239,6 +260,13 @@ packages: | ||
| 239 | url: "https://pub.flutter-io.cn" | 260 | url: "https://pub.flutter-io.cn" |
| 240 | source: hosted | 261 | source: hosted |
| 241 | version: "1.1.0" | 262 | version: "1.1.0" |
| 263 | + file: | ||
| 264 | + dependency: transitive | ||
| 265 | + description: | ||
| 266 | + name: file | ||
| 267 | + url: "https://pub.flutter-io.cn" | ||
| 268 | + source: hosted | ||
| 269 | + version: "5.2.1" | ||
| 242 | fixnum: | 270 | fixnum: |
| 243 | dependency: transitive | 271 | dependency: transitive |
| 244 | description: | 272 | description: |
| @@ -258,6 +286,13 @@ packages: | @@ -258,6 +286,13 @@ packages: | ||
| 258 | description: flutter | 286 | description: flutter |
| 259 | source: sdk | 287 | source: sdk |
| 260 | version: "0.0.0" | 288 | version: "0.0.0" |
| 289 | + flutter_blurhash: | ||
| 290 | + dependency: transitive | ||
| 291 | + description: | ||
| 292 | + name: flutter_blurhash | ||
| 293 | + url: "https://pub.flutter-io.cn" | ||
| 294 | + source: hosted | ||
| 295 | + version: "0.5.0" | ||
| 261 | flutter_bugly: | 296 | flutter_bugly: |
| 262 | dependency: "direct main" | 297 | dependency: "direct main" |
| 263 | description: | 298 | description: |
| @@ -271,28 +306,28 @@ packages: | @@ -271,28 +306,28 @@ packages: | ||
| 271 | name: flutter_cache_manager | 306 | name: flutter_cache_manager |
| 272 | url: "https://pub.flutter-io.cn" | 307 | url: "https://pub.flutter-io.cn" |
| 273 | source: hosted | 308 | source: hosted |
| 274 | - version: "1.1.3" | 309 | + version: "1.4.1" |
| 275 | flutter_easyrefresh: | 310 | flutter_easyrefresh: |
| 276 | dependency: "direct main" | 311 | dependency: "direct main" |
| 277 | description: | 312 | description: |
| 278 | name: flutter_easyrefresh | 313 | name: flutter_easyrefresh |
| 279 | url: "https://pub.flutter-io.cn" | 314 | url: "https://pub.flutter-io.cn" |
| 280 | source: hosted | 315 | source: hosted |
| 281 | - version: "2.1.0" | 316 | + version: "2.1.5" |
| 282 | flutter_picker: | 317 | flutter_picker: |
| 283 | dependency: "direct main" | 318 | dependency: "direct main" |
| 284 | description: | 319 | description: |
| 285 | name: flutter_picker | 320 | name: flutter_picker |
| 286 | url: "https://pub.flutter-io.cn" | 321 | url: "https://pub.flutter-io.cn" |
| 287 | source: hosted | 322 | source: hosted |
| 288 | - version: "1.1.3" | 323 | + version: "1.1.5" |
| 289 | flutter_screenutil: | 324 | flutter_screenutil: |
| 290 | dependency: "direct main" | 325 | dependency: "direct main" |
| 291 | description: | 326 | description: |
| 292 | name: flutter_screenutil | 327 | name: flutter_screenutil |
| 293 | url: "https://pub.flutter-io.cn" | 328 | url: "https://pub.flutter-io.cn" |
| 294 | source: hosted | 329 | source: hosted |
| 295 | - version: "1.0.2" | 330 | + version: "1.1.0" |
| 296 | flutter_statusbarcolor: | 331 | flutter_statusbarcolor: |
| 297 | dependency: "direct main" | 332 | dependency: "direct main" |
| 298 | description: | 333 | description: |
| @@ -323,7 +358,7 @@ packages: | @@ -323,7 +358,7 @@ packages: | ||
| 323 | name: fluwx | 358 | name: fluwx |
| 324 | url: "https://pub.flutter-io.cn" | 359 | url: "https://pub.flutter-io.cn" |
| 325 | source: hosted | 360 | source: hosted |
| 326 | - version: "2.0.9" | 361 | + version: "2.3.0" |
| 327 | front_end: | 362 | front_end: |
| 328 | dependency: transitive | 363 | dependency: transitive |
| 329 | description: | 364 | description: |
| @@ -365,7 +400,7 @@ packages: | @@ -365,7 +400,7 @@ packages: | ||
| 365 | name: http | 400 | name: http |
| 366 | url: "https://pub.flutter-io.cn" | 401 | url: "https://pub.flutter-io.cn" |
| 367 | source: hosted | 402 | source: hosted |
| 368 | - version: "0.12.0+4" | 403 | + version: "0.12.2" |
| 369 | http_client_helper: | 404 | http_client_helper: |
| 370 | dependency: transitive | 405 | dependency: transitive |
| 371 | description: | 406 | description: |
| @@ -386,7 +421,7 @@ packages: | @@ -386,7 +421,7 @@ packages: | ||
| 386 | name: http_parser | 421 | name: http_parser |
| 387 | url: "https://pub.flutter-io.cn" | 422 | url: "https://pub.flutter-io.cn" |
| 388 | source: hosted | 423 | source: hosted |
| 389 | - version: "3.1.3" | 424 | + version: "3.1.4" |
| 390 | install_plugin: | 425 | install_plugin: |
| 391 | dependency: "direct main" | 426 | dependency: "direct main" |
| 392 | description: | 427 | description: |
| @@ -407,7 +442,7 @@ packages: | @@ -407,7 +442,7 @@ packages: | ||
| 407 | name: io | 442 | name: io |
| 408 | url: "https://pub.flutter-io.cn" | 443 | url: "https://pub.flutter-io.cn" |
| 409 | source: hosted | 444 | source: hosted |
| 410 | - version: "0.3.3" | 445 | + version: "0.3.4" |
| 411 | jpush_flutter: | 446 | jpush_flutter: |
| 412 | dependency: "direct main" | 447 | dependency: "direct main" |
| 413 | description: | 448 | description: |
| @@ -421,7 +456,7 @@ packages: | @@ -421,7 +456,7 @@ packages: | ||
| 421 | name: js | 456 | name: js |
| 422 | url: "https://pub.flutter-io.cn" | 457 | url: "https://pub.flutter-io.cn" |
| 423 | source: hosted | 458 | source: hosted |
| 424 | - version: "0.6.1+1" | 459 | + version: "0.6.2" |
| 425 | json_annotation: | 460 | json_annotation: |
| 426 | dependency: "direct main" | 461 | dependency: "direct main" |
| 427 | description: | 462 | description: |
| @@ -477,7 +512,7 @@ packages: | @@ -477,7 +512,7 @@ packages: | ||
| 477 | name: mime | 512 | name: mime |
| 478 | url: "https://pub.flutter-io.cn" | 513 | url: "https://pub.flutter-io.cn" |
| 479 | source: hosted | 514 | source: hosted |
| 480 | - version: "0.9.6+3" | 515 | + version: "0.9.7" |
| 481 | nested: | 516 | nested: |
| 482 | dependency: transitive | 517 | dependency: transitive |
| 483 | description: | 518 | description: |
| @@ -491,28 +526,35 @@ packages: | @@ -491,28 +526,35 @@ packages: | ||
| 491 | name: node_interop | 526 | name: node_interop |
| 492 | url: "https://pub.flutter-io.cn" | 527 | url: "https://pub.flutter-io.cn" |
| 493 | source: hosted | 528 | source: hosted |
| 494 | - version: "1.0.3" | 529 | + version: "1.1.1" |
| 495 | node_io: | 530 | node_io: |
| 496 | dependency: transitive | 531 | dependency: transitive |
| 497 | description: | 532 | description: |
| 498 | name: node_io | 533 | name: node_io |
| 499 | url: "https://pub.flutter-io.cn" | 534 | url: "https://pub.flutter-io.cn" |
| 500 | source: hosted | 535 | source: hosted |
| 501 | - version: "1.0.1+2" | 536 | + version: "1.1.1" |
| 537 | + octo_image: | ||
| 538 | + dependency: transitive | ||
| 539 | + description: | ||
| 540 | + name: octo_image | ||
| 541 | + url: "https://pub.flutter-io.cn" | ||
| 542 | + source: hosted | ||
| 543 | + version: "0.2.1" | ||
| 502 | package_config: | 544 | package_config: |
| 503 | dependency: transitive | 545 | dependency: transitive |
| 504 | description: | 546 | description: |
| 505 | name: package_config | 547 | name: package_config |
| 506 | url: "https://pub.flutter-io.cn" | 548 | url: "https://pub.flutter-io.cn" |
| 507 | source: hosted | 549 | source: hosted |
| 508 | - version: "1.9.2" | 550 | + version: "1.9.3" |
| 509 | package_info: | 551 | package_info: |
| 510 | dependency: "direct main" | 552 | dependency: "direct main" |
| 511 | description: | 553 | description: |
| 512 | name: package_info | 554 | name: package_info |
| 513 | url: "https://pub.flutter-io.cn" | 555 | url: "https://pub.flutter-io.cn" |
| 514 | source: hosted | 556 | source: hosted |
| 515 | - version: "0.4.0+18" | 557 | + version: "0.4.3" |
| 516 | package_resolver: | 558 | package_resolver: |
| 517 | dependency: transitive | 559 | dependency: transitive |
| 518 | description: | 560 | description: |
| @@ -533,35 +575,42 @@ packages: | @@ -533,35 +575,42 @@ packages: | ||
| 533 | name: path_provider | 575 | name: path_provider |
| 534 | url: "https://pub.flutter-io.cn" | 576 | url: "https://pub.flutter-io.cn" |
| 535 | source: hosted | 577 | source: hosted |
| 536 | - version: "1.6.5" | 578 | + version: "1.6.14" |
| 579 | + path_provider_linux: | ||
| 580 | + dependency: transitive | ||
| 581 | + description: | ||
| 582 | + name: path_provider_linux | ||
| 583 | + url: "https://pub.flutter-io.cn" | ||
| 584 | + source: hosted | ||
| 585 | + version: "0.0.1+2" | ||
| 537 | path_provider_macos: | 586 | path_provider_macos: |
| 538 | dependency: transitive | 587 | dependency: transitive |
| 539 | description: | 588 | description: |
| 540 | name: path_provider_macos | 589 | name: path_provider_macos |
| 541 | url: "https://pub.flutter-io.cn" | 590 | url: "https://pub.flutter-io.cn" |
| 542 | source: hosted | 591 | source: hosted |
| 543 | - version: "0.0.4" | 592 | + version: "0.0.4+3" |
| 544 | path_provider_platform_interface: | 593 | path_provider_platform_interface: |
| 545 | dependency: transitive | 594 | dependency: transitive |
| 546 | description: | 595 | description: |
| 547 | name: path_provider_platform_interface | 596 | name: path_provider_platform_interface |
| 548 | url: "https://pub.flutter-io.cn" | 597 | url: "https://pub.flutter-io.cn" |
| 549 | source: hosted | 598 | source: hosted |
| 550 | - version: "1.0.1" | 599 | + version: "1.0.3" |
| 551 | pedantic: | 600 | pedantic: |
| 552 | dependency: transitive | 601 | dependency: transitive |
| 553 | description: | 602 | description: |
| 554 | name: pedantic | 603 | name: pedantic |
| 555 | url: "https://pub.flutter-io.cn" | 604 | url: "https://pub.flutter-io.cn" |
| 556 | source: hosted | 605 | source: hosted |
| 557 | - version: "1.8.0+1" | 606 | + version: "1.9.0" |
| 558 | permission_handler: | 607 | permission_handler: |
| 559 | dependency: "direct main" | 608 | dependency: "direct main" |
| 560 | description: | 609 | description: |
| 561 | name: permission_handler | 610 | name: permission_handler |
| 562 | url: "https://pub.flutter-io.cn" | 611 | url: "https://pub.flutter-io.cn" |
| 563 | source: hosted | 612 | source: hosted |
| 564 | - version: "4.4.0" | 613 | + version: "4.4.0+hotfix.4" |
| 565 | permission_handler_platform_interface: | 614 | permission_handler_platform_interface: |
| 566 | dependency: transitive | 615 | dependency: transitive |
| 567 | description: | 616 | description: |
| @@ -576,6 +625,13 @@ packages: | @@ -576,6 +625,13 @@ packages: | ||
| 576 | url: "https://pub.flutter-io.cn" | 625 | url: "https://pub.flutter-io.cn" |
| 577 | source: hosted | 626 | source: hosted |
| 578 | version: "2.2.1" | 627 | version: "2.2.1" |
| 628 | + platform_detect: | ||
| 629 | + dependency: transitive | ||
| 630 | + description: | ||
| 631 | + name: platform_detect | ||
| 632 | + url: "https://pub.flutter-io.cn" | ||
| 633 | + source: hosted | ||
| 634 | + version: "1.4.0" | ||
| 579 | plugin_platform_interface: | 635 | plugin_platform_interface: |
| 580 | dependency: transitive | 636 | dependency: transitive |
| 581 | description: | 637 | description: |
| @@ -590,13 +646,20 @@ packages: | @@ -590,13 +646,20 @@ packages: | ||
| 590 | url: "https://pub.flutter-io.cn" | 646 | url: "https://pub.flutter-io.cn" |
| 591 | source: hosted | 647 | source: hosted |
| 592 | version: "1.4.0" | 648 | version: "1.4.0" |
| 649 | + process: | ||
| 650 | + dependency: transitive | ||
| 651 | + description: | ||
| 652 | + name: process | ||
| 653 | + url: "https://pub.flutter-io.cn" | ||
| 654 | + source: hosted | ||
| 655 | + version: "3.0.13" | ||
| 593 | provider: | 656 | provider: |
| 594 | dependency: "direct main" | 657 | dependency: "direct main" |
| 595 | description: | 658 | description: |
| 596 | name: provider | 659 | name: provider |
| 597 | url: "https://pub.flutter-io.cn" | 660 | url: "https://pub.flutter-io.cn" |
| 598 | source: hosted | 661 | source: hosted |
| 599 | - version: "4.0.4" | 662 | + version: "4.3.2+1" |
| 600 | pub_semver: | 663 | pub_semver: |
| 601 | dependency: transitive | 664 | dependency: transitive |
| 602 | description: | 665 | description: |
| @@ -617,42 +680,56 @@ packages: | @@ -617,42 +680,56 @@ packages: | ||
| 617 | name: quiver | 680 | name: quiver |
| 618 | url: "https://pub.flutter-io.cn" | 681 | url: "https://pub.flutter-io.cn" |
| 619 | source: hosted | 682 | source: hosted |
| 620 | - version: "2.0.5" | 683 | + version: "2.1.3" |
| 684 | + rxdart: | ||
| 685 | + dependency: transitive | ||
| 686 | + description: | ||
| 687 | + name: rxdart | ||
| 688 | + url: "https://pub.flutter-io.cn" | ||
| 689 | + source: hosted | ||
| 690 | + version: "0.24.1" | ||
| 621 | shared_preferences: | 691 | shared_preferences: |
| 622 | dependency: "direct main" | 692 | dependency: "direct main" |
| 623 | description: | 693 | description: |
| 624 | name: shared_preferences | 694 | name: shared_preferences |
| 625 | url: "https://pub.flutter-io.cn" | 695 | url: "https://pub.flutter-io.cn" |
| 626 | source: hosted | 696 | source: hosted |
| 627 | - version: "0.5.6+3" | 697 | + version: "0.5.10" |
| 698 | + shared_preferences_linux: | ||
| 699 | + dependency: transitive | ||
| 700 | + description: | ||
| 701 | + name: shared_preferences_linux | ||
| 702 | + url: "https://pub.flutter-io.cn" | ||
| 703 | + source: hosted | ||
| 704 | + version: "0.0.2+2" | ||
| 628 | shared_preferences_macos: | 705 | shared_preferences_macos: |
| 629 | dependency: transitive | 706 | dependency: transitive |
| 630 | description: | 707 | description: |
| 631 | name: shared_preferences_macos | 708 | name: shared_preferences_macos |
| 632 | url: "https://pub.flutter-io.cn" | 709 | url: "https://pub.flutter-io.cn" |
| 633 | source: hosted | 710 | source: hosted |
| 634 | - version: "0.0.1+6" | 711 | + version: "0.0.1+10" |
| 635 | shared_preferences_platform_interface: | 712 | shared_preferences_platform_interface: |
| 636 | dependency: transitive | 713 | dependency: transitive |
| 637 | description: | 714 | description: |
| 638 | name: shared_preferences_platform_interface | 715 | name: shared_preferences_platform_interface |
| 639 | url: "https://pub.flutter-io.cn" | 716 | url: "https://pub.flutter-io.cn" |
| 640 | source: hosted | 717 | source: hosted |
| 641 | - version: "1.0.3" | 718 | + version: "1.0.4" |
| 642 | shared_preferences_web: | 719 | shared_preferences_web: |
| 643 | dependency: transitive | 720 | dependency: transitive |
| 644 | description: | 721 | description: |
| 645 | name: shared_preferences_web | 722 | name: shared_preferences_web |
| 646 | url: "https://pub.flutter-io.cn" | 723 | url: "https://pub.flutter-io.cn" |
| 647 | source: hosted | 724 | source: hosted |
| 648 | - version: "0.1.2+4" | 725 | + version: "0.1.2+7" |
| 649 | shelf: | 726 | shelf: |
| 650 | dependency: transitive | 727 | dependency: transitive |
| 651 | description: | 728 | description: |
| 652 | name: shelf | 729 | name: shelf |
| 653 | url: "https://pub.flutter-io.cn" | 730 | url: "https://pub.flutter-io.cn" |
| 654 | source: hosted | 731 | source: hosted |
| 655 | - version: "0.7.5" | 732 | + version: "0.7.9" |
| 656 | shelf_web_socket: | 733 | shelf_web_socket: |
| 657 | dependency: transitive | 734 | dependency: transitive |
| 658 | description: | 735 | description: |
| @@ -692,7 +769,14 @@ packages: | @@ -692,7 +769,14 @@ packages: | ||
| 692 | name: sqflite | 769 | name: sqflite |
| 693 | url: "https://pub.flutter-io.cn" | 770 | url: "https://pub.flutter-io.cn" |
| 694 | source: hosted | 771 | source: hosted |
| 695 | - version: "1.2.2+1" | 772 | + version: "1.3.1+1" |
| 773 | + sqflite_common: | ||
| 774 | + dependency: transitive | ||
| 775 | + description: | ||
| 776 | + name: sqflite_common | ||
| 777 | + url: "https://pub.flutter-io.cn" | ||
| 778 | + source: hosted | ||
| 779 | + version: "1.0.2+1" | ||
| 696 | stack_trace: | 780 | stack_trace: |
| 697 | dependency: transitive | 781 | dependency: transitive |
| 698 | description: | 782 | description: |
| @@ -727,7 +811,7 @@ packages: | @@ -727,7 +811,7 @@ packages: | ||
| 727 | name: synchronized | 811 | name: synchronized |
| 728 | url: "https://pub.flutter-io.cn" | 812 | url: "https://pub.flutter-io.cn" |
| 729 | source: hosted | 813 | source: hosted |
| 730 | - version: "2.2.0" | 814 | + version: "2.2.0+2" |
| 731 | table_calendar: | 815 | table_calendar: |
| 732 | dependency: "direct main" | 816 | dependency: "direct main" |
| 733 | description: | 817 | description: |
| @@ -769,35 +853,42 @@ packages: | @@ -769,35 +853,42 @@ packages: | ||
| 769 | name: url_launcher | 853 | name: url_launcher |
| 770 | url: "https://pub.flutter-io.cn" | 854 | url: "https://pub.flutter-io.cn" |
| 771 | source: hosted | 855 | source: hosted |
| 772 | - version: "5.4.2" | 856 | + version: "5.5.2" |
| 857 | + url_launcher_linux: | ||
| 858 | + dependency: transitive | ||
| 859 | + description: | ||
| 860 | + name: url_launcher_linux | ||
| 861 | + url: "https://pub.flutter-io.cn" | ||
| 862 | + source: hosted | ||
| 863 | + version: "0.0.1+1" | ||
| 773 | url_launcher_macos: | 864 | url_launcher_macos: |
| 774 | dependency: transitive | 865 | dependency: transitive |
| 775 | description: | 866 | description: |
| 776 | name: url_launcher_macos | 867 | name: url_launcher_macos |
| 777 | url: "https://pub.flutter-io.cn" | 868 | url: "https://pub.flutter-io.cn" |
| 778 | source: hosted | 869 | source: hosted |
| 779 | - version: "0.0.1+4" | 870 | + version: "0.0.1+7" |
| 780 | url_launcher_platform_interface: | 871 | url_launcher_platform_interface: |
| 781 | dependency: transitive | 872 | dependency: transitive |
| 782 | description: | 873 | description: |
| 783 | name: url_launcher_platform_interface | 874 | name: url_launcher_platform_interface |
| 784 | url: "https://pub.flutter-io.cn" | 875 | url: "https://pub.flutter-io.cn" |
| 785 | source: hosted | 876 | source: hosted |
| 786 | - version: "1.0.6" | 877 | + version: "1.0.8" |
| 787 | url_launcher_web: | 878 | url_launcher_web: |
| 788 | dependency: transitive | 879 | dependency: transitive |
| 789 | description: | 880 | description: |
| 790 | name: url_launcher_web | 881 | name: url_launcher_web |
| 791 | url: "https://pub.flutter-io.cn" | 882 | url: "https://pub.flutter-io.cn" |
| 792 | source: hosted | 883 | source: hosted |
| 793 | - version: "0.1.1+1" | 884 | + version: "0.1.3+1" |
| 794 | uuid: | 885 | uuid: |
| 795 | dependency: transitive | 886 | dependency: transitive |
| 796 | description: | 887 | description: |
| 797 | name: uuid | 888 | name: uuid |
| 798 | url: "https://pub.flutter-io.cn" | 889 | url: "https://pub.flutter-io.cn" |
| 799 | source: hosted | 890 | source: hosted |
| 800 | - version: "2.0.4" | 891 | + version: "2.2.2" |
| 801 | vector_math: | 892 | vector_math: |
| 802 | dependency: transitive | 893 | dependency: transitive |
| 803 | description: | 894 | description: |
| @@ -811,7 +902,7 @@ packages: | @@ -811,7 +902,7 @@ packages: | ||
| 811 | name: watcher | 902 | name: watcher |
| 812 | url: "https://pub.flutter-io.cn" | 903 | url: "https://pub.flutter-io.cn" |
| 813 | source: hosted | 904 | source: hosted |
| 814 | - version: "0.9.7+14" | 905 | + version: "0.9.7+15" |
| 815 | web_socket_channel: | 906 | web_socket_channel: |
| 816 | dependency: "direct main" | 907 | dependency: "direct main" |
| 817 | description: | 908 | description: |
| @@ -819,13 +910,27 @@ packages: | @@ -819,13 +910,27 @@ packages: | ||
| 819 | url: "https://pub.flutter-io.cn" | 910 | url: "https://pub.flutter-io.cn" |
| 820 | source: hosted | 911 | source: hosted |
| 821 | version: "1.1.0" | 912 | version: "1.1.0" |
| 913 | + webview_flutter: | ||
| 914 | + dependency: "direct main" | ||
| 915 | + description: | ||
| 916 | + name: webview_flutter | ||
| 917 | + url: "https://pub.flutter-io.cn" | ||
| 918 | + source: hosted | ||
| 919 | + version: "0.3.22+1" | ||
| 920 | + xdg_directories: | ||
| 921 | + dependency: transitive | ||
| 922 | + description: | ||
| 923 | + name: xdg_directories | ||
| 924 | + url: "https://pub.flutter-io.cn" | ||
| 925 | + source: hosted | ||
| 926 | + version: "0.1.0" | ||
| 822 | yaml: | 927 | yaml: |
| 823 | dependency: transitive | 928 | dependency: transitive |
| 824 | description: | 929 | description: |
| 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.9.0-14.0.dev <3.0.0" | 935 | dart: ">=2.9.0-14.0.dev <3.0.0" |
| 831 | - flutter: ">=1.17.0 <2.0.0" | 936 | + flutter: ">=1.20.0 <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