From b0c96f8b164deff7afd2afe941848342bc605c15 Mon Sep 17 00:00:00 2001 From: franticn Date: Mon, 23 Dec 2024 14:56:16 +0800 Subject: [PATCH 1/4] fix: Fix FormatException caused by '@' in Custom Flutter Version --- lib/src/models/flutter_version_model.dart | 10 +++++----- test/models/flutter_version_model_test.dart | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/src/models/flutter_version_model.dart b/lib/src/models/flutter_version_model.dart index a1d5fcc6..9f7b45c8 100644 --- a/lib/src/models/flutter_version_model.dart +++ b/lib/src/models/flutter_version_model.dart @@ -58,8 +58,12 @@ class FlutterVersion with FlutterVersionMappable { : type = VersionType.release; factory FlutterVersion.parse(String version) { - final parts = version.split('@'); + // Check if its custom. + if (version.startsWith('custom_')) { + return FlutterVersion.custom(version); + } + final parts = version.split('@'); if (parts.length == 2) { final channel = parts.last; if (kFlutterChannels.contains(channel)) { @@ -68,10 +72,6 @@ class FlutterVersion with FlutterVersionMappable { throw FormatException('Invalid version format'); } - // Check if its custom. - if (version.startsWith('custom_')) { - return FlutterVersion.custom(version); - } // Check if its commit if (isGitCommit(version)) { diff --git a/test/models/flutter_version_model_test.dart b/test/models/flutter_version_model_test.dart index 6961944d..c51bfca3 100644 --- a/test/models/flutter_version_model_test.dart +++ b/test/models/flutter_version_model_test.dart @@ -80,6 +80,13 @@ void main() { expect(version.type, VersionType.custom); }); + test('custom constructor', () { + final version = FlutterVersion.custom('custom_3.7.0@huawei'); + expect(version.name, 'custom_3.7.0@huawei'); + expect(version.releaseFromChannel, isNull); + expect(version.type, VersionType.custom); + }); + test('release constructor', () { final version = FlutterVersion.release('1.0.0', releaseFromChannel: 'stable'); @@ -109,6 +116,13 @@ void main() { expect(version.type, VersionType.custom); }); + test('parse method - custom version', () { + final version = FlutterVersion.parse('custom_3.6.0@huawei'); + expect(version.name, 'custom_3.6.0@huawei'); + expect(version.releaseFromChannel, isNull); + expect(version.type, VersionType.custom); + }); + test('parse method - commit version', () { final version = FlutterVersion.parse('f4c74a6ec3'); expect(version.name, 'f4c74a6ec3'); @@ -161,6 +175,12 @@ void main() { expect(version.isCustom, isTrue); }); + + test('isCustom getter', () { + final version = FlutterVersion.custom('custom_3.22.0@huawei'); + expect(version.isCustom, isTrue); + }); + test('printFriendlyName getter - channel version', () { final version = FlutterVersion.channel('stable'); expect(version.printFriendlyName, 'Channel: Stable'); From f1c71241a69d0515b84b35f68cac1a9c5ff45711 Mon Sep 17 00:00:00 2001 From: flat-data Date: Mon, 13 Jan 2025 23:01:03 +0000 Subject: [PATCH 2/4] Flat: latest data (2025-01-13T23:01:03.050Z) { "date": "2025-01-13T23:01:03.050Z", "files": [ { "name": "releases_macos.json", "deltaBytes": 790, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json" }, { "name": "releases_windows.json", "deltaBytes": 395, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_windows.json" }, { "name": "releases_linux.json", "deltaBytes": 394, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json" } ] } --- releases_linux.json | 12 +++++++++++- releases_macos.json | 22 +++++++++++++++++++++- releases_windows.json | 12 +++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/releases_linux.json b/releases_linux.json index 60653b72..2137ce85 100644 --- a/releases_linux.json +++ b/releases_linux.json @@ -3,9 +3,19 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "17025dd88227cd9532c33fa78f5250d548d87e9a" + "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" }, "releases": [ + { + "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", + "channel": "stable", + "version": "3.27.2", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-13T22:31:44.493761Z", + "archive": "stable/linux/flutter_linux_3.27.2-stable.tar.xz", + "sha256": "5ba77ace2b2748a251473a89785e8b8305cefd3e9dafafd7a197cda0b803c55a" + }, { "hash": "17025dd88227cd9532c33fa78f5250d548d87e9a", "channel": "stable", diff --git a/releases_macos.json b/releases_macos.json index a264d9dc..a17ddc09 100644 --- a/releases_macos.json +++ b/releases_macos.json @@ -3,9 +3,29 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "17025dd88227cd9532c33fa78f5250d548d87e9a" + "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" }, "releases": [ + { + "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", + "channel": "stable", + "version": "3.27.2", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-13T22:27:04.890409Z", + "archive": "stable/macos/flutter_macos_3.27.2-stable.zip", + "sha256": "26c96cd7e4682ffc15a741d2963b15b87123875cb2fbb8ac5dbdc1aee41f5388" + }, + { + "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", + "channel": "stable", + "version": "3.27.2", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "arm64", + "release_date": "2025-01-13T22:20:35.633578Z", + "archive": "stable/macos/flutter_macos_arm64_3.27.2-stable.zip", + "sha256": "e8333d7f7d3718d80b50445017a426fda3ffa1936dfed7753ec74e43c90becd4" + }, { "hash": "17025dd88227cd9532c33fa78f5250d548d87e9a", "channel": "stable", diff --git a/releases_windows.json b/releases_windows.json index 2c9d7e74..7fea45b0 100644 --- a/releases_windows.json +++ b/releases_windows.json @@ -3,9 +3,19 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "17025dd88227cd9532c33fa78f5250d548d87e9a" + "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" }, "releases": [ + { + "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", + "channel": "stable", + "version": "3.27.2", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-13T22:30:36.187540Z", + "archive": "stable/windows/flutter_windows_3.27.2-stable.zip", + "sha256": "ed4ae71a30dfdd04a8a1053d9e354314ab95f4731930d39d9b656d36209cc41d" + }, { "hash": "17025dd88227cd9532c33fa78f5250d548d87e9a", "channel": "stable", From 06154afd2bb58a049871c045e2dbabe4de26fc62 Mon Sep 17 00:00:00 2001 From: flat-data Date: Tue, 21 Jan 2025 21:01:00 +0000 Subject: [PATCH 3/4] Flat: latest data (2025-01-21T21:01:00.965Z) { "date": "2025-01-21T21:01:00.965Z", "files": [ { "name": "releases_macos.json", "deltaBytes": 790, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json" }, { "name": "releases_windows.json", "deltaBytes": 395, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_windows.json" }, { "name": "releases_linux.json", "deltaBytes": 394, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json" } ] } --- releases_linux.json | 12 +++++++++++- releases_macos.json | 22 +++++++++++++++++++++- releases_windows.json | 12 +++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/releases_linux.json b/releases_linux.json index 2137ce85..c931d0a9 100644 --- a/releases_linux.json +++ b/releases_linux.json @@ -3,9 +3,19 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" + "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", + "channel": "stable", + "version": "3.27.3", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-21T20:35:29.161615Z", + "archive": "stable/linux/flutter_linux_3.27.3-stable.tar.xz", + "sha256": "b5b60424c51ff11b62cc2fad44cdb334c7ac49cb737ae87451c9c09e13aa01d6" + }, { "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", "channel": "stable", diff --git a/releases_macos.json b/releases_macos.json index a17ddc09..fec9a6e7 100644 --- a/releases_macos.json +++ b/releases_macos.json @@ -3,9 +3,29 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" + "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", + "channel": "stable", + "version": "3.27.3", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-21T20:33:49.233815Z", + "archive": "stable/macos/flutter_macos_3.27.3-stable.zip", + "sha256": "b1117c4e1a80ae13a1ba6281b8141e429cb62fc5382386e2a78e00d12a423706" + }, + { + "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", + "channel": "stable", + "version": "3.27.3", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "arm64", + "release_date": "2025-01-21T20:27:29.326710Z", + "archive": "stable/macos/flutter_macos_arm64_3.27.3-stable.zip", + "sha256": "20d1ca79dad65f9f9fcd4c31bdbbbcc2237aa0cd384a83d6dff795d44fe1039a" + }, { "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", "channel": "stable", diff --git a/releases_windows.json b/releases_windows.json index 7fea45b0..5227918c 100644 --- a/releases_windows.json +++ b/releases_windows.json @@ -3,9 +3,19 @@ "current_release": { "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", - "stable": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" + "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", + "channel": "stable", + "version": "3.27.3", + "dart_sdk_version": "3.6.1", + "dart_sdk_arch": "x64", + "release_date": "2025-01-21T20:47:44.369846Z", + "archive": "stable/windows/flutter_windows_3.27.3-stable.zip", + "sha256": "cd1a66704fe075a8c8bc2c558dd4dcec171ba396a84aea88e3d48c23852d62c3" + }, { "hash": "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3", "channel": "stable", From a06d75085e0ae4fa42ada087987b373b8652c424 Mon Sep 17 00:00:00 2001 From: flat-data Date: Mon, 27 Jan 2025 21:00:59 +0000 Subject: [PATCH 4/4] Flat: latest data (2025-01-27T21:00:59.751Z) { "date": "2025-01-27T21:00:59.751Z", "files": [ { "name": "releases_macos.json", "deltaBytes": 860, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_macos.json" }, { "name": "releases_windows.json", "deltaBytes": 430, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_windows.json" }, { "name": "releases_linux.json", "deltaBytes": 429, "source": "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json" } ] } --- releases_linux.json | 12 +++++++++++- releases_macos.json | 34 +++++++++++++++++++++++++++------- releases_windows.json | 12 +++++++++++- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/releases_linux.json b/releases_linux.json index c931d0a9..7ab652dd 100644 --- a/releases_linux.json +++ b/releases_linux.json @@ -1,11 +1,21 @@ { "base_url": "https://storage.googleapis.com/flutter_infra_release/releases", "current_release": { - "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", + "beta": "45459707c029b168a61dcde1f1c1d64df9d529af", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "45459707c029b168a61dcde1f1c1d64df9d529af", + "channel": "beta", + "version": "3.29.0-0.2.pre", + "dart_sdk_version": "3.7.0 (build 3.7.0-323.1.beta)", + "dart_sdk_arch": "x64", + "release_date": "2025-01-27T20:27:45.101671Z", + "archive": "beta/linux/flutter_linux_3.29.0-0.2.pre-beta.tar.xz", + "sha256": "4affbc9f2b8c3b83b086471a46a7c908afca381d78339e5cba42982e66b3191b" + }, { "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", "channel": "stable", diff --git a/releases_macos.json b/releases_macos.json index fec9a6e7..776b752c 100644 --- a/releases_macos.json +++ b/releases_macos.json @@ -1,11 +1,31 @@ { "base_url": "https://storage.googleapis.com/flutter_infra_release/releases", "current_release": { - "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", + "beta": "45459707c029b168a61dcde1f1c1d64df9d529af", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "45459707c029b168a61dcde1f1c1d64df9d529af", + "channel": "beta", + "version": "3.29.0-0.2.pre", + "dart_sdk_version": "3.7.0 (build 3.7.0-323.1.beta)", + "dart_sdk_arch": "x64", + "release_date": "2025-01-27T20:19:00.875075Z", + "archive": "beta/macos/flutter_macos_3.29.0-0.2.pre-beta.zip", + "sha256": "52132c40c7f71a1ab5b621020505a5b95c2413ed5c1326c250c9e0272d16ff3c" + }, + { + "hash": "45459707c029b168a61dcde1f1c1d64df9d529af", + "channel": "beta", + "version": "3.29.0-0.2.pre", + "dart_sdk_version": "3.7.0 (build 3.7.0-323.1.beta)", + "dart_sdk_arch": "arm64", + "release_date": "2025-01-27T20:12:08.729699Z", + "archive": "beta/macos/flutter_macos_arm64_3.29.0-0.2.pre-beta.zip", + "sha256": "6d0e3140150f9942bbacef7a336a15d7791935780fd316afb195926fdf006bf5" + }, { "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", "channel": "stable", @@ -291,20 +311,20 @@ "channel": "stable", "version": "3.24.0", "dart_sdk_version": "3.5.0", - "dart_sdk_arch": "arm64", + "dart_sdk_arch": "x64", "release_date": "2024-08-06T17:39:54.402003Z", - "archive": "stable/macos/flutter_macos_arm64_3.24.0-stable.zip", - "sha256": "3c443985c9cda5f6959a274caddfeb38e11777fc8ed8a69ae700a1485e6dd258" + "archive": "stable/macos/flutter_macos_3.24.0-stable.zip", + "sha256": "94ab73b88a4a996c4eb930644838d0863918cbc4a039a8144ccafe2e1cacd304" }, { "hash": "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819", "channel": "stable", "version": "3.24.0", "dart_sdk_version": "3.5.0", - "dart_sdk_arch": "x64", + "dart_sdk_arch": "arm64", "release_date": "2024-08-06T17:39:54.402003Z", - "archive": "stable/macos/flutter_macos_3.24.0-stable.zip", - "sha256": "94ab73b88a4a996c4eb930644838d0863918cbc4a039a8144ccafe2e1cacd304" + "archive": "stable/macos/flutter_macos_arm64_3.24.0-stable.zip", + "sha256": "3c443985c9cda5f6959a274caddfeb38e11777fc8ed8a69ae700a1485e6dd258" }, { "hash": "7c6b7e9ca485f7eaaed913c6bb50f4be6da47e30", diff --git a/releases_windows.json b/releases_windows.json index 5227918c..75304a49 100644 --- a/releases_windows.json +++ b/releases_windows.json @@ -1,11 +1,21 @@ { "base_url": "https://storage.googleapis.com/flutter_infra_release/releases", "current_release": { - "beta": "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe", + "beta": "45459707c029b168a61dcde1f1c1d64df9d529af", "dev": "13a2fb10b838971ce211230f8ffdd094c14af02c", "stable": "c519ee916eaeb88923e67befb89c0f1dabfa83e6" }, "releases": [ + { + "hash": "45459707c029b168a61dcde1f1c1d64df9d529af", + "channel": "beta", + "version": "3.29.0-0.2.pre", + "dart_sdk_version": "3.7.0 (build 3.7.0-323.1.beta)", + "dart_sdk_arch": "x64", + "release_date": "2025-01-27T20:22:33.061347Z", + "archive": "beta/windows/flutter_windows_3.29.0-0.2.pre-beta.zip", + "sha256": "7c095ca994e8f226a60ca433861ae466eeb0a36cc97838ab1b6d1ad1c58be031" + }, { "hash": "c519ee916eaeb88923e67befb89c0f1dabfa83e6", "channel": "stable",