Showing
11 changed files
with
230 additions
and
93 deletions
| @@ -11,14 +11,14 @@ if (flutterRoot == null) { | @@ -11,14 +11,14 @@ if (flutterRoot == null) { | ||
| 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | -def flutterVersionCode = "291" | 14 | +def flutterVersionCode = "266" |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '291' | 16 | + flutterVersionCode = '266' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | -def flutterVersionName = "2.9.1" | 19 | +def flutterVersionName = "2.6.6" |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '2.9.1' | 21 | + flutterVersionName = '2.6.6' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -43,9 +43,13 @@ PODS: | @@ -43,9 +43,13 @@ PODS: | ||
| 43 | - Flutter (1.0.0) | 43 | - Flutter (1.0.0) |
| 44 | - flutter_app_badger (0.0.1): | 44 | - flutter_app_badger (0.0.1): |
| 45 | - Flutter | 45 | - Flutter |
| 46 | + - flutter_app_update (0.0.1): | ||
| 47 | + - Flutter | ||
| 46 | - flutter_bugly (0.0.1): | 48 | - flutter_bugly (0.0.1): |
| 47 | - Bugly | 49 | - Bugly |
| 48 | - Flutter | 50 | - Flutter |
| 51 | + - flutter_native_image (0.0.1): | ||
| 52 | + - Flutter | ||
| 49 | - flutter_statusbarcolor (0.0.1): | 53 | - flutter_statusbarcolor (0.0.1): |
| 50 | - Flutter | 54 | - Flutter |
| 51 | - fluttertoast (0.0.2): | 55 | - fluttertoast (0.0.2): |
| @@ -71,6 +75,8 @@ PODS: | @@ -71,6 +75,8 @@ PODS: | ||
| 71 | - photo_manager (0.0.1): | 75 | - photo_manager (0.0.1): |
| 72 | - Flutter | 76 | - Flutter |
| 73 | - Reachability (3.2) | 77 | - Reachability (3.2) |
| 78 | + - sendsms (0.0.1): | ||
| 79 | + - Flutter | ||
| 74 | - shared_preferences (0.0.1): | 80 | - shared_preferences (0.0.1): |
| 75 | - Flutter | 81 | - Flutter |
| 76 | - sign_in_with_apple (0.0.1): | 82 | - sign_in_with_apple (0.0.1): |
| @@ -107,7 +113,9 @@ DEPENDENCIES: | @@ -107,7 +113,9 @@ DEPENDENCIES: | ||
| 107 | - easy_contact_picker (from `.symlinks/plugins/easy_contact_picker/ios`) | 113 | - easy_contact_picker (from `.symlinks/plugins/easy_contact_picker/ios`) |
| 108 | - Flutter (from `Flutter`) | 114 | - Flutter (from `Flutter`) |
| 109 | - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`) | 115 | - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`) |
| 116 | + - flutter_app_update (from `.symlinks/plugins/flutter_app_update/ios`) | ||
| 110 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | 117 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) |
| 118 | + - flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`) | ||
| 111 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 119 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| 112 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) | 120 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) |
| 113 | - fluwx (from `.symlinks/plugins/fluwx/ios`) | 121 | - fluwx (from `.symlinks/plugins/fluwx/ios`) |
| @@ -118,6 +126,7 @@ DEPENDENCIES: | @@ -118,6 +126,7 @@ DEPENDENCIES: | ||
| 118 | - path_provider (from `.symlinks/plugins/path_provider/ios`) | 126 | - path_provider (from `.symlinks/plugins/path_provider/ios`) |
| 119 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) | 127 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) |
| 120 | - photo_manager (from `.symlinks/plugins/photo_manager/ios`) | 128 | - photo_manager (from `.symlinks/plugins/photo_manager/ios`) |
| 129 | + - sendsms (from `.symlinks/plugins/sendsms/ios`) | ||
| 121 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) | 130 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) |
| 122 | - sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`) | 131 | - sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`) |
| 123 | - sqflite (from `.symlinks/plugins/sqflite/ios`) | 132 | - sqflite (from `.symlinks/plugins/sqflite/ios`) |
| @@ -165,8 +174,12 @@ EXTERNAL SOURCES: | @@ -165,8 +174,12 @@ EXTERNAL SOURCES: | ||
| 165 | :path: Flutter | 174 | :path: Flutter |
| 166 | flutter_app_badger: | 175 | flutter_app_badger: |
| 167 | :path: ".symlinks/plugins/flutter_app_badger/ios" | 176 | :path: ".symlinks/plugins/flutter_app_badger/ios" |
| 177 | + flutter_app_update: | ||
| 178 | + :path: ".symlinks/plugins/flutter_app_update/ios" | ||
| 168 | flutter_bugly: | 179 | flutter_bugly: |
| 169 | :path: ".symlinks/plugins/flutter_bugly/ios" | 180 | :path: ".symlinks/plugins/flutter_bugly/ios" |
| 181 | + flutter_native_image: | ||
| 182 | + :path: ".symlinks/plugins/flutter_native_image/ios" | ||
| 170 | flutter_statusbarcolor: | 183 | flutter_statusbarcolor: |
| 171 | :path: ".symlinks/plugins/flutter_statusbarcolor/ios" | 184 | :path: ".symlinks/plugins/flutter_statusbarcolor/ios" |
| 172 | fluttertoast: | 185 | fluttertoast: |
| @@ -187,6 +200,8 @@ EXTERNAL SOURCES: | @@ -187,6 +200,8 @@ EXTERNAL SOURCES: | ||
| 187 | :path: ".symlinks/plugins/permission_handler/ios" | 200 | :path: ".symlinks/plugins/permission_handler/ios" |
| 188 | photo_manager: | 201 | photo_manager: |
| 189 | :path: ".symlinks/plugins/photo_manager/ios" | 202 | :path: ".symlinks/plugins/photo_manager/ios" |
| 203 | + sendsms: | ||
| 204 | + :path: ".symlinks/plugins/sendsms/ios" | ||
| 190 | shared_preferences: | 205 | shared_preferences: |
| 191 | :path: ".symlinks/plugins/shared_preferences/ios" | 206 | :path: ".symlinks/plugins/shared_preferences/ios" |
| 192 | sign_in_with_apple: | 207 | sign_in_with_apple: |
| @@ -224,7 +239,9 @@ SPEC CHECKSUMS: | @@ -224,7 +239,9 @@ SPEC CHECKSUMS: | ||
| 224 | easy_contact_picker: 9ab9dc70e8ddde6e76a19ffc482d7bf899868730 | 239 | easy_contact_picker: 9ab9dc70e8ddde6e76a19ffc482d7bf899868730 |
| 225 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c | 240 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c |
| 226 | flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68 | 241 | flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68 |
| 242 | + flutter_app_update: 65f61da626cb111d1b24674abc4b01728d7723bc | ||
| 227 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | 243 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 |
| 244 | + flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe | ||
| 228 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 245 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| 229 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b | 246 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b |
| 230 | fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 | 247 | fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 |
| @@ -237,6 +254,7 @@ SPEC CHECKSUMS: | @@ -237,6 +254,7 @@ SPEC CHECKSUMS: | ||
| 237 | permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 | 254 | permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 |
| 238 | photo_manager: f7c619c2cc8c2adb8d85c63363babac477de9c67 | 255 | photo_manager: f7c619c2cc8c2adb8d85c63363babac477de9c67 |
| 239 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | 256 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 |
| 257 | + sendsms: 4065f76018b22a3e6987b4630f161feab95cef23 | ||
| 240 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | 258 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d |
| 241 | sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a | 259 | sign_in_with_apple: 34f3f5456a45fd7ac5fb42905e2ad31dae061b4a |
| 242 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 | 260 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 |
| @@ -308,6 +308,8 @@ | @@ -308,6 +308,8 @@ | ||
| 308 | "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", | 308 | "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework", |
| 309 | "${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework", | 309 | "${BUILT_PRODUCTS_DIR}/easy_contact_picker/easy_contact_picker.framework", |
| 310 | "${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework", | 310 | "${BUILT_PRODUCTS_DIR}/flutter_app_badger/flutter_app_badger.framework", |
| 311 | + "${BUILT_PRODUCTS_DIR}/flutter_app_update/flutter_app_update.framework", | ||
| 312 | + "${BUILT_PRODUCTS_DIR}/flutter_native_image/flutter_native_image.framework", | ||
| 311 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", | 313 | "${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework", |
| 312 | "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", | 314 | "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", |
| 313 | "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", | 315 | "${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework", |
| @@ -315,6 +317,7 @@ | @@ -315,6 +317,7 @@ | ||
| 315 | "${BUILT_PRODUCTS_DIR}/package_info/package_info.framework", | 317 | "${BUILT_PRODUCTS_DIR}/package_info/package_info.framework", |
| 316 | "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", | 318 | "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework", |
| 317 | "${BUILT_PRODUCTS_DIR}/photo_manager/photo_manager.framework", | 319 | "${BUILT_PRODUCTS_DIR}/photo_manager/photo_manager.framework", |
| 320 | + "${BUILT_PRODUCTS_DIR}/sendsms/sendsms.framework", | ||
| 318 | "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", | 321 | "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", |
| 319 | "${BUILT_PRODUCTS_DIR}/sign_in_with_apple/sign_in_with_apple.framework", | 322 | "${BUILT_PRODUCTS_DIR}/sign_in_with_apple/sign_in_with_apple.framework", |
| 320 | "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", | 323 | "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", |
| @@ -334,6 +337,8 @@ | @@ -334,6 +337,8 @@ | ||
| 334 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", | 337 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework", |
| 335 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework", | 338 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/easy_contact_picker.framework", |
| 336 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework", | 339 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_badger.framework", |
| 340 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_app_update.framework", | ||
| 341 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_native_image.framework", | ||
| 337 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", | 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework", |
| 338 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", | 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", |
| 339 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", | 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework", |
| @@ -341,6 +346,7 @@ | @@ -341,6 +346,7 @@ | ||
| 341 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework", | 346 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework", |
| 342 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework", | 347 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework", |
| 343 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/photo_manager.framework", | 348 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/photo_manager.framework", |
| 349 | + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sendsms.framework", | ||
| 344 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", | 350 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", |
| 345 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sign_in_with_apple.framework", | 351 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sign_in_with_apple.framework", |
| 346 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", | 352 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", |
| @@ -473,10 +479,10 @@ | @@ -473,10 +479,10 @@ | ||
| 473 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 479 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 474 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | 480 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
| 475 | CODE_SIGN_STYLE = Automatic; | 481 | CODE_SIGN_STYLE = Automatic; |
| 476 | - CURRENT_PROJECT_VERSION = 279; | 482 | + CURRENT_PROJECT_VERSION = 260; |
| 477 | DEVELOPMENT_TEAM = 8J59HM8B82; | 483 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 478 | ENABLE_BITCODE = NO; | 484 | ENABLE_BITCODE = NO; |
| 479 | - FLUTTER_BUILD_MODE = release; | 485 | + FLUTTER_BUILD_MODE = debug; |
| 480 | FRAMEWORK_SEARCH_PATHS = ( | 486 | FRAMEWORK_SEARCH_PATHS = ( |
| 481 | "$(inherited)", | 487 | "$(inherited)", |
| 482 | "$(PROJECT_DIR)/Flutter", | 488 | "$(PROJECT_DIR)/Flutter", |
| @@ -488,7 +494,7 @@ | @@ -488,7 +494,7 @@ | ||
| 488 | "$(inherited)", | 494 | "$(inherited)", |
| 489 | "$(PROJECT_DIR)/Flutter", | 495 | "$(PROJECT_DIR)/Flutter", |
| 490 | ); | 496 | ); |
| 491 | - MARKETING_VERSION = 2.8.0; | 497 | + MARKETING_VERSION = 2.6.6; |
| 492 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 498 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 493 | PRODUCT_NAME = Runner; | 499 | PRODUCT_NAME = Runner; |
| 494 | PROVISIONING_PROFILE_SPECIFIER = ""; | 500 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -618,10 +624,10 @@ | @@ -618,10 +624,10 @@ | ||
| 618 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; | 624 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; |
| 619 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 625 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 620 | CODE_SIGN_STYLE = Automatic; | 626 | CODE_SIGN_STYLE = Automatic; |
| 621 | - CURRENT_PROJECT_VERSION = 279; | 627 | + CURRENT_PROJECT_VERSION = 260; |
| 622 | DEVELOPMENT_TEAM = 8J59HM8B82; | 628 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 623 | ENABLE_BITCODE = NO; | 629 | ENABLE_BITCODE = NO; |
| 624 | - FLUTTER_BUILD_MODE = release; | 630 | + FLUTTER_BUILD_MODE = debug; |
| 625 | FRAMEWORK_SEARCH_PATHS = ( | 631 | FRAMEWORK_SEARCH_PATHS = ( |
| 626 | "$(inherited)", | 632 | "$(inherited)", |
| 627 | "$(PROJECT_DIR)/Flutter", | 633 | "$(PROJECT_DIR)/Flutter", |
| @@ -633,7 +639,7 @@ | @@ -633,7 +639,7 @@ | ||
| 633 | "$(inherited)", | 639 | "$(inherited)", |
| 634 | "$(PROJECT_DIR)/Flutter", | 640 | "$(PROJECT_DIR)/Flutter", |
| 635 | ); | 641 | ); |
| 636 | - MARKETING_VERSION = 2.8.0; | 642 | + MARKETING_VERSION = 2.6.6; |
| 637 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 643 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 638 | PRODUCT_NAME = Runner; | 644 | PRODUCT_NAME = Runner; |
| 639 | PROVISIONING_PROFILE_SPECIFIER = ""; | 645 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -653,7 +659,7 @@ | @@ -653,7 +659,7 @@ | ||
| 653 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 659 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 654 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 660 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 655 | CODE_SIGN_STYLE = Automatic; | 661 | CODE_SIGN_STYLE = Automatic; |
| 656 | - CURRENT_PROJECT_VERSION = 279; | 662 | + CURRENT_PROJECT_VERSION = 260; |
| 657 | DEVELOPMENT_TEAM = 8J59HM8B82; | 663 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 658 | ENABLE_BITCODE = NO; | 664 | ENABLE_BITCODE = NO; |
| 659 | FLUTTER_BUILD_MODE = release; | 665 | FLUTTER_BUILD_MODE = release; |
| @@ -668,7 +674,7 @@ | @@ -668,7 +674,7 @@ | ||
| 668 | "$(inherited)", | 674 | "$(inherited)", |
| 669 | "$(PROJECT_DIR)/Flutter", | 675 | "$(PROJECT_DIR)/Flutter", |
| 670 | ); | 676 | ); |
| 671 | - MARKETING_VERSION = 2.8.0; | 677 | + MARKETING_VERSION = 2.6.6; |
| 672 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 678 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 673 | PRODUCT_NAME = Runner; | 679 | PRODUCT_NAME = Runner; |
| 674 | PROVISIONING_PROFILE_SPECIFIER = ""; | 680 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -1122,7 +1122,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -1122,7 +1122,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 1122 | } else { | 1122 | } else { |
| 1123 | fullName = contact.fullName; | 1123 | fullName = contact.fullName; |
| 1124 | } | 1124 | } |
| 1125 | - _notebookDetailChangeModel.phoneController.text = contact.phoneNumber; | 1125 | + _notebookDetailChangeModel.phoneController.text = |
| 1126 | + contact.phoneNumber.replaceAll(new RegExp(r"\s+"), ""); | ||
| 1126 | // _notebookDetailChangeModel.nameController.text = fullName; | 1127 | // _notebookDetailChangeModel.nameController.text = fullName; |
| 1127 | nameStr = fullName; | 1128 | nameStr = fullName; |
| 1128 | _addNameSuffix(fullName, _nameSuffix()); | 1129 | _addNameSuffix(fullName, _nameSuffix()); |
| @@ -4,6 +4,7 @@ import 'dart:io'; | @@ -4,6 +4,7 @@ import 'dart:io'; | ||
| 4 | import 'package:common_utils/common_utils.dart'; | 4 | import 'package:common_utils/common_utils.dart'; |
| 5 | import 'package:flutter/cupertino.dart'; | 5 | import 'package:flutter/cupertino.dart'; |
| 6 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 7 | +import 'package:flutter_app_update/azhon_app_update.dart'; | ||
| 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | import 'package:one_key/app.dart'; | 9 | import 'package:one_key/app.dart'; |
| 9 | import 'package:one_key/pages/home_enter_order/home_enter_order.dart'; | 10 | import 'package:one_key/pages/home_enter_order/home_enter_order.dart'; |
| @@ -59,12 +60,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -59,12 +60,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 59 | 60 | ||
| 60 | DateTime lastBack; | 61 | DateTime lastBack; |
| 61 | PageController _pageController; | 62 | PageController _pageController; |
| 63 | + bool needUpdate = true; | ||
| 62 | 64 | ||
| 63 | @override | 65 | @override |
| 64 | void initState() { | 66 | void initState() { |
| 65 | // TODO: implement initState | 67 | // TODO: implement initState |
| 66 | super.initState(); | 68 | super.initState(); |
| 67 | LogUtil.v("home_initState"); | 69 | LogUtil.v("home_initState"); |
| 70 | + AzhonAppUpdate.listener((map) { | ||
| 71 | + needUpdate = false; | ||
| 72 | + print(map['type']); | ||
| 73 | + }); | ||
| 68 | WidgetsBinding.instance.addObserver(this); | 74 | WidgetsBinding.instance.addObserver(this); |
| 69 | _currIndex = widget.initialIndex; | 75 | _currIndex = widget.initialIndex; |
| 70 | _pageController = PageController(initialPage: _currIndex); | 76 | _pageController = PageController(initialPage: _currIndex); |
| @@ -100,8 +106,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -100,8 +106,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 100 | _getIntent(); | 106 | _getIntent(); |
| 101 | Future.delayed(Duration(milliseconds: 30000), () { | 107 | Future.delayed(Duration(milliseconds: 30000), () { |
| 102 | ContactModel.getInstance().uploadLocalContact(context); | 108 | ContactModel.getInstance().uploadLocalContact(context); |
| 103 | - UpdateModel updateModel = new UpdateModel(); | ||
| 104 | - updateModel.checkUpdate(context, showToast: false); | 109 | + if (needUpdate) { |
| 110 | + UpdateModelMy updateModel = new UpdateModelMy(); | ||
| 111 | + updateModel.checkUpdate(context, (version) { | ||
| 112 | + updateModel.showUpdateDialog(context, version); | ||
| 113 | + }, showToast: false); | ||
| 114 | + } | ||
| 105 | }); | 115 | }); |
| 106 | timer = Timer.periodic(Duration(minutes: 3), (_) { | 116 | timer = Timer.periodic(Duration(minutes: 3), (_) { |
| 107 | _getAllUnMessages(); | 117 | _getAllUnMessages(); |
| @@ -447,8 +457,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -447,8 +457,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 447 | bool _getUnMsgNum() { | 457 | bool _getUnMsgNum() { |
| 448 | MessageModel messageModel = | 458 | MessageModel messageModel = |
| 449 | Provider.of<MessageModel>(context, listen: true); | 459 | Provider.of<MessageModel>(context, listen: true); |
| 450 | - if ( | ||
| 451 | - messageModel.onlineTotal + | 460 | + if (messageModel.onlineTotal + |
| 452 | messageModel.orderTotal + | 461 | messageModel.orderTotal + |
| 453 | messageModel.checkTotal > | 462 | messageModel.checkTotal > |
| 454 | 0) { | 463 | 0) { |
| @@ -1313,7 +1313,8 @@ class _HomeEnterPageState extends State<HomeEnterPage> | @@ -1313,7 +1313,8 @@ class _HomeEnterPageState extends State<HomeEnterPage> | ||
| 1313 | } else { | 1313 | } else { |
| 1314 | fullName = contact.fullName; | 1314 | fullName = contact.fullName; |
| 1315 | } | 1315 | } |
| 1316 | - _homeEnterModel.phoneController.text = contact.phoneNumber; | 1316 | + _homeEnterModel.phoneController.text = |
| 1317 | + contact.phoneNumber.replaceAll(new RegExp(r"\s+"), ""); | ||
| 1317 | nameStr = fullName; | 1318 | nameStr = fullName; |
| 1318 | // _homeEnterModel.nameController.text = fullName + _nameSuffix(); | 1319 | // _homeEnterModel.nameController.text = fullName + _nameSuffix(); |
| 1319 | _addNameSuffix(fullName, _nameSuffix()); | 1320 | _addNameSuffix(fullName, _nameSuffix()); |
| @@ -114,8 +114,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -114,8 +114,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 114 | super.didChangeDependencies(); | 114 | super.didChangeDependencies(); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | - | ||
| 118 | - | ||
| 119 | //监听输入框,设置登录按钮状态 | 117 | //监听输入框,设置登录按钮状态 |
| 120 | setActivate() { | 118 | setActivate() { |
| 121 | if (_sellerCodeController.text.isNotEmpty && | 119 | if (_sellerCodeController.text.isNotEmpty && |
| @@ -418,40 +416,48 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -418,40 +416,48 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 418 | width: prefixIconWidth, | 416 | width: prefixIconWidth, |
| 419 | ), | 417 | ), |
| 420 | HEmptyView(26), | 418 | HEmptyView(26), |
| 421 | - Text( | 419 | + Center( |
| 420 | + child: Text( | ||
| 422 | "商户编号", | 421 | "商户编号", |
| 423 | style: TextStyle( | 422 | style: TextStyle( |
| 424 | color: MyColours.color_353535, | 423 | color: MyColours.color_353535, |
| 425 | fontSize: ScreenUtil().setSp(28)), | 424 | fontSize: ScreenUtil().setSp(28)), |
| 426 | - ), | 425 | + )), |
| 427 | Expanded( | 426 | Expanded( |
| 428 | - child: TextField( | ||
| 429 | - controller: _sellerCodeController, | ||
| 430 | - focusNode: _sellerCodeFocusNode, | ||
| 431 | - // autofocus: _sellerCodeController.text.isEmpty, | ||
| 432 | - style: TextStyle( | ||
| 433 | - color: MyColours.color_353535, | ||
| 434 | - fontSize: ScreenUtil().setSp(28), | ||
| 435 | - textBaseline: TextBaseline.alphabetic), | ||
| 436 | - textAlignVertical: TextAlignVertical.center, | ||
| 437 | - decoration: InputDecoration( | ||
| 438 | - hintText: "请输入6位商户编码", | ||
| 439 | - hintStyle: TextStyle( | ||
| 440 | - color: MyColours.color_c1c1c1, | ||
| 441 | - fontSize: ScreenUtil().setSp(28), | ||
| 442 | - ), | ||
| 443 | - border: InputBorder.none, | ||
| 444 | - contentPadding: EdgeInsets.symmetric( | ||
| 445 | - horizontal: 10, vertical: 14), | ||
| 446 | - ), | ||
| 447 | - onChanged: (_) { | ||
| 448 | - setActivate(); | ||
| 449 | - }, | ||
| 450 | - keyboardType: TextInputType.number, | ||
| 451 | - ), | 427 | + child: Container( |
| 428 | + height: ScreenUtil().setHeight(84), | ||
| 429 | + padding: EdgeInsets.only( | ||
| 430 | + left: ScreenUtil().setWidth(20), | ||
| 431 | + right: ScreenUtil().setWidth(20), | ||
| 432 | + top: ScreenUtil().setWidth(8)), | ||
| 433 | + child: TextField( | ||
| 434 | + controller: _sellerCodeController, | ||
| 435 | + focusNode: _sellerCodeFocusNode, | ||
| 436 | + // autofocus: _sellerCodeController.text.isEmpty, | ||
| 437 | + style: TextStyle( | ||
| 438 | + color: MyColours.color_353535, | ||
| 439 | + fontSize: ScreenUtil().setSp(28), | ||
| 440 | + textBaseline: TextBaseline.alphabetic), | ||
| 441 | + // textAlignVertical: TextAlignVertical.center, | ||
| 442 | + decoration: InputDecoration( | ||
| 443 | + hintText: "请输入6位商户编码", | ||
| 444 | + hintStyle: TextStyle( | ||
| 445 | + color: MyColours.color_c1c1c1, | ||
| 446 | + fontSize: ScreenUtil().setSp(28), | ||
| 447 | + ), | ||
| 448 | + border: OutlineInputBorder( | ||
| 449 | + borderSide: BorderSide.none), | ||
| 450 | + contentPadding: EdgeInsets.zero, | ||
| 451 | + ), | ||
| 452 | + onChanged: (_) { | ||
| 453 | + setActivate(); | ||
| 454 | + }, | ||
| 455 | + keyboardType: TextInputType.number, | ||
| 456 | + )), | ||
| 452 | ) | 457 | ) |
| 453 | ], | 458 | ], |
| 454 | )), | 459 | )), |
| 460 | + | ||
| 455 | Container( | 461 | Container( |
| 456 | height: ScreenUtil().setHeight(84), | 462 | height: ScreenUtil().setHeight(84), |
| 457 | width: ScreenUtil().setWidth(611), | 463 | width: ScreenUtil().setWidth(611), |
| @@ -479,6 +485,12 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -479,6 +485,12 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 479 | fontSize: ScreenUtil().setSp(28)), | 485 | fontSize: ScreenUtil().setSp(28)), |
| 480 | ), | 486 | ), |
| 481 | Expanded( | 487 | Expanded( |
| 488 | + child: Container( | ||
| 489 | + height: ScreenUtil().setHeight(84), | ||
| 490 | + padding: EdgeInsets.only( | ||
| 491 | + left: ScreenUtil().setWidth(20), | ||
| 492 | + right: ScreenUtil().setWidth(20), | ||
| 493 | + top: ScreenUtil().setWidth(8)), | ||
| 482 | child: TextField( | 494 | child: TextField( |
| 483 | controller: _accountController, | 495 | controller: _accountController, |
| 484 | focusNode: _accountFocusNode, | 496 | focusNode: _accountFocusNode, |
| @@ -490,16 +502,16 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -490,16 +502,16 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 490 | hintStyle: TextStyle( | 502 | hintStyle: TextStyle( |
| 491 | color: MyColours.color_c1c1c1, | 503 | color: MyColours.color_c1c1c1, |
| 492 | fontSize: ScreenUtil().setSp(28)), | 504 | fontSize: ScreenUtil().setSp(28)), |
| 493 | - border: InputBorder.none, | ||
| 494 | - contentPadding: EdgeInsets.symmetric( | ||
| 495 | - horizontal: 10, vertical: 14), | 505 | + border: OutlineInputBorder( |
| 506 | + borderSide: BorderSide.none), | ||
| 507 | + contentPadding: EdgeInsets.zero, | ||
| 496 | ), | 508 | ), |
| 497 | onChanged: (_) { | 509 | onChanged: (_) { |
| 498 | setActivate(); | 510 | setActivate(); |
| 499 | }, | 511 | }, |
| 500 | keyboardType: TextInputType.number, | 512 | keyboardType: TextInputType.number, |
| 501 | ), | 513 | ), |
| 502 | - ) | 514 | + )) |
| 503 | ], | 515 | ], |
| 504 | )), | 516 | )), |
| 505 | Container( | 517 | Container( |
| @@ -531,30 +543,36 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -531,30 +543,36 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 531 | fontSize: ScreenUtil().setSp(28)), | 543 | fontSize: ScreenUtil().setSp(28)), |
| 532 | ), | 544 | ), |
| 533 | Expanded( | 545 | Expanded( |
| 534 | - child: TextField( | ||
| 535 | - controller: _pwdController, | ||
| 536 | - focusNode: _pwdFocusNode, | ||
| 537 | - // autofocus: _sellerCodeController.text.isNotEmpty && | ||
| 538 | - // _accountController.text.isNotEmpty && | ||
| 539 | - // _pwdController.text.isEmpty, | ||
| 540 | - style: TextStyle( | ||
| 541 | - color: MyColours.color_353535, | ||
| 542 | - fontSize: ScreenUtil().setSp(28)), | ||
| 543 | - decoration: InputDecoration( | ||
| 544 | - hintText: "请输入密码", | ||
| 545 | - hintStyle: TextStyle( | ||
| 546 | - color: MyColours.color_c1c1c1, | ||
| 547 | - fontSize: ScreenUtil().setSp(28)), | ||
| 548 | - border: InputBorder.none, | ||
| 549 | - contentPadding: EdgeInsets.symmetric( | ||
| 550 | - horizontal: 10, vertical: 14), | ||
| 551 | - ), | ||
| 552 | - onChanged: (_) { | ||
| 553 | - setActivate(); | ||
| 554 | - }, | ||
| 555 | - obscureText: obscureText, | ||
| 556 | - keyboardType: TextInputType.text, | ||
| 557 | - ), | 546 | + child: Container( |
| 547 | + height: ScreenUtil().setHeight(84), | ||
| 548 | + padding: EdgeInsets.only( | ||
| 549 | + left: ScreenUtil().setWidth(20), | ||
| 550 | + right: ScreenUtil().setWidth(20), | ||
| 551 | + top: ScreenUtil().setWidth(8)), | ||
| 552 | + child: TextField( | ||
| 553 | + controller: _pwdController, | ||
| 554 | + focusNode: _pwdFocusNode, | ||
| 555 | + // autofocus: _sellerCodeController.text.isNotEmpty && | ||
| 556 | + // _accountController.text.isNotEmpty && | ||
| 557 | + // _pwdController.text.isEmpty, | ||
| 558 | + style: TextStyle( | ||
| 559 | + color: MyColours.color_353535, | ||
| 560 | + fontSize: ScreenUtil().setSp(28)), | ||
| 561 | + decoration: InputDecoration( | ||
| 562 | + hintText: "请输入密码", | ||
| 563 | + hintStyle: TextStyle( | ||
| 564 | + color: MyColours.color_c1c1c1, | ||
| 565 | + fontSize: ScreenUtil().setSp(28)), | ||
| 566 | + border: OutlineInputBorder( | ||
| 567 | + borderSide: BorderSide.none), | ||
| 568 | + contentPadding: EdgeInsets.zero, | ||
| 569 | + ), | ||
| 570 | + onChanged: (_) { | ||
| 571 | + setActivate(); | ||
| 572 | + }, | ||
| 573 | + obscureText: obscureText, | ||
| 574 | + keyboardType: TextInputType.text, | ||
| 575 | + )), | ||
| 558 | ), | 576 | ), |
| 559 | GestureDetector( | 577 | GestureDetector( |
| 560 | child: Padding( | 578 | child: Padding( |
| @@ -575,6 +593,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | @@ -575,6 +593,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { | ||
| 575 | ) | 593 | ) |
| 576 | ], | 594 | ], |
| 577 | )), | 595 | )), |
| 596 | + | ||
| 578 | Container( | 597 | Container( |
| 579 | width: ScreenUtil().setWidth(611), | 598 | width: ScreenUtil().setWidth(611), |
| 580 | margin: EdgeInsets.only(top: ScreenUtil().setHeight(16)), | 599 | margin: EdgeInsets.only(top: ScreenUtil().setHeight(16)), |
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | ||
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | import 'package:fluwx/fluwx.dart'; | 3 | import 'package:fluwx/fluwx.dart'; |
| 4 | import 'package:one_key/models/sms_info.dart'; | 4 | import 'package:one_key/models/sms_info.dart'; |
| 5 | +import 'package:one_key/models/version.dart'; | ||
| 5 | import 'package:one_key/provider/my_model.dart'; | 6 | import 'package:one_key/provider/my_model.dart'; |
| 6 | import 'package:one_key/provider/update_model.dart'; | 7 | import 'package:one_key/provider/update_model.dart'; |
| 7 | import 'package:one_key/provider/user_model.dart'; | 8 | import 'package:one_key/provider/user_model.dart'; |
| @@ -32,6 +33,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -32,6 +33,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 32 | bool newVersion = false; | 33 | bool newVersion = false; |
| 33 | MyModel myModel; | 34 | MyModel myModel; |
| 34 | ScrollController controller; | 35 | ScrollController controller; |
| 36 | + Version _version; | ||
| 35 | 37 | ||
| 36 | @override | 38 | @override |
| 37 | void initState() { | 39 | void initState() { |
| @@ -49,9 +51,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -49,9 +51,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 49 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 51 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 50 | ///获取短信余量 | 52 | ///获取短信余量 |
| 51 | _getSmsInfo(context); | 53 | _getSmsInfo(context); |
| 52 | - _getMyIntegral(context); | ||
| 53 | 54 | ||
| 54 | ///获取积分 | 55 | ///获取积分 |
| 56 | + _getMyIntegral(context); | ||
| 57 | + | ||
| 58 | + ///apk版本检测 | ||
| 59 | + checkUpdate(); | ||
| 55 | }); | 60 | }); |
| 56 | EventBus().on('changeStatusColor', (arg) { | 61 | EventBus().on('changeStatusColor', (arg) { |
| 57 | Utils.changeStatusColor(color: MyColours.color_199095); | 62 | Utils.changeStatusColor(color: MyColours.color_199095); |
| @@ -106,8 +111,14 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -106,8 +111,14 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 106 | 111 | ||
| 107 | //检查版本更新 | 112 | //检查版本更新 |
| 108 | checkUpdate() { | 113 | checkUpdate() { |
| 109 | - UpdateModel updateModel = new UpdateModel(); | ||
| 110 | - updateModel.checkUpdate(context); | 114 | + UpdateModelMy updateModel = new UpdateModelMy(); |
| 115 | + updateModel.checkUpdate(context, (version) { | ||
| 116 | + _version = version; | ||
| 117 | + setState(() { | ||
| 118 | + newVersion = true; | ||
| 119 | + }); | ||
| 120 | + // updateModel.showUpdateDialog(context, version); | ||
| 121 | + }); | ||
| 111 | } | 122 | } |
| 112 | 123 | ||
| 113 | @override | 124 | @override |
| @@ -372,7 +383,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -372,7 +383,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 372 | MyDivider(double.infinity, ScreenUtil().setHeight(1), | 383 | MyDivider(double.infinity, ScreenUtil().setHeight(1), |
| 373 | color: MyColours.color_f3f3f3), | 384 | color: MyColours.color_f3f3f3), |
| 374 | GestureDetector( | 385 | GestureDetector( |
| 375 | - onTap: checkUpdate, | 386 | + onTap: () { |
| 387 | + if (newVersion) { | ||
| 388 | + UpdateModelMy updateModel = new UpdateModelMy(); | ||
| 389 | + updateModel.showUpdateDialog(context, _version); | ||
| 390 | + } | ||
| 391 | + }, | ||
| 376 | child: Container( | 392 | child: Container( |
| 377 | width: double.infinity, | 393 | width: double.infinity, |
| 378 | height: ScreenUtil().setHeight(122), | 394 | height: ScreenUtil().setHeight(122), |
| @@ -391,7 +407,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -391,7 +407,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 391 | Spacer(), | 407 | Spacer(), |
| 392 | newVersion | 408 | newVersion |
| 393 | ? Container( | 409 | ? Container( |
| 394 | - width: ScreenUtil().setWidth(120), | 410 | + // width: ScreenUtil().setWidth(120), |
| 395 | height: ScreenUtil().setWidth(34), | 411 | height: ScreenUtil().setWidth(34), |
| 396 | decoration: BoxDecoration( | 412 | decoration: BoxDecoration( |
| 397 | color: MyColours.color_E14553, | 413 | color: MyColours.color_E14553, |
| @@ -399,14 +415,17 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -399,14 +415,17 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 399 | Radius.circular( | 415 | Radius.circular( |
| 400 | ScreenUtil().setWidth(6))), | 416 | ScreenUtil().setWidth(6))), |
| 401 | ), | 417 | ), |
| 402 | - child: Center( | ||
| 403 | - child: Text( | ||
| 404 | - "发现新版本", | ||
| 405 | - style: TextStyle( | ||
| 406 | - fontSize: ScreenUtil().setSp(24), | ||
| 407 | - color: MyColours.color_ffffff), | ||
| 408 | - ), | ||
| 409 | - ), | 418 | + child: Padding( |
| 419 | + padding: EdgeInsets.symmetric( | ||
| 420 | + horizontal: ScreenUtil().setWidth(8)), | ||
| 421 | + child: Center( | ||
| 422 | + child: Text( | ||
| 423 | + "发现新版本", | ||
| 424 | + style: TextStyle( | ||
| 425 | + fontSize: ScreenUtil().setSp(24), | ||
| 426 | + color: MyColours.color_ffffff), | ||
| 427 | + ), | ||
| 428 | + )), | ||
| 410 | ) | 429 | ) |
| 411 | : Text( | 430 | : Text( |
| 412 | cur_version, | 431 | cur_version, |
| @@ -17,18 +17,52 @@ import 'package:one_key/res/colors.dart'; | @@ -17,18 +17,52 @@ import 'package:one_key/res/colors.dart'; | ||
| 17 | import 'package:one_key/utils/utils.dart'; | 17 | import 'package:one_key/utils/utils.dart'; |
| 18 | import 'package:one_key/widgets/MyDivider.dart'; | 18 | import 'package:one_key/widgets/MyDivider.dart'; |
| 19 | import 'package:one_key/widgets/v_empty_view.dart'; | 19 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 20 | +import 'package:ota_update/ota_update.dart'; | ||
| 20 | import 'package:path_provider/path_provider.dart'; | 21 | import 'package:path_provider/path_provider.dart'; |
| 21 | import 'package:permission_handler/permission_handler.dart'; | 22 | import 'package:permission_handler/permission_handler.dart'; |
| 22 | import 'package:provider/provider.dart'; | 23 | import 'package:provider/provider.dart'; |
| 24 | +import 'package:flutter_app_update/azhon_app_update.dart'; | ||
| 25 | +import 'package:flutter_app_update/update_model.dart'; | ||
| 23 | 26 | ||
| 24 | -class UpdateModel { | 27 | +typedef VeisonCallback = void Function(Version value); |
| 28 | + | ||
| 29 | +class UpdateModelMy { | ||
| 25 | int _progress = 1; //下载进度 | 30 | int _progress = 1; //下载进度 |
| 26 | Function _setState; | 31 | Function _setState; |
| 32 | + | ||
| 33 | + Future<void> tryOtaUpdate(String url) async { | ||
| 34 | + try { | ||
| 35 | + OtaUpdate().execute(url, destinationFilename: '周到安排.apk').listen( | ||
| 36 | + (OtaEvent event) { | ||
| 37 | + // setState(() => currentEvent = event); | ||
| 38 | + // if(event) | ||
| 39 | + print('${event.status} : ${event.value}'); | ||
| 40 | + }, | ||
| 41 | + ); | ||
| 42 | + } catch (e) { | ||
| 43 | + print('Failed to make OTA update. Details: $e'); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + ///简单使用 | ||
| 48 | + simpleUse(bool showiOSDialog, String url) { | ||
| 49 | + UpdateModel model = UpdateModel( | ||
| 50 | + url, | ||
| 51 | + "yjd.apk", | ||
| 52 | + "ic_launcher", | ||
| 53 | + "1.支持Android M N O P Q\n2.支持自定义下载过程\n3.支持 设备>=Android M 动态权限的申请\n4.支持通知栏进度条展示\n5.支持文字国际化", | ||
| 54 | + iOSUrl: 'itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490', | ||
| 55 | + showiOSDialog: showiOSDialog, | ||
| 56 | + ); | ||
| 57 | + AzhonAppUpdate.update(model).then((value) => print(value)); | ||
| 58 | + } | ||
| 59 | + | ||
| 27 | //检查更新 | 60 | //检查更新 |
| 28 | - checkUpdate(BuildContext context, {showToast = true}) async { | 61 | + checkUpdate(BuildContext context, VeisonCallback callback, |
| 62 | + {showToast = true}) async { | ||
| 29 | String deviceId = await Utils.getUUID(); | 63 | String deviceId = await Utils.getUUID(); |
| 30 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 64 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 31 | - int versionCode = await Utils.getCurrBuildNum(); | 65 | + int versionCode = await AzhonAppUpdate.getVersionCode; |
| 32 | String make = "3"; | 66 | String make = "3"; |
| 33 | if (Platform.isIOS) make = "4"; | 67 | if (Platform.isIOS) make = "4"; |
| 34 | Map<String, String> params = { | 68 | Map<String, String> params = { |
| @@ -57,7 +91,7 @@ class UpdateModel { | @@ -57,7 +91,7 @@ class UpdateModel { | ||
| 57 | "file_url": dataMap["file_url"].toString(), | 91 | "file_url": dataMap["file_url"].toString(), |
| 58 | "content": dataMap["content"].toString() | 92 | "content": dataMap["content"].toString() |
| 59 | }); | 93 | }); |
| 60 | - showUpdateDialog(context, version); | 94 | + callback(version); |
| 61 | } else { | 95 | } else { |
| 62 | if (showToast) { | 96 | if (showToast) { |
| 63 | Utils.showToast(baseResp?.msg ?? "当前已是最新版本"); | 97 | Utils.showToast(baseResp?.msg ?? "当前已是最新版本"); |
| @@ -151,10 +185,16 @@ class UpdateModel { | @@ -151,10 +185,16 @@ class UpdateModel { | ||
| 151 | Expanded( | 185 | Expanded( |
| 152 | child: GestureDetector( | 186 | child: GestureDetector( |
| 153 | onTap: () { | 187 | onTap: () { |
| 154 | - Navigator.of(context).pop(); | ||
| 155 | if (Platform.isAndroid) { | 188 | if (Platform.isAndroid) { |
| 156 | - downloadApk(pageContext, version.file_url); | 189 | + // 原来的更新 |
| 190 | + // downloadApk(pageContext, version.file_url); | ||
| 191 | + //新的更新 | ||
| 192 | + | ||
| 193 | + // tryOtaUpdate(version.file_url); | ||
| 194 | + simpleUse(false, version.file_url); | ||
| 195 | + Navigator.of(context).pop(); | ||
| 157 | } else { | 196 | } else { |
| 197 | + Navigator.of(context).pop(); | ||
| 158 | InstallPlugin.gotoAppStore( | 198 | InstallPlugin.gotoAppStore( |
| 159 | "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490"); | 199 | "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490"); |
| 160 | } | 200 | } |
| @@ -356,6 +356,13 @@ packages: | @@ -356,6 +356,13 @@ packages: | ||
| 356 | url: "https://pub.flutter-io.cn" | 356 | url: "https://pub.flutter-io.cn" |
| 357 | source: hosted | 357 | source: hosted |
| 358 | version: "1.2.0" | 358 | version: "1.2.0" |
| 359 | + flutter_app_update: | ||
| 360 | + dependency: "direct main" | ||
| 361 | + description: | ||
| 362 | + name: flutter_app_update | ||
| 363 | + url: "https://pub.flutter-io.cn" | ||
| 364 | + source: hosted | ||
| 365 | + version: "1.0.2" | ||
| 359 | flutter_blurhash: | 366 | flutter_blurhash: |
| 360 | dependency: transitive | 367 | dependency: transitive |
| 361 | description: | 368 | description: |
| @@ -506,6 +513,13 @@ packages: | @@ -506,6 +513,13 @@ packages: | ||
| 506 | url: "https://pub.flutter-io.cn" | 513 | url: "https://pub.flutter-io.cn" |
| 507 | source: hosted | 514 | source: hosted |
| 508 | version: "1.1.6" | 515 | version: "1.1.6" |
| 516 | + in_app_update: | ||
| 517 | + dependency: "direct main" | ||
| 518 | + description: | ||
| 519 | + name: in_app_update | ||
| 520 | + url: "https://pub.flutter-io.cn" | ||
| 521 | + source: hosted | ||
| 522 | + version: "2.0.0" | ||
| 509 | install_plugin: | 523 | install_plugin: |
| 510 | dependency: "direct main" | 524 | dependency: "direct main" |
| 511 | description: | 525 | description: |
| @@ -611,6 +625,13 @@ packages: | @@ -611,6 +625,13 @@ packages: | ||
| 611 | url: "https://pub.flutter-io.cn" | 625 | url: "https://pub.flutter-io.cn" |
| 612 | source: hosted | 626 | source: hosted |
| 613 | version: "0.3.0" | 627 | version: "0.3.0" |
| 628 | + ota_update: | ||
| 629 | + dependency: "direct main" | ||
| 630 | + description: | ||
| 631 | + name: ota_update | ||
| 632 | + url: "https://pub.flutter-io.cn" | ||
| 633 | + source: hosted | ||
| 634 | + version: "3.1.1" | ||
| 614 | package_config: | 635 | package_config: |
| 615 | dependency: transitive | 636 | dependency: transitive |
| 616 | description: | 637 | description: |
| @@ -120,6 +120,9 @@ dependencies: | @@ -120,6 +120,9 @@ dependencies: | ||
| 120 | lpinyin: ^2.0.3 | 120 | lpinyin: ^2.0.3 |
| 121 | #图片压缩 | 121 | #图片压缩 |
| 122 | flutter_native_image: ^0.0.6+1 | 122 | flutter_native_image: ^0.0.6+1 |
| 123 | + #更新apk | ||
| 124 | + ota_update: ^3.1.1 | ||
| 125 | + flutter_app_update: ^1.0.2 | ||
| 123 | sendsms: | 126 | sendsms: |
| 124 | path: library/sendsms-1.0.3 | 127 | path: library/sendsms-1.0.3 |
| 125 | 128 |
-
Please register or login to post a comment