From 101d94a5230b8c27127fd483a4005795466dc591 Mon Sep 17 00:00:00 2001 From: tzw Date: Tue, 28 Jan 2025 17:07:57 +0630 Subject: [PATCH 1/2] add lock file --- pubspec.lock | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 9896512..9b6dbb3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -222,14 +222,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" - country_code_picker: - dependency: "direct main" - description: - name: country_code_picker - sha256: fdc2ae84d0342d4a7c6ebc83fbe002a70c8231ff5734505676292fc2c2cc4433 - url: "https://pub.dev" - source: hosted - version: "3.1.0" country_icons: dependency: "direct main" description: @@ -238,6 +230,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" + country_picker: + dependency: "direct main" + description: + name: country_picker + sha256: "9b14c04f9a35e99f6de6bcbc453a556bb98345aecb481c7a0e843c94c2bee1f8" + url: "https://pub.dev" + source: hosted + version: "2.0.27" coverage: dependency: transitive description: @@ -1446,6 +1446,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + universal_io: + dependency: transitive + description: + name: universal_io + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.dev" + source: hosted + version: "2.2.2" url_launcher: dependency: "direct main" description: From 392bf42ab4a4eaf471199f77b319525a6de36793 Mon Sep 17 00:00:00 2001 From: tzw Date: Tue, 28 Jan 2025 18:50:24 +0630 Subject: [PATCH 2/2] add support build number for android --- lib/domain/entities/setting.dart | 7 +++++-- lib/pages/main/model/main_model.dart | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/domain/entities/setting.dart b/lib/domain/entities/setting.dart index 3a4ddaf..fa56660 100644 --- a/lib/domain/entities/setting.dart +++ b/lib/domain/entities/setting.dart @@ -10,6 +10,7 @@ List dayLists = [ class Setting { final int supportBuildNum; + final int androidSupportBuildNum; final String reportURL; final String reportProjectID; final String bucketName; @@ -32,7 +33,8 @@ class Setting { List shipmentTypes; Setting( - {this.supportBuildNum = 1, + {this.androidSupportBuildNum = 1, + this.supportBuildNum = 1, this.usaAddress, this.mmAddress, this.usaContactNumber, @@ -54,7 +56,8 @@ class Setting { factory Setting.fromMap(Map map) { return Setting( - supportBuildNum: map['support_build_number'], + androidSupportBuildNum: map['android_support_build_number'] ?? 1, + supportBuildNum: map['support_build_number'] ?? 1, inviteRequired: map['invite_required'], appUrl: map['app_url'], usaAddress: map['usa_address'], diff --git a/lib/pages/main/model/main_model.dart b/lib/pages/main/model/main_model.dart index 6494085..4761306 100644 --- a/lib/pages/main/model/main_model.dart +++ b/lib/pages/main/model/main_model.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:fcs/data/services/services.dart'; import 'package:fcs/domain/entities/auth_result.dart'; @@ -150,7 +151,11 @@ class MainModel extends ChangeNotifier { bool isSupport() { if (packageInfo == null || setting == null) return false; - return int.parse(packageInfo!.buildNumber) >= setting!.supportBuildNum; + + int buildNumber = Platform.isAndroid + ? setting!.androidSupportBuildNum + : setting!.supportBuildNum; + return int.parse(packageInfo!.buildNumber) >= buildNumber; } Future sendSms(String phoneNumber,